diff --git a/i3/config b/i3/config index 4fb9300..5d4f856 100644 --- a/i3/config +++ b/i3/config @@ -25,7 +25,7 @@ font pango:System San Francisco Display 9 for_window [class="^.*"] border pixel 2 # Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod +floating_modifier Mod1 # The middle button over a titlebar kills the window bindsym --release button2 kill @@ -51,6 +51,14 @@ assign [class="Google-chrome"] $workspace1 assign [class="Gnome-terminal"] $workspace7 assign [class="Sublime_text"] $workspace2 assign [class="Spotify"] $workspace4 +assign [class="TelegramDesktop"] $workspace6 + +for_window [class="Skype"] floating enable +for_window [class="Skype"] border normal +for_window [class="Pavucontrol"] floating enable +for_window [class="Pavucontrol"] border normal +for_window [class="TelegramDesktop"] floating enable +for_window [class="TelegramDesktop"] border normal # summon most used apps bindsym $mod+F1 [class="Google-chrome"] move workspace current diff --git a/i3/i3exit b/i3/i3exit index 8b6e7d3..24f48cc 100755 --- a/i3/i3exit +++ b/i3/i3exit @@ -13,7 +13,7 @@ lock() { case "$1" in lock) - lock + $HOME/.config/i3/lock.sh ;; logout) i3-msg exit diff --git a/i3/lock.sh b/i3/lock.sh new file mode 100755 index 0000000..4e8e698 --- /dev/null +++ b/i3/lock.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +scrot /tmp/screen.png +convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png + +if [[ -f $HOME/.config/i3/screen-lock.png ]] +then + # placement x/y + PX=0 + PY=0 + # lockscreen image info + R=$(file ~/.config/i3/screen-lock.png | grep -o '[0-9]* x [0-9]*') + RX=$(echo $R | cut -d' ' -f 1) + RY=$(echo $R | cut -d' ' -f 3) + + SR=$(xrandr --query | grep ' connected' | sed 's/primary //' | cut -f3 -d' ' | grep '+') + for RES in $SR + do + # monitor position/offset + SRX=$(echo $RES | cut -d'x' -f 1) # x pos + SRY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 1) # y pos + SROX=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 2) # x offset + SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset + + PX=$(($SROX + $SRX / 2 - $RX / 2)) + PY=$(($SROY + $SRY / 2 - $RY / 2)) + + convert /tmp/screen.png $HOME/.config/i3/screen-lock.png -geometry +$PX+$PY -composite -matte /tmp/screen.png + echo "done" + done +fi +# dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop +# i3lock -I 10 -d -e -u -n -i /tmp/screen.png +i3lock -e -n -i /tmp/screen.png diff --git a/i3/screen-lock.png b/i3/screen-lock.png new file mode 100644 index 0000000..d653eef Binary files /dev/null and b/i3/screen-lock.png differ