| 1 |
#compdef autorandr |
| 2 |
|
| 3 |
__autorandr_profile () { |
| 4 |
declare -a virtual |
| 5 |
virtual=("off":"disable all outputs" |
| 6 |
"common":"clone at the largest common resolution" |
| 7 |
"clone-largest":"clone with the largest resolution" |
| 8 |
"horizontal":"stack all connected outputs horizontally" |
| 9 |
"vertical":"stack all connected outputs vertically") |
| 10 |
_describe -t virtual-profiles "virtual profiles" virtual |
| 11 |
__autorandr_saved_profile |
| 12 |
} |
| 13 |
__autorandr_saved_profile () { |
| 14 |
declare -a saved |
| 15 |
saved=(${${(f)${:-"$(autorandr)"}}/ /:}) |
| 16 |
_describe -t profiles "saved profiles" saved |
| 17 |
} |
| 18 |
|
| 19 |
_autorandr () { |
| 20 |
local curcontext="$curcontext" state line exclude="-s --save -l --load -r --remove -c --change" |
| 21 |
|
| 22 |
_arguments -C \ |
| 23 |
"(: -)"{-h,--help}"[get help]" \ |
| 24 |
"($exclude)"{-c,--change}"[automatically load the first detected profile]" \ |
| 25 |
"($exclude)"{-d,--default}"[set default profile]:profile:__autorandr_profile" \ |
| 26 |
"($exclude)"{-l,--load}"[load profile]:profile:__autorandr_profile" \ |
| 27 |
"($exclude)"{-s,--save}"[save current setup to a profile]:profile: " \ |
| 28 |
"($exclude)"{-r,--remove}"[remove profile]:profile:__autorandr_saved_profile" \ |
| 29 |
--batch"[run autorandr for all users]" \ |
| 30 |
--current"[list current active configurations]" \ |
| 31 |
--cycle"[cycle through all detected profiles]" \ |
| 32 |
--config"[dump current xrandr setup]" \ |
| 33 |
--debug"[enable verbose output]" \ |
| 34 |
--dry-run"[don't change anything]" \ |
| 35 |
--fingerprint"[fingerprint current hardware]" \ |
| 36 |
--match-edid"[match displays using edid]" \ |
| 37 |
--force"[force loading of a profile]" \ |
| 38 |
--list"[list all profiles]" \ |
| 39 |
--skip-options"[skip xrandr options]:xrandr options:_values -s , options gamma brightness panning transform primary mode pos rate" \ |
| 40 |
--version"[show version]" |
| 41 |
} |
| 42 |
|
| 43 |
_autorandr "$@" |