Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- now=$(date +"%T")
- notify-send "Reloading $now"
- EDITOR=/usr/bin/subl
- FILEMANAGER=/usr/bin/thunar
- # reset keyboard settings
- setxkbmap
- # Free up the mod3 flag from all keys it may be associated with:
- xmodmap -e "clear mod3"
- xmodmap -e "clear mod4"
- # Add Hyper_L to the grave key (the ` and ~ upper left, left of 1)
- xmodmap -e "keycode 49 = Hyper_L asciitilde grave asciitilde"
- # You need a grave key somewhere else (!!!) so, bind it to a non-existing key like 250:
- xmodmap -e "keycode 250 = grave"
- # Restore Mod4 but without Hyper_L (which was at location 4)
- xmodmap -e "add mod4 = Super_L Super_R Super_L"
- # This does generate an error, but it works for me now:
- xmodmap -e "add mod3 = Hyper_L"
- #Reload self:
- me=$(readlink -e -- "$0")
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>1 -s "$me" --create -t string
- # Edit self
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>equal -s "$EDITOR $me" --create -t string
- dist=100 # Move fast
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>Right -s "xdotool mousemove_relative -- $dist 0" --create -t string
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>Down -s "xdotool mousemove_relative -- 0 $dist" --create -t string
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>Left -s "xdotool mousemove_relative -- -$dist 0" --create -t string
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>Up -s "xdotool mousemove_relative -- 0 -$dist" --create -t string
- altdist=1 # Move slow
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Alt\>\<Hyper\>Right -s "xdotool mousemove_relative -- $altdist 0" --create -t string
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Alt\>\<Hyper\>Down -s "xdotool mousemove_relative -- 0 $altdist" --create -t string
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Alt\>\<Hyper\>Left -s "xdotool mousemove_relative -- -$altdist 0" --create -t string
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Alt\>\<Hyper\>Up -s "xdotool mousemove_relative -- 0 -$altdist" --create -t string
- # Click mouse:
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>space -s "xdotool click 1" --create -t string
- # Audacious/Music:
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>KP_Multiply -s "/usr/bin/audacious -t" --create -t string
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>KP_Divide -s "xdotool key --window \"$(xdotool search --class audacious | tail -1)\" Left" --create -t string
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>KP_Subtract -s "xdotool key --window \"$(xdotool search --class audacious | tail -1)\" Right" --create -t string
- # Open shortcut menu:
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>k -s "xfce4-keyboard-settings" --create -t string
- # Random Album
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Primary\>\<Shift\>F9 -s "$HOME/scripts/random_album.sh" --create -t string
- # Open locations:
- /usr/bin/xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/\<Hyper\>F5 -s "$FILEMANAGER $HOME/Music" --create -t string
- ### echo close all xfconfd
- # killall -v xfconfd
- # echo starting xfconfd to background
- # /usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd &
- ## starting xcape to produce a grave after keypress
- killall xcape
- xcape -t5000 -e "#49=grave;Super_L=Control_L|Escape" &
- now=$(date +"%T")
- notify-send "Reload $now"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement