Last active
December 21, 2016 15:10
-
-
Save saml/2ace75113379bb02e99eb04b644468dd to your computer and use it in GitHub Desktop.
srandrd autostart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pkill -0 ibus-daemon || ibus-daemon -d | |
pkill -0 conky || conky -d | |
pkill -0 srandrd || $HOME/bin/srandrd $HOME/bin/srandrd.bash | |
SRANDRD_ACTION="$(xrandr | grep -e '^DP-1 ' | cut -d' ' -f1,2)" $HOME/bin/srandrd.bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Application | |
Name=All Autostarts | |
Comment=Single script for auto start | |
Exec=/home/saml/.config/autostart/autostart.bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
date | |
echo $SRANDRD_ACTION | |
echo $SRANDRD_EDID | |
echo $SRANDRD_SCREENID | |
case "$SRANDRD_ACTION" in | |
"DP-1 disconnected") | |
xrandr --output eDP-1 --auto --mode 1920x1080 --pos 0x0 | |
killall -s SIGHUP conky | |
setxkbmap -option ctrl:swapcaps | |
;; | |
"DP-1 connected") | |
xrandr --output DP-1 --auto --left-of eDP-1 --output eDP-1 --auto --mode 1920x1080 | |
killall -s SIGHUP conky | |
setxkbmap -option ctrl:swapcaps | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/jceb/srandrd