Add move window here functionality.
This commit is contained in:
parent
9ba3e7773f
commit
241b655b50
@ -24,6 +24,7 @@ bindsym $mod+Shift+q kill
|
||||
|
||||
bindsym $mod+d exec wofi --show run -i
|
||||
bindsym $mod+Tab exec ~/etc/wofi-windows
|
||||
bindsym $mod+shift+Tab exec ~/etc/wofi-windows movehere
|
||||
bindsym $mod+p exec ~/etc/wofi-pass
|
||||
|
||||
define([dir_bind], [
|
||||
|
19
wofi-windows
19
wofi-windows
@ -3,8 +3,19 @@
|
||||
# Get available windows
|
||||
windows=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.type=="con"),select(.type=="floating_con")|(.id|tostring)+" "+.app_id+": "+.name')
|
||||
|
||||
# Select window with rofi
|
||||
selected=$(echo "$windows" | wofi --show dmenu -i -p 'go to window' | awk '{print $1}')
|
||||
case "$1" in
|
||||
movehere)
|
||||
cmd="move workspace current"
|
||||
prompt="move window here"
|
||||
;;
|
||||
*)
|
||||
cmd="focus"
|
||||
prompt="go to window"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Tell sway to focus said window
|
||||
swaymsg "[con_id=$selected]" focus
|
||||
# Select window with rofi
|
||||
selected=$(echo "$windows" | wofi --show dmenu -i -p "$prompt" | awk '{print $1}')
|
||||
|
||||
# Tell sway to frobnicate said window
|
||||
swaymsg "[con_id=$selected]" $cmd
|
||||
|
Loading…
Reference in New Issue
Block a user