From 6adb8a854084ffdce54d7851b734459246c78bc1 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Wed, 3 Feb 2016 14:04:25 +0100 Subject: [PATCH 01/18] more screenconfig --- qtile_config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qtile_config.py b/qtile_config.py index f6be391..6759e9d 100644 --- a/qtile_config.py +++ b/qtile_config.py @@ -25,11 +25,10 @@ # SOFTWARE. import os -import subprocess from libqtile.config import Key, Screen, Group, Drag, Click from libqtile.command import lazy -from libqtile import layout, bar, widget, hook +from libqtile import layout, bar, widget mod = "mod4" @@ -38,6 +37,10 @@ home = os.path.expanduser('~') keys = [ Key( [mod, "control"], "1", + lazy.spawn("sh -c " + home + "/.screenlayout/1screen.sh"), + ), + Key( + [mod, "control"], "2", lazy.spawn("sh -c " + home + "/.screenlayout/office.sh"), ), From 19d6bc29cc7fd650e1656b5a6e3f2b66f17fd3b2 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Fri, 5 Feb 2016 21:25:35 +0100 Subject: [PATCH 02/18] show v6 in statusbar --- qtile_config.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qtile_config.py b/qtile_config.py index f6be391..ea04614 100644 --- a/qtile_config.py +++ b/qtile_config.py @@ -125,6 +125,15 @@ def getIp(): r = requests.get("http://ipv4.nsupdate.info/myip") return r.text + +def getIpv6(): + import requests + try: + r = requests.get("http://ipv6.nsupdate.info/myip") + return r.text + except: + return 'No IPv6' + screens = [ Screen( top=bar.Bar( @@ -142,6 +151,8 @@ screens = [ [ widget.WindowName(), widget.Notify(), + widget.GenPollText(func=getIpv6), + widget.Sep(), widget.GenPollText(func=getIp), widget.Sep(), widget.ThermalSensor(tag_sensor='Core 0'), From 6bdf11d070ab7b290878d724c46af486b94ff240 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Fri, 5 Feb 2016 22:11:30 +0100 Subject: [PATCH 03/18] open pavuontrol on mute --- qtile_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qtile_config.py b/qtile_config.py index 7295889..bcc20b2 100644 --- a/qtile_config.py +++ b/qtile_config.py @@ -86,6 +86,7 @@ keys = [ ), Key([mod], "Return", lazy.spawn("terminator")), Key(["control", "mod1"], "l", lazy.spawn("xautolock -locknow")), + Key([], "XF86AudioMute", lazy.spawn("pavucontrol")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), From f0ee68bbed79b2dde95a6c258c0b3bb810c4663d Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Sat, 6 Feb 2016 12:31:39 +0100 Subject: [PATCH 04/18] remove extra autolock file --- autolock.sh | 6 ------ init.sh | 1 - 2 files changed, 7 deletions(-) delete mode 100755 autolock.sh diff --git a/autolock.sh b/autolock.sh deleted file mode 100755 index a2cce5f..0000000 --- a/autolock.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -exec xautolock -detectsleep \ - -time 15 -locker "i3lock -c 000000" \ - -notify 30 \ - -notifier "notify-send -u critical -t 10000 -- 'LOCKING screen in 30 seconds'" diff --git a/init.sh b/init.sh index e7c38cd..f2b0199 100755 --- a/init.sh +++ b/init.sh @@ -5,7 +5,6 @@ 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`/autolock.sh ~/.autolock.sh echo "Installing oh-my-zsh..." sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" From 6d839b2f448f54db08f8068e8cdbdd6ff42512b1 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Sat, 6 Feb 2016 12:32:09 +0100 Subject: [PATCH 05/18] autostart xautolock at startup --- qtile_config.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/qtile_config.py b/qtile_config.py index bcc20b2..358aaed 100644 --- a/qtile_config.py +++ b/qtile_config.py @@ -25,10 +25,13 @@ # SOFTWARE. import os +import subprocess +import re +import logging from libqtile.config import Key, Screen, Group, Drag, Click from libqtile.command import lazy -from libqtile import layout, bar, widget +from libqtile import layout, bar, widget, hook mod = "mod4" @@ -43,6 +46,10 @@ keys = [ [mod, "control"], "2", lazy.spawn("sh -c " + home + "/.screenlayout/office.sh"), ), + Key( + [mod, "control"], "3", + lazy.spawn("sh -c " + home + "/.screenlayout/home.sh"), + ), # Switch between windows in current stack pane Key( @@ -201,3 +208,28 @@ auto_fullscreen = True # We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in # java that happens to be on java's whitelist. wmname = "LG3D" + + +def is_running(process): + s = subprocess.Popen(["ps", "axuw"], stdout=subprocess.PIPE) + if isinstance(process, list): + process = process[0] + + for x in s.stdout: + if re.search(process.encode(), x): + return True + return False + + +def execute_once(process): + if not is_running(process): + logging.getLogger('libqtile').warning('Starting ' + str(process)) + return subprocess.Popen(process, shell="/bin/bash") + else: + logging.getLogger('libqtile').warning(str(process) + ' already running. Not starting it') + + +@hook.subscribe.startup +def startup(): + execute_once('nm-applet') + execute_once('xautolock -detectsleep -time 15 -locker "i3lock -c 000000" & disown'.split()) From 92040cda88f8b3e37a734075ec567aa75ad50f69 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Sat, 6 Feb 2016 12:33:46 +0100 Subject: [PATCH 06/18] add alias --- ohmyzshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ohmyzshrc b/ohmyzshrc index c74f50c..f0d6d68 100644 --- a/ohmyzshrc +++ b/ohmyzshrc @@ -88,3 +88,5 @@ source $ZSH/oh-my-zsh.sh # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" + +alias mkvirtualenv3="mkvirtualenv -p `which python3`" From fcab0961118c097c9298474c3f5141baa3996377 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Sat, 6 Feb 2016 20:14:15 +0100 Subject: [PATCH 07/18] adjust brightness with according keys --- qtile_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qtile_config.py b/qtile_config.py index 358aaed..5ff29cf 100644 --- a/qtile_config.py +++ b/qtile_config.py @@ -94,6 +94,8 @@ 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")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), From 91e286d3657a7a1399d0fb22493363125fc589a5 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Mon, 8 Feb 2016 09:40:16 +0100 Subject: [PATCH 08/18] add dc alias --- ohmyzshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/ohmyzshrc b/ohmyzshrc index f0d6d68..9ea2ab2 100644 --- a/ohmyzshrc +++ b/ohmyzshrc @@ -90,3 +90,4 @@ source $ZSH/oh-my-zsh.sh # alias ohmyzsh="mate ~/.oh-my-zsh" alias mkvirtualenv3="mkvirtualenv -p `which python3`" +alias dc="docker-compose" From becb55eb0aad1296d6a45e7093ba36b413d1df24 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Sun, 14 Feb 2016 23:06:54 +0100 Subject: [PATCH 09/18] disable ctrl s --- ohmyzshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ohmyzshrc b/ohmyzshrc index 9ea2ab2..720b863 100644 --- a/ohmyzshrc +++ b/ohmyzshrc @@ -91,3 +91,5 @@ source $ZSH/oh-my-zsh.sh alias mkvirtualenv3="mkvirtualenv -p `which python3`" alias dc="docker-compose" + +stty -ixon From 5bae715fda65305cafe05dd7fbf75065a2caf11c Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Mon, 22 Feb 2016 22:56:30 +0100 Subject: [PATCH 10/18] stuff --- init_server.sh | 4 ---- ohmyzshrc | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/init_server.sh b/init_server.sh index 6ed7aef..21e1797 100755 --- a/init_server.sh +++ b/init_server.sh @@ -1,9 +1,5 @@ mkdir -p ~/.backup ln -snf `pwd`/vimrc ~/.vimrc ln -snf `pwd`/tmux.server.conf ~/.tmux.conf -ln -snf `pwd`/zshrc.local ~/.zshrc.local -ln -snf `pwd`/zshrc ~/.zshrc ln -snf `pwd`/gitconfig ~/.gitconfig ln -snf `pwd`/gitignore ~/.gitignore -# set up vim -#vim +BundleInstall! +qall diff --git a/ohmyzshrc b/ohmyzshrc index 720b863..025f043 100644 --- a/ohmyzshrc +++ b/ohmyzshrc @@ -55,7 +55,7 @@ ZSH_THEME="gentoo" # Add wisely, as too many plugins slow down shell startup. plugins=(git cp dirpersist tmux debian virtualenvwrapper ssh-agent) -zstyle :omz:plugins:ssh-agent identities id_rsa id_sss +zstyle :omz:plugins:ssh-agent identities id_rsa # User configuration From 5a754e3a46a5f39db96404a87cac3599e7c56c1f Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Tue, 22 Mar 2016 10:53:40 +0100 Subject: [PATCH 11/18] occasional commit --- init.sh | 1 + ohmyzshrc | 3 ++- qtile_config.py | 34 ++++++++++++++++++++++++++-------- 3 files changed, 29 insertions(+), 9 deletions(-) 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 720b863..d83983e 100644 --- a/ohmyzshrc +++ b/ohmyzshrc @@ -53,9 +53,10 @@ 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 :omz:plugins:ssh-agent identities id_rsa id_sss +zstyle ':completion:*' special-dirs true # 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()) From 5e411d7a014553ea4836278e3217b575d390b90f Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Tue, 22 Mar 2016 10:54:42 +0100 Subject: [PATCH 12/18] init zsh on server --- init_server.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init_server.sh b/init_server.sh index 21e1797..9daf1d4 100755 --- a/init_server.sh +++ b/init_server.sh @@ -3,3 +3,8 @@ ln -snf `pwd`/vimrc ~/.vimrc ln -snf `pwd`/tmux.server.conf ~/.tmux.conf ln -snf `pwd`/gitconfig ~/.gitconfig ln -snf `pwd`/gitignore ~/.gitignore + +echo "Installing oh-my-zsh..." +sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" + +ln -snf `pwd`/ohmyzshrc ~/.zshrc From 7085c4bfe1f5ab444ee62604edb44eaec8a8ee25 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Sat, 16 Apr 2016 20:09:31 +0200 Subject: [PATCH 13/18] set encryption --- vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vimrc b/vimrc index 0554112..ace1dab 100644 --- a/vimrc +++ b/vimrc @@ -10,6 +10,8 @@ filetype off syntax on filetype indent plugin on +set cryptmethod=blowfish2 + "" system set enc=utf-8 set shell=/bin/zsh From 3757916fe3147d22536db119a69179012b9a3396 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Tue, 19 Apr 2016 00:04:52 +0200 Subject: [PATCH 14/18] scroll with mouse --- tmux.server.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tmux.server.conf b/tmux.server.conf index b259be1..7b49588 100644 --- a/tmux.server.conf +++ b/tmux.server.conf @@ -2,6 +2,7 @@ set -g alternate-screen on # dont respect smaller windows setw -g aggressive-resize on +setw -g mode-mouse on # command prefix unbind C-b From e7b7747151fd76502a324f21ac689296184b7726 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Tue, 19 Apr 2016 00:16:04 +0200 Subject: [PATCH 15/18] also scroll on desktop --- tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tmux.conf b/tmux.conf index f3ae5a4..664b7c5 100644 --- a/tmux.conf +++ b/tmux.conf @@ -2,6 +2,7 @@ set -g alternate-screen on # dont respect smaller windows setw -g aggressive-resize on +setw -g mode-mouse on # command prefix unbind C-b From 7b284a63b2f8d893ce3f409eafe10ac6de39cd32 Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Tue, 19 Apr 2016 13:27:14 +0200 Subject: [PATCH 16/18] Revert "also scroll on desktop" This reverts commit e7b7747151fd76502a324f21ac689296184b7726. --- tmux.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tmux.conf b/tmux.conf index 664b7c5..f3ae5a4 100644 --- a/tmux.conf +++ b/tmux.conf @@ -2,7 +2,6 @@ set -g alternate-screen on # dont respect smaller windows setw -g aggressive-resize on -setw -g mode-mouse on # command prefix unbind C-b From 8fa2f096ea9a46732f1c6505137f716acd9a0aca Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Tue, 19 Apr 2016 13:27:26 +0200 Subject: [PATCH 17/18] Revert "scroll with mouse" This reverts commit 3757916fe3147d22536db119a69179012b9a3396. --- tmux.server.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tmux.server.conf b/tmux.server.conf index 7b49588..b259be1 100644 --- a/tmux.server.conf +++ b/tmux.server.conf @@ -2,7 +2,6 @@ set -g alternate-screen on # dont respect smaller windows setw -g aggressive-resize on -setw -g mode-mouse on # command prefix unbind C-b From ea5aa0d500fe1aaea8b982e0020b2d26343bcd7a Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Mon, 30 May 2016 15:42:29 +0200 Subject: [PATCH 18/18] vue stuff --- ohmyzshrc | 3 ++- vimrc | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ohmyzshrc b/ohmyzshrc index 78a34ca..6601a94 100644 --- a/ohmyzshrc +++ b/ohmyzshrc @@ -4,6 +4,7 @@ export ZSH_TMUX_FIXTERM=false # Path to your oh-my-zsh installation. export ZSH=~/.oh-my-zsh +export LC_ALL=en_US.UTF-8 # Set name of the theme to load. # Look in ~/.oh-my-zsh/themes/ @@ -53,7 +54,7 @@ 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=(tmux virtualenvwrapper ssh-agent extract) +plugins=(tmux virtualenvwrapper ssh-agent extract node npm) zstyle ':completion:*' special-dirs true zstyle :omz:plugins:ssh-agent identities id_rsa diff --git a/vimrc b/vimrc index ace1dab..db7f0bf 100644 --- a/vimrc +++ b/vimrc @@ -10,8 +10,6 @@ filetype off syntax on filetype indent plugin on -set cryptmethod=blowfish2 - "" system set enc=utf-8 set shell=/bin/zsh @@ -34,6 +32,7 @@ set undofile set undodir=~/.backup/ set backup set backupdir=~/.backup/ +set backupcopy=yes "" tabs and stuff set nosmartindent @@ -81,9 +80,6 @@ autocmd BufNewFile,BufReadPost *.md set formatoptions+=t autocmd BufNewFile,BufReadPost Dockerfile set filetype=dockerfile -au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim -au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim - "" Vundle " Setting up Vundle - the vim plugin bundler @@ -168,3 +164,13 @@ Bundle 'trevorrjohn/vim-obsidian' colorscheme obsidian Plugin 'othree/html5.vim' +Plugin 'othree/yajs.vim', { 'for': 'html' } +Plugin 'othree/javascript-libraries-syntax.vim' +Plugin 'vim-scripts/SyntaxComplete' +Plugin 'pangloss/vim-javascript' +Plugin 'posva/vim-vue' +au BufNewFile,BufRead *.vue set filetype=html +au BufNewFile,BufReadPost *.vue set shiftwidth=2 +au BufNewFile,BufReadPost *.vue set softtabstop=2 +au BufNewFile,BufReadPost *.js set shiftwidth=2 +au BufNewFile,BufReadPost *.js set softtabstop=2