sync/i3/run.sh
2015-07-22 16:28:39 -04:00

58 lines
1.8 KiB
Bash
Executable File

#!/bin/zsh
if [ "$1" = "lock" ];then
#!/bin/bash
declare -i ID
ID=`xinput list | grep -Eo 'TouchPad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
declare -i STATE
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
if [ $STATE -eq 1 ];then
xinput disable $ID
echo "Touchpad disabled."
else
xinput enable $ID
echo "Touchpad enabled."
fi
##synclient TouchpadOff=1
#MOUSE=$(xinput list | grep Mouse | sed -e 's/.*id=//' | cut -f 1)
#TRACK=$(xinput list | grep 'TouchPad' | sed -e 's/.*id=//' | cut -f 1)
#xinput set-prop $MOUSE "Device Enabled" 0
#xinput set-prop $TRACK "Device Enabled" 0
##while [ ! "$PASSWORD" = "a" ];do export PASSWORD=$((rofi -dmenu $(i3-color-rofi))</dev/null);done
#xinput set-prop $MOUSE "Device Enabled" 1
#xinput set-prop $TRACK "Device Enabled" 1
##synclient TouchpadOff=0
fi
if [ "$1" = "pass" ];then
pass -c $(ls ~/.password-store/*/*|cut -b-37 --complement|rofi -dmenu $(i3-color-rofi)|sed -e 's/\.gpg//')
fi
if [ "$1" = "screensaver" ];then
cat /tmp/noss||i3lock -di `shuf -n1 -e ~/.i3/wall/*`
fi
if [ "$1" = "wall" ];then
#if [[ -d ~/.i3/wallOM ]];then feh --bg-scale "`shuf -n1 -e ~/.i3/wallOM/*`";else feh --bg-scale "`shuf -n1 -e ~/.i3/wall/*`";fi;
feh --bg-scale "$(shuf -n1 -e ~/.i3/wallOM/*)"
#feh --bg-scale ~/.i3/wall/fbfKNDk.png
fi
if [ "$1" = "swap" ];then
python << EOF
import i3
swap = [output for output in i3.get_outputs() if output['active']]
if len(swap) == 2:
for output in swap:
i3.workspace(output['current_workspace'])
i3.command('move', 'workspace to output right')
EOF
fi
if [ "$1" = "boot" ];then
/usr/bin/xset -b
/usr/bin/xset +fp /usr/share/fonts/X11/misc
/usr/bin/xset +fp /usr/share/fonts/X11/Type1
/usr/bin/xset +fp built-ins
/usr/bin/xset s off
/usr/bin/xset -dpms
/usr/local/bin/i3||/usr/bin/i3
fi