mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 11:43:37 +08:00
12 lines
329 B
Fish
12 lines
329 B
Fish
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
|