[sway] Use $mod+c with my own sway-center-window
This commit is contained in:
parent
907e774ee4
commit
6bae4448d0
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
client_info=$(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true)')
|
||||||
|
pid=$(echo "$client_info"| jq .id)
|
||||||
|
info_file="/dev/shm/sway-width-${pid}"
|
||||||
|
current_info_file="/dev/shm/sway-width-${pid}.current"
|
||||||
|
echo "$client_info" > "$info_file"
|
||||||
|
|
||||||
|
if [[ -f $current_info_file ]]; then
|
||||||
|
width=$(<"$current_info_file")
|
||||||
|
fi;
|
||||||
|
|
||||||
|
if [[ -z "${width}" ]]; then
|
||||||
|
echo "None yet"
|
||||||
|
echo 25 > "${current_info_file}"
|
||||||
|
swaymsg resize set 25ppt 50ppt
|
||||||
|
elif [[ "${width}" == "25" ]]; then
|
||||||
|
echo 50 > "${current_info_file}"
|
||||||
|
swaymsg resize set 50ppt 50ppt
|
||||||
|
elif [[ "${width}" == "50" ]]; then
|
||||||
|
echo 75 > "${current_info_file}"
|
||||||
|
swaymsg resize set 75ppt 75ppt
|
||||||
|
elif [[ "${width}" == "75" ]]; then
|
||||||
|
rm -f "${current_info_file}"
|
||||||
|
old_width=$(echo "$client_info"| jq .geometry.width)
|
||||||
|
old_height=$(echo "$client_info"| jq .geometry.height)
|
||||||
|
swaymsg resize set "${old_width}px" "${old_height}px"
|
||||||
|
else
|
||||||
|
echo "ui"
|
||||||
|
fi
|
||||||
|
|
||||||
|
swaymsg move position center
|
|
@ -240,8 +240,7 @@ bindsym $mod+Shift+0 move container to workspace 10
|
||||||
bindsym $mod+b splith
|
bindsym $mod+b splith
|
||||||
bindsym $mod+v splitv
|
bindsym $mod+v splitv
|
||||||
|
|
||||||
bindsym $mod+c move position center
|
bindsym $mod+c exec sway-center-window
|
||||||
bindsym $mod+Alt+c move position center, resize set 80ppt 80ppt
|
|
||||||
|
|
||||||
# Switch the current container between different layout styles
|
# Switch the current container between different layout styles
|
||||||
bindsym $mod+s layout stacking
|
bindsym $mod+s layout stacking
|
||||||
|
|
Loading…
Reference in New Issue