Skip to content

Instantly share code, notes, and snippets.

@saml
Last active December 21, 2016 15:10
Show Gist options
  • Save saml/2ace75113379bb02e99eb04b644468dd to your computer and use it in GitHub Desktop.
Save saml/2ace75113379bb02e99eb04b644468dd to your computer and use it in GitHub Desktop.
srandrd autostart
#!/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
[Desktop Entry]
Type=Application
Name=All Autostarts
Comment=Single script for auto start
Exec=/home/saml/.config/autostart/autostart.bash
#!/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
@saml
Copy link
Author

saml commented Dec 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment