move script folders to a correct place, some vim config changes, etc...
This commit is contained in:
parent
c360fc2339
commit
ffe452fe24
28 changed files with 380 additions and 360 deletions
36
.local/bin/scripts/dual_monitor
Executable file
36
.local/bin/scripts/dual_monitor
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
MODELINE=$(cvt 4120 1440 144 | tail -1 | cut -d " " -f 2- | tr -d '"')
|
||||
RES="$(echo $MODELINE | cut -d ' ' -f 1 | tr -d '\"')"
|
||||
OUTPUT="DVI-I-1-1"
|
||||
|
||||
create() {
|
||||
xrandr --newmode $(echo $MODELINE)
|
||||
xrandr --addmode ${OUTPUT} "${RES}"
|
||||
xrandr --output ${OUTPUT} --mode "${RES}"
|
||||
}
|
||||
|
||||
remove() {
|
||||
xrandr --output ${OUTPUT} --off
|
||||
xrandr --delmode ${OUTPUT} "${RES}"
|
||||
xrandr --rmmode "${RES}"
|
||||
}
|
||||
|
||||
create_or_remove() {
|
||||
if [ ! -z "$(xrandr | grep ${RES} | grep '*')" ]; then
|
||||
remove
|
||||
else
|
||||
create
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'-c'|'--create') create
|
||||
;;
|
||||
'-d'|'--delete') remove
|
||||
;;
|
||||
*) create_or_remove
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue