diff --git a/i3/laptop.conf b/i3/laptop.conf index dcfc1b8..11fb8f7 100644 --- a/i3/laptop.conf +++ b/i3/laptop.conf @@ -14,8 +14,12 @@ bindsym XF86AudioMute exec amixer set Master toggle # mute sound bindsym XF86Launch1 exec xset -display :0.0 dpms force off # Turn off trackpad -bindsym $mod+Shift+u exec sh ~/.config/i3/trackpad-toggle.sh -exec --no-startup-id ~/.config/i3/trackpad-toggle.sh & +bindsym $mod+Shift+u exec sh ~/.config/scripts/trackpad-toggle.sh +exec --no-startup-id ~/.config/scripts/trackpad-toggle.sh & # Lockscreen -bindsym $mod+Shift+h exec sh ~/.config/i3/lock.sh \ No newline at end of file +bindsym $mod+Shift+h exec sh ~/.config/scripts/lock.sh + +# Desktop background +exec --no-startup-id exec compton & +exec --no-startup-id exec feh --bg-scale ~/Pictures/wallpaper/0001.jpg \ No newline at end of file diff --git a/scripts/lock.sh b/scripts/lock.sh new file mode 100644 index 0000000..d6018bb --- /dev/null +++ b/scripts/lock.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# i3lock blurred screen inspired by /u/patopop007 and the blog post +# http://plankenau.com/blog/post-10/gaussianlock + +# Timings are on an Intel i7-2630QM @ 2.00GHz + +# Dependencies: +# imagemagick +# i3lock +# scrot (optional but default) + +IMAGE=/tmp/i3lock.png +SCREENSHOT="scrot $IMAGE" # 0.46s + +# Alternate screenshot method with imagemagick. NOTE: it is much slower +# SCREENSHOT="import -window root $IMAGE" # 1.35s + +# Here are some imagemagick blur types +# Uncomment one to use, if you have multiple, the last one will be used + +# All options are here: http://www.imagemagick.org/Usage/blur/#blur_args +BLURTYPE="0x5" # 7.52s +#BLURTYPE="0x2" # 4.39s +#BLURTYPE="5x2" # 3.80s +#BLURTYPE="2x8" # 2.90s +#BLURTYPE="2x3" # 2.92s + +# Get the screenshot, add the blur and lock the screen with it +$SCREENSHOT +convert $IMAGE -blur $BLURTYPE $IMAGE +i3lock -i $IMAGE +rm $IMAGE diff --git a/scripts/trackpad-toggle.sh b/scripts/trackpad-toggle.sh new file mode 100755 index 0000000..84355b0 --- /dev/null +++ b/scripts/trackpad-toggle.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Get device id of Synaptics TrackPad +id=$(xinput list --id-only 'SynPS/2 Synaptics TouchPad') + +# Enables TrackPad +trackpadEnable() { + xinput set-prop $id "Device Enabled" 1 + exit +} + +# Disables TrackPad +trackpadDisable() { + xinput set-prop $id "Device Enabled" 0 + exit +} + +# Checks for disable flag +if [ ! -z $1 ] && [ $1 == '-d' ]; then + echo flag worked + trackpadDisable +fi + +# Convert to an arry +read -a trackPadState <<< "$(xinput --list-props $id | grep "Device Enabled")" +devEnabled=${devString_array[3]} + +# Flip the state of the TrackPad +if [ ${trackPadState[3]} -eq 1 ]; then + trackpadDisable +else + trackpadEnable +fi