diff --git a/init.sh b/init.sh index f2b0199..e041b32 100755 --- a/init.sh +++ b/init.sh @@ -5,6 +5,7 @@ ln -snf `pwd`/tmux.conf ~/.tmux.conf ln -snf `pwd`/qtile_config.py ~/.config/qtile/config.py ln -snf `pwd`/gitconfig ~/.gitconfig ln -snf `pwd`/gitignore ~/.gitignore +ln -snf `pwd`/autostart.sh ~/.autostart.sh echo "Installing oh-my-zsh..." sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" diff --git a/ohmyzshrc b/ohmyzshrc index 025f043..78a34ca 100644 --- a/ohmyzshrc +++ b/ohmyzshrc @@ -53,8 +53,9 @@ ZSH_THEME="gentoo" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git cp dirpersist tmux debian virtualenvwrapper ssh-agent) +plugins=(tmux virtualenvwrapper ssh-agent extract) +zstyle ':completion:*' special-dirs true zstyle :omz:plugins:ssh-agent identities id_rsa # User configuration diff --git a/qtile_config.py b/qtile_config.py index 5ff29cf..a923aa8 100644 --- a/qtile_config.py +++ b/qtile_config.py @@ -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())