i3: Fix floating windows; fancy lock

This commit is contained in:
2016-12-19 12:10:36 +02:00
parent 816f554917
commit d5c4d667cf
4 changed files with 44 additions and 2 deletions
+9 -1
View File
@@ -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
+1 -1
View File
@@ -13,7 +13,7 @@ lock() {
case "$1" in
lock)
lock
$HOME/.config/i3/lock.sh
;;
logout)
i3-msg exit
Executable
+34
View File
@@ -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
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB