diff --git a/Makefile b/Makefile index 7a237faf..ce1d4cf9 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ install: all install -D -m 0644 "data/icons/asus_notif_yellow.png" "$(DESTDIR)/usr/share/icons/hicolor/512x512/apps/asus_notif_yellow.png" install -D -m 0644 "data/icons/asus_notif_green.png" "$(DESTDIR)/usr/share/icons/hicolor/512x512/apps/asus_notif_green.png" install -D -m 0644 "data/icons/asus_notif_red.png" "$(DESTDIR)/usr/share/icons/hicolor/512x512/apps/asus_notif_red.png" + install -D -m 0644 "data/_asusctl" "$(DESTDIR)/usr/share/zsh/site-functions/_asusctl" uninstall: rm -f "$(DESTDIR)$(bindir)/$(BIN_C)" @@ -64,6 +65,7 @@ uninstall: rm -f "$(DESTDIR)/lib/systemd/system/$(BIN_D).service" rm -r "$(DESTDIR)/lib/systemd/user/$(BIN_N).service" rm -r "$(DESTDIR)/usr/share/icons/hicolor/512x512/apps/asus_notif_*" + rm -f "$(DESTDIR)/usr/share/zsh/site-functions/_asusctl" update: cargo update diff --git a/data/_asusctl b/data/_asusctl new file mode 100644 index 00000000..3fc70122 --- /dev/null +++ b/data/_asusctl @@ -0,0 +1,50 @@ +function _asusctl() { + local line + + _arguments -C \ + {-h,--help}'[print help message]' \ + {-v,--version}'[print version number]' \ + {-k,--kbd-bright}':[Set keyboard brightness (off, low, med, high)]' \ + {-p,--pwr-profile}':[Set power profile (silent, normal, boost)]' \ + {-c,--chg-limit}':[Set charging limit (20-100)]' \ + ': :((led-mode\:"Set the keyboard lighting from built-in modes" profile\:"Create and configure profiles" graphics\:"Set the graphics mode"))' \ + '*::arg:->args' + case $line[1] in + led-mode) + _arguments ': :((static\:"set a single static colour" + breathe\:"pulse between one or two colours" + strobe\:"strobe through all colours" + rainbow\:"rainbow cycling in one of four directions" + star\:"rain pattern mimicking raindrops" + rain\:"rain pattern of three preset colours" + highlight\:"pressed keys are highlighted to fade" + laser\:"pressed keys generate horizontal laser" + ripple\:"pressed keys ripple outwards like a splash" + pulse\:"set a rapid pulse" + comet\:"set a vertical line zooming from left" + flash\:"set a wide vertical line zooming from left" + multi-static\:"4-zone multi-colour"))' \ + {-h,--help}'[print help message]' \ + '-c:[set the RGB value e.g, ff00ff]' \ + '-s:[set the speed (low, med, high)]' + ;; + profile) + _arguments {-h,--help}'[print help message]' \ + {-c,--create}"[create the profile if it doesn't exist]" \ + {-t,--turbo}':[enable or disable cpu turbo]' \ + {-m,--min-percentage}':[set min cpu scaling (intel)]' \ + {-M,--max-percentage}':[set max cpu scaling (intel)]' \ + {-p,--preset}':[]' \ + {-C,--curve}':[set fan curve]' + + ;; + graphics) + _arguments {-h,--help}'[print help message]' \ + {-m,--mode}':[Set graphics mode (nvidia, hybrid, compute, integrated)]' \ + {-g,--get}'[Get the current mode]' \ + {-p,--pow}'[Get the current power status]' \ + {-f,--force}'[Do not ask for confirmation]' + ;; + esac +} +compdef _asusctl asusctl