|
|
|
@ -34,6 +34,13 @@ from libqtile.command import lazy |
|
|
|
|
from libqtile import layout, bar, widget, hook |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def spawn_with_env_lazy(command, env): |
|
|
|
|
def spawn_env(): |
|
|
|
|
subprocess.Popen(command.split(' '), env=env) |
|
|
|
|
|
|
|
|
|
return spawn_env |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mod = "mod4" |
|
|
|
|
home = os.path.expanduser('~') |
|
|
|
|
|
|
|
|
@ -44,10 +51,14 @@ keys = [ |
|
|
|
|
), |
|
|
|
|
Key( |
|
|
|
|
[mod, "control"], "2", |
|
|
|
|
lazy.spawn("sh -c " + home + "/.screenlayout/office.sh"), |
|
|
|
|
lazy.spawn("sh -c " + home + "/.screenlayout/2screens.sh"), |
|
|
|
|
), |
|
|
|
|
Key( |
|
|
|
|
[mod, "control"], "3", |
|
|
|
|
lazy.spawn("sh -c " + home + "/.screenlayout/office.sh"), |
|
|
|
|
), |
|
|
|
|
Key( |
|
|
|
|
[mod, "control"], "4", |
|
|
|
|
lazy.spawn("sh -c " + home + "/.screenlayout/home.sh"), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
@ -94,8 +105,13 @@ keys = [ |
|
|
|
|
Key([mod], "Return", lazy.spawn("terminator")), |
|
|
|
|
Key(["control", "mod1"], "l", lazy.spawn("xautolock -locknow")), |
|
|
|
|
Key([], "XF86AudioMute", lazy.spawn("pavucontrol")), |
|
|
|
|
Key([], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc 10")), |
|
|
|
|
Key([], "XF86MonBrightnessDown", lazy.spawn("xbacklight -dec 10")), |
|
|
|
|
Key([], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc 3")), |
|
|
|
|
Key(["shift"], "XF86MonBrightnessUp", lazy.spawn("xbacklight -set 100")), |
|
|
|
|
Key([], "XF86MonBrightnessDown", lazy.spawn("xbacklight -dec 3")), |
|
|
|
|
Key(["shift"], "XF86MonBrightnessDown", lazy.spawn("xbacklight -set 1")), |
|
|
|
|
Key([], "XF86LaunchA", lazy.spawn("xinput set-prop 11 \"Device Enabled\" 0")), |
|
|
|
|
Key(["shift"], "XF86LaunchA", lazy.spawn("xinput set-prop 11 \"Device Enabled\" 1")), |
|
|
|
|
Key(['mod1', "control"], "f", lazy.spawn('/home/ars/start_ff.sh')), |
|
|
|
|
|
|
|
|
|
# Toggle between different layouts as defined below |
|
|
|
|
Key([mod], "Tab", lazy.next_layout()), |
|
|
|
@ -135,8 +151,11 @@ widget_defaults = dict( |
|
|
|
|
|
|
|
|
|
def getIp(): |
|
|
|
|
import requests |
|
|
|
|
r = requests.get("http://ipv4.nsupdate.info/myip") |
|
|
|
|
return r.text |
|
|
|
|
try: |
|
|
|
|
r = requests.get("http://ipv4.nsupdate.info/myip") |
|
|
|
|
return r.text |
|
|
|
|
except: |
|
|
|
|
return 'No IPv4' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getIpv6(): |
|
|
|
@ -163,7 +182,7 @@ screens = [ |
|
|
|
|
bottom=bar.Bar( |
|
|
|
|
[ |
|
|
|
|
widget.WindowName(), |
|
|
|
|
widget.Notify(), |
|
|
|
|
widget.Notify(default_timeout=10), |
|
|
|
|
widget.GenPollText(func=getIpv6), |
|
|
|
|
widget.Sep(), |
|
|
|
|
widget.GenPollText(func=getIp), |
|
|
|
@ -226,7 +245,7 @@ def is_running(process): |
|
|
|
|
def execute_once(process): |
|
|
|
|
if not is_running(process): |
|
|
|
|
logging.getLogger('libqtile').warning('Starting ' + str(process)) |
|
|
|
|
return subprocess.Popen(process, shell="/bin/bash") |
|
|
|
|
return subprocess.Popen(process) |
|
|
|
|
else: |
|
|
|
|
logging.getLogger('libqtile').warning(str(process) + ' already running. Not starting it') |
|
|
|
|
|
|
|
|
@ -234,4 +253,3 @@ def execute_once(process): |
|
|
|
|
@hook.subscribe.startup |
|
|
|
|
def startup(): |
|
|
|
|
execute_once('nm-applet') |
|
|
|
|
execute_once('xautolock -detectsleep -time 15 -locker "i3lock -c 000000" & disown'.split()) |
|
|
|
|