shell: alias mon: same-as or monitor direction

This commit is contained in:
lupan committed 2026-10-05 21:17:37 +02:00
1 parent a1e71faa94
commit d0a863dcdf
1 file changed
+4 -2
+4 -2
View File
@@ -19,9 +19,11 @@ alias fixdp='xrandr --output DP-0 --right-of DP-2'
alias a4='COLORTERM=truecolor TERM=xterm-256color a4' alias a4='COLORTERM=truecolor TERM=xterm-256color a4'
mon() { mon() {
local mon=$(KFF_DEFAULT_COMMAND='xrandr --listmonitors | tail +2' kff | awk '{print $NF}') local mon=$(KFF_DEFAULT_COMMAND='xrandr | grep -i "^[a-z]"' kff | awk '{print $1}')
local res=$(KFF_DEFAULT_COMMAND='echo "1920x1080\n2560x1440\n3840x2160"' kff) local res=$(KFF_DEFAULT_COMMAND='echo "1920x1080\n2560x1440\n3840x2160"' kff)
xrandr --output "$mon" --mode "$res" --auto local where=$(KFF_DEFAULT_COMMAND='echo "left-of\nright-of\nbelow\nabove\nsame-as"' kff)
local alt=$(KFF_DEFAULT_COMMAND='xrandr | grep -i "^[a-z]"' kff | awk '{print $1}')
xrandr --output "$mon" --mode "$res" "--$where" "$alt" --auto
} }
zzz() { zzz() {