mirror of
https://github.com/balkian/dotfiles.git
synced 2025-08-24 00:02:19 +00:00
Simplified monitor setup and locking
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
case "$1" in
|
||||
locknow)
|
||||
scrot /tmp/screen.png
|
||||
convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png
|
||||
i3lock -e -i /tmp/screen.png
|
||||
;;
|
||||
autolock)
|
||||
xautolock -time 10 -corners "----" -locker "$0 locknow"
|
||||
;;
|
||||
lock)
|
||||
xautolock -locknow
|
||||
;;
|
||||
|
@@ -1,34 +1,9 @@
|
||||
#!/bin/sh
|
||||
case $1 in
|
||||
"single")
|
||||
case $2 in
|
||||
"HDMI")
|
||||
~/.screenlayout/gsi-single.sh
|
||||
xrandr --output eDP1 --off --output DVI-1 --off --output DP1 --off --output HDMI1 --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off
|
||||
;;
|
||||
*)
|
||||
#xrandr --auto --output eDP1 --primary --output DP1 --off
|
||||
~/.screenlayout/gsi-single.sh
|
||||
xrandr --output HDMI1 --off --output DVI-1 --off --output DP1 --off --output eDP1 --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"dual")
|
||||
case $2 in
|
||||
"mirror")
|
||||
xrandr --output DP1 --off --output VIRTUAL1 --off --output eDP1 --mode 1920x1080 --rotate normal --output HDMI1 --primary --mode 1920x1080 --same-as eDP1 --output VGA1 --off
|
||||
;;
|
||||
"home")
|
||||
xrandr --output DP1 --off --output VIRTUAL1 --off --output eDP1 --mode 1920x1080 --pos 0x1080 --rotate normal --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off
|
||||
;;
|
||||
*)
|
||||
#xrandr --auto --output eDP1 --primary --right-of DP1
|
||||
xrandr --output VIRTUAL1 --off --output DP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --off --output eDP1 --mode 1920x1080 --pos 1920x0 --rotate normal --output VGA1 --off
|
||||
xrandr --output "DVI-1-0" --off
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
if [ "$#" -lt 1 ]; then
|
||||
ls -1 ~/.screenlayout | rofi -dmenu | xargs -I '{}' sh "$HOME/.screenlayout/{}" || exit
|
||||
else
|
||||
sh $HOME/.screenlayout/$1.sh
|
||||
fi
|
||||
if [ `command -v nitrogen` ]; then
|
||||
nitrogen --restore
|
||||
fi
|
||||
|
Reference in New Issue
Block a user