add sway config
This commit is contained in:
parent
7326392a88
commit
d136851de4
6 changed files with 410 additions and 1 deletions
sway/scripts
35
sway/scripts/gestures.sh
Executable file
35
sway/scripts/gestures.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
SIDE="$1"
|
||||
workspaces=($(swaymsg -t get_workspaces | jq '.[] | .num'))
|
||||
list_focused=($(swaymsg -t get_workspaces | jq '.[] | .focused'))
|
||||
|
||||
for (( i=0; i<${#workspaces[@]}; i++ ));
|
||||
do
|
||||
if [[ ${list_focused[$i]} == true ]]; then
|
||||
current_workspace=${workspaces[$i]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${workspaces[-1]} == ${workspaces[0]} ]]; then
|
||||
if [[ $current_workspace == "1" ]]; then
|
||||
swaymsg workspace 2
|
||||
|
||||
elif [[ $SIDE == "prev" ]]; then
|
||||
swaymsg workspace $[${workspaces[0]} - 1]
|
||||
|
||||
elif [[ $SIDE == "next" ]]; then
|
||||
swaymsg workspace $[${workspaces[0]} + 1]
|
||||
fi
|
||||
|
||||
elif [[ $SIDE == "prev" ]]; then
|
||||
if [[ $current_workspace == "1" ]]; then
|
||||
swaymsg workspace ${workspaces[-1]}
|
||||
else
|
||||
swaymsg workspace $[$current_workspace - 1]
|
||||
fi
|
||||
|
||||
elif [[ $SIDE == "next" ]]; then
|
||||
swaymsg workspace $[$current_workspace + 1]
|
||||
fi
|
||||
sudo input-emulator touch tap 1280 720
|
16
sway/scripts/lose-focus.sh
Executable file
16
sway/scripts/lose-focus.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
appid="$1"
|
||||
|
||||
while true
|
||||
do
|
||||
while killall -0 blueman-manager
|
||||
do
|
||||
if [[ $(swaymsg -t get_tree | grep -B 39 blueman | grep "focused.: false") != "" ]]; then
|
||||
killall blueman-manager
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
sleep 0.1
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue