Move xrandr functions into randr completions

Part of #5279.

[ci skip]
This commit is contained in:
Fabian Homborg 2019-03-15 19:51:58 +01:00
parent a1380a736b
commit 1c3c76165e
3 changed files with 15 additions and 14 deletions

View File

@ -1,3 +1,18 @@
function __fish_print_xrandr_outputs --description 'Print xrandr outputs'
xrandr | string replace -r --filter '^(\S+)\s+(.*)$' '$1\t$2' | string match -v -e Screen
end
function __fish_print_xrandr_modes --description 'Print xrandr modes'
set -l output
xrandr | string match -v -r '^(Screen|\s{4,})' | while read line
switch $line
case ' *'
string trim $line | string replace -r '^(\S+)\s+(.*)$' "\$1\t\$2 [$output]"
case '*'
set output (string match -r '^\S+' $line)
end
end
end
complete -c xrandr -l verbose -d 'Be more verbose'
complete -c xrandr -l dryrun -d 'Make no changes'
complete -c xrandr -l nograb -d 'Apply modifications without grabbing the screen'

View File

@ -1,11 +0,0 @@
function __fish_print_xrandr_modes --description 'Print xrandr modes'
set -l output
xrandr | string match -v -r '^(Screen|\s{4,})' | while read line
switch $line
case ' *'
string trim $line | string replace -r '^(\S+)\s+(.*)$' "\$1\t\$2 [$output]"
case '*'
set output (string match -r '^\S+' $line)
end
end
end

View File

@ -1,3 +0,0 @@
function __fish_print_xrandr_outputs --description 'Print xrandr outputs'
xrandr | string replace -r --filter '^(\S+)\s+(.*)$' '$1\t$2' | string match -v -e Screen
end