mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
fix and remove sed from __fish_print_xrandr_modes.fish
This commit is contained in:
parent
374772e539
commit
70c80c9d0e
1 changed files with 9 additions and 11 deletions
|
@ -1,13 +1,11 @@
|
||||||
function __fish_print_xrandr_modes --description 'Print xrandr modes'
|
function __fish_print_xrandr_modes --description 'Print xrandr modes'
|
||||||
set -l out
|
set -l output
|
||||||
xrandr | sed '/^Screen/d; s/^ \+/mode: /' | while read -l output mode misc
|
xrandr | string match -v -r '^(Screen|\s{4,})' | while read line
|
||||||
switch $output
|
switch $line
|
||||||
case mode:
|
case ' *'
|
||||||
echo $mode\t(echo $misc | sed 's/\(^ \+\)\|\( *$\)//') [$out]
|
string trim $line | string replace -r '^(\S+)\s+(.*)$' "\$1\t\$2 [$output]"
|
||||||
case '*'
|
case '*'
|
||||||
set out $output
|
set output (string match -r '^\S+' $line)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue