mirror of
https://github.com/phillipberndt/autorandr
synced 2025-01-25 00:23:16 +00:00
41 lines
1.7 KiB
Plaintext
41 lines
1.7 KiB
Plaintext
#compdef autorandr
|
|
|
|
__autorandr_profile () {
|
|
declare -a virtual
|
|
virtual=("off":"disable all outputs"
|
|
"common":"clone at the largest common resolution"
|
|
"clone-largest":"clone with the largest resolution"
|
|
"horizontal":"stack all connected outputs horizontally"
|
|
"vertical":"stack all connected outputs vertically")
|
|
_describe -t virtual-profiles "virtual profiles" virtual
|
|
__autorandr_saved_profile
|
|
}
|
|
__autorandr_saved_profile () {
|
|
declare -a saved
|
|
saved=(${${(f)${:-"$(autorandr)"}}/ /:})
|
|
_describe -t profiles "saved profiles" saved
|
|
}
|
|
|
|
_autorandr () {
|
|
local curcontext="$curcontext" state line exclude="-s --save -l --load -r --remove -c --change"
|
|
|
|
_arguments -C \
|
|
"(: -)"{-h,--help}"[get help]" \
|
|
"($exclude)"{-c,--change}"[automatically load the first detected profile]" \
|
|
"($exclude)"{-d,--default}"[set default profile]:profile:__autorandr_profile" \
|
|
"($exclude)"{-l,--load}"[load profile]:profile:__autorandr_profile" \
|
|
"($exclude)"{-s,--save}"[save current setup to a profile]:profile: " \
|
|
"($exclude)"{-r,--remove}"[remove profile]:profile:__autorandr_saved_profile" \
|
|
--batch"[run autorandr for all users]" \
|
|
--current"[list current active configurations]" \
|
|
--config"[dump current xrandr setup]" \
|
|
--debug"[enable verbose output]" \
|
|
--dry-run"[don't change anything]" \
|
|
--fingerprint"[fingerprint current hardware]" \
|
|
--force"[force loading of a profile]" \
|
|
--skip-options"[skip xrandr options]:xrandr options:_values -s , options gamma brightness panning transform primary mode pos rate" \
|
|
--version"[show version]"
|
|
}
|
|
|
|
_autorandr "$@"
|