Changed i3 util structure
This commit is contained in:
19
i3wm/util/Authenticator.sh
Executable file
19
i3wm/util/Authenticator.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
SECRET_GOOGLE="asdf"
|
||||
SECRET_FACEBOOK="asdf"
|
||||
SECRET_DROPBOX="asdf"
|
||||
|
||||
ARG="${1}"
|
||||
|
||||
case ${ARG} in
|
||||
"google")
|
||||
jauth -secret=${SECRET_GOOGLE}
|
||||
;;
|
||||
"facebook")
|
||||
jauth -secret=${SECRET_FACEBOOK}
|
||||
;;
|
||||
"dropbox")
|
||||
jauth -secret=${SECRET_DROPBOX}
|
||||
;;
|
||||
esac
|
||||
48
i3wm/util/i3blur.py
Executable file
48
i3wm/util/i3blur.py
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/python2
|
||||
import gtk.gdk
|
||||
import os, sys
|
||||
from PIL import ImageFilter
|
||||
from PIL import Image
|
||||
|
||||
# Get screen and its size
|
||||
w = gtk.gdk.get_default_root_window()
|
||||
sz = w.get_size()
|
||||
|
||||
print "[DEBUG]: The size of the window is %d x %d" % sz
|
||||
|
||||
# Get a drawable with the size of the desktop
|
||||
scr = gtk.gdk.Pixbuf( gtk.gdk.COLORSPACE_RGB,
|
||||
False,
|
||||
8,
|
||||
sz[0],
|
||||
sz[1])
|
||||
|
||||
# Fill it with the screenshot
|
||||
scr = scr.get_from_drawable(w,
|
||||
w.get_colormap(),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
sz[0],
|
||||
sz[1])
|
||||
|
||||
# Save the screenshot as png
|
||||
if(scr != None):
|
||||
scr.save("/tmp/i3screen.png","png")
|
||||
print "[DEBUG]: Screenshot saved to /tmp/i3screen.png."
|
||||
else:
|
||||
print "[DEBUG]: Unable to get the screenshot."
|
||||
|
||||
# Load the screenshot as image and blur it
|
||||
iml = Image.open("/tmp/i3screen.png")
|
||||
iml = iml.filter(ImageFilter.BLUR)
|
||||
|
||||
# Save the blured screenshot and call i3lock
|
||||
if(iml != None):
|
||||
iml.save("/tmp/i3screenblr.png", "png")
|
||||
os.system("i3lock -i /tmp/i3screenblr.png")
|
||||
print "[DEBUG]: Screenshot blured and saved to /tmp/i3screenblr.png."
|
||||
else:
|
||||
print "[DEBUG]: Unable to blur the screenshot."
|
||||
|
||||
8
i3wm/util/i3dmenu-wrapper.sh
Executable file
8
i3wm/util/i3dmenu-wrapper.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
BACKGROUND='#402e2e'
|
||||
FOREGOURND='#978965'
|
||||
SELECTED_BACKGROUND='#808080'
|
||||
SELECTED_FOREGROUND='#ffff00'
|
||||
|
||||
i3-dmenu-desktop --dmenu='dmenu -i -nb '#402e2e' -nf '#978965' -sb '#808080' -sf '#ffff00' -l 8'
|
||||
37
i3wm/util/volnotid.sh
Executable file
37
i3wm/util/volnotid.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
VOLUME=$(amixer get Master | grep Mono: | sed 's|[^[]*\[\([0-9]*\).*|\1|')
|
||||
VALUE=3dB
|
||||
MUTE=0
|
||||
|
||||
case "$1" in
|
||||
"up")
|
||||
# Increase Volume
|
||||
[[ "$VOLUME" -eq 100 ]] && VALUE=0
|
||||
amixer -q set Master $VALUE+ unmute && killall -SIGUSR1 i3status
|
||||
MUTE=0
|
||||
;;
|
||||
"down")
|
||||
# Decrease Volume
|
||||
amixer -q set Master $VALUE- unmute && killall -SIGUSR1 i3status
|
||||
MUTE=0
|
||||
# If the Volume is already 0, then mute
|
||||
if [ "$VOLUME" == "0" ]; then
|
||||
MUTE=1
|
||||
amixer -q set Master toggle && killall -SIGUSR1 i3status
|
||||
fi
|
||||
;;
|
||||
"mute")
|
||||
# Mute
|
||||
amixer -q set Master toggle && killall -SIGUSR1 i3status
|
||||
MUTE=1
|
||||
;;
|
||||
esac
|
||||
|
||||
VOLUME=$(amixer get Master | grep Mono: | sed 's|[^[]*\[\([0-9]*\).*|\1|')
|
||||
|
||||
if [ "$MUTE" == "0" ]; then
|
||||
volnoti-show $VOLUME
|
||||
else
|
||||
volnoti-show -m $VOLUME
|
||||
fi
|
||||
Reference in New Issue
Block a user