Add killPanel.sh and rotate.sh to config dir

This commit is contained in:
Adam Goldsmith 2017-10-31 04:02:59 -04:00
parent bb81c09ed9
commit aae9ee791d
3 changed files with 35 additions and 5 deletions

View File

@ -34,7 +34,7 @@ bindsym $mod+Shift+e exec thunderbird # start thunderb
bindsym Mod1+Mod4+s exec $config_dir/lock.sh suspend # suspend
bindsym Mod1+Control+l exec $config_dir/lock.sh lock # lock screen
bindsym Mod1+Control+Delete exec $config_dir/lock.sh pick # power menu
bindsym $mod+p exec --no-startup-id ~/.bin/killPanel.sh # restart xfce4-panel
bindsym $mod+p exec --no-startup-id $config_dir/killPanel.sh # restart xfce4-panel
mode "launch" {
bindsym e exec emacsclient -c -n; mode "default"
@ -64,10 +64,10 @@ bindsym Mod1+XF86MonBrightnessUp exec light -A 1
bindsym Mod1+XF86MonBrightnessDown exec light -U 1
# Screen Rotation
bindsym $mod+Mod1+Down exec /home/adam/.bin/rotate.sh 0
bindsym $mod+Mod1+Right exec /home/adam/.bin/rotate.sh 1
bindsym $mod+Mod1+Up exec /home/adam/.bin/rotate.sh 2
bindsym $mod+Mod1+Left exec /home/adam/.bin/rotate.sh 3
bindsym $mod+Mod1+Down exec $config_dir/rotate.sh 0
bindsym $mod+Mod1+Right exec $config_dir/rotate.sh 1
bindsym $mod+Mod1+Up exec $config_dir/rotate.sh 2
bindsym $mod+Mod1+Left exec $config_dir/rotate.sh 3
## Actual i3 Config ##

4
.config/i3/killPanel.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
pkill xfce4-panel
xfce4-panel -d &

26
.config/i3/rotate.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
ids=$(xinput --list|grep "SAM\|Digitizer"|grep -oP "id=\K[\w]*")
#ids=( 9 10 11 )
transform_matrix=""
rotate=$1
case $rotate in
0) #normal
transform_matrix="1 0 0 0 1 0 0 0 1";;
1) #left
transform_matrix="0 -1 1 1 0 0 0 0 1";;
2) #inverted
transform_matrix="-1 0 1 0 -1 1 0 0 1";;
3) #right
transform_matrix="0 1 0 -1 0 1 0 0 1";;
esac
for input in ${ids[@]}; do
echo xinput set-prop $input "Coordinate Transformation Matrix" $transform_matrix
xinput set-prop $input "Coordinate Transformation Matrix" $transform_matrix
done
xrandr -o $rotate