diff --git a/i3/config b/i3/config index 0814036..687c2d3 100644 --- a/i3/config +++ b/i3/config @@ -40,6 +40,7 @@ set $menu-output ~/.config/scripts/menu/menu-output set $menu-open-bookmark ~/.config/scripts/menu/menu-open-bookmark set $passmgr ~/.config/scripts/dwm/dwmpass set $passotp ~/.config/scripts/dwm/dwmotp +set $prtsc exec ~/.config/scripts/prtsc set $filemgr thunar set $browser firefox # - @@ -69,7 +70,7 @@ bindsym Shift+XF86AudioLowerVolume exec micdown bindsym Shift+XF86AudioMute exec micmute bindsym XF86MonBrightnessUp exec brightup bindsym XF86MonBrightnessDown exec brightdown -#bindsym Print exec grim -g "$(slurp -d)" - | wl-copy +bindsym Print exec $prtsc # - bindsym $mod+Shift+q reload bindsym $mod+p exec menu-power @@ -139,7 +140,7 @@ bar { } } -for_window [class="Display-im6.q16"] floating enable +for_window [class="Display-im*"] floating enable # Autostart #exec wl-paste -t text --watch clipman store diff --git a/scripts/prtsc b/scripts/prtsc index 36d332e..d621ff5 100755 --- a/scripts/prtsc +++ b/scripts/prtsc @@ -1,4 +1,10 @@ #!/bin/sh -# Command alias to reference easily +SCREENSHOTS_DIR="$HOME/Pictures/Screenshots" -scrot -s '/home/tavo/Pictures/Screenshots/%Y-%m-%d.png' -e 'xclip -selection clipboard -t image/png -i $f' +mkdir -p "$SCREENSHOTS_DIR" + +if [ "$GDK_BACKEND" = "x11" ]; then + scrot -s "$SCREENSHOTS_DIR/%Y-%m-%d.png" -e 'xclip -selection clipboard -t image/png -i $f' +elif [ "$GDK_BACKEND" = "wayland" ]; then + grim -g "$(slurp -d)" - | wl-copy +fi diff --git a/shell/aliases.sh b/shell/aliases.sh index 990dbf8..4681359 100644 --- a/shell/aliases.sh +++ b/shell/aliases.sh @@ -45,10 +45,15 @@ alias \ df-short="df -h | grep -v '\s/dev.*$\|\s/run.*$\|\s/boot.*$'" \ qr-png="qrencode -s 16 -o qr.png" \ qr="qrencode -t ansiutf8" \ - clip="xsel -ib" \ wget="wget --hsts-file=$XDG_DATA_HOME/wget/wget-hsts" \ ssh="ssh ${SSH_CONFIG}" \ scp="scp ${SSH_CONFIG}" \ rsync="rsync --rsh \"ssh ${SSH_CONFIG}\"" \ lg="lazygit" \ lvim="VIMINIT= nvim" + +if [ "$GDK_BACKEND" = "x11" ]; then + alias clip='xclip -selection clipboard' +elif [ "$GDK_BACKEND" = "wayland" ]; then + alias clip='wl-copy' +fi