diff options
-rw-r--r-- | dotfiles/.config/sway/config | 6 | ||||
-rwxr-xr-x | dotfiles/.local/bin/picinpic | 21 |
2 files changed, 12 insertions, 15 deletions
diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index 9e417db..2dfbb86 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -46,7 +46,7 @@ shadows enable shadow_blur_radius 15 shadow_color #000000aa blur enable -blur_radius 5 +blur_radius 7 blur_passes 3 layer_effects "rofi" blur enable; shadows enable @@ -239,8 +239,8 @@ bindsym --to-code { $mod+Shift+bracketright exec menuwin -s # Sticky float to a bottom corner - $mod+Shift+b floating toggle; sticky toggle; exec picinpic - $mod+Ctrl+b floating toggle; sticky toggle; exec picinpic left + $mod+Shift+b exec picinpic + $mod+Ctrl+b exec picinpic left # change focus $mod+h focus left diff --git a/dotfiles/.local/bin/picinpic b/dotfiles/.local/bin/picinpic index 98be777..42a27ea 100755 --- a/dotfiles/.local/bin/picinpic +++ b/dotfiles/.local/bin/picinpic @@ -1,18 +1,15 @@ #!/bin/sh -currentmonrect="$(swaymsg -t get_outputs | jq ".[] | select(.focused == true) | .rect")" -resx=$(echo $currentmonrect | jq --raw-output ".width") -resy=$(echo $currentmonrect | jq --raw-output ".height") - -sx=$(($resx / 4)) -sy=$(($resy / 4)) -posx=$(($resx - $sx - 15)) -posy=$(($resy - $sy - 40)) - -swaymsg resize set "$sx" "$sy" +swaymsg floating toggle +sleep 0.1 +isfloat=$(swaymsg -t get_workspaces | jq ".[] | select(.focused == true).floating_nodes[] | select(.focused == true) | any") +if [ "$isfloat" = "true" ]; then + swaymsg sticky enable + swaymsg resize set 25ppt 25ppt +fi if [ "$1" = "left" ]; then - swaymsg move position -- "-15" "$posy" + swaymsg move position -- "0ppt" "75ppt" exit fi -swaymsg move position -- "$posx" "$posy" +swaymsg move position -- "75ppt" "75ppt" |