From fca243e89bc859019bab3727a5c0c2291d2e71bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Fri, 1 Sep 2017 09:53:09 +0200 Subject: [PATCH 01/18] work --- autostart/autostart/applications.sh | 10 +++++ autostart/autostart/browser.sh | 1 - autostart/autostart/irc.sh | 1 - autostart/autostart/keyboard.sh | 1 + autostart/autostart/mail.sh | 1 - autostart/autostart/music.sh | 1 - autostart/autostart/owncloud.sh | 2 - autostart/autostart/screen.sh | 4 +- autostart/autostart/voip.sh | 2 - autostart/autostart/wallchanger.sh | 10 ----- autostart/autostart/wallpaper.sh | 11 +++++ bookmarks/sysop | 1 + git/gitconfig | 51 +++++++++++++++------ git/gitignore_global | 6 +-- i3/i3.log | 0 i3/i3/config | 70 +++++++++++++++++++---------- i3/i3/i3blocks.conf | 27 +++-------- i3/i3/scripts/appmenu | 3 +- i3/i3/scripts/i3exit | 23 +++++++--- i3/i3/scripts/pa-volume | 14 ++++-- i3/i3/scripts/shutdown-menu | 2 +- i3/i3/scripts/spotify-current | 20 +++++++++ scripts/setup.bash | 2 +- tmux/tmux.conf | 5 +++ vim/vimrc | 11 +++-- x/Xresources | 6 ++- x/xinitrc | 20 --------- xinitrc.log | 20 +++++++++ zsh/zprofile | 11 ++--- zsh/zsh/20_aliases.sh | 11 +---- zsh/zsh/40_functions.sh | 30 +++++++++++++ zsh/zsh/60_autojump.sh | 1 + 32 files changed, 245 insertions(+), 133 deletions(-) create mode 100755 autostart/autostart/applications.sh delete mode 100755 autostart/autostart/browser.sh delete mode 100755 autostart/autostart/irc.sh delete mode 100755 autostart/autostart/mail.sh delete mode 100755 autostart/autostart/music.sh delete mode 100755 autostart/autostart/owncloud.sh delete mode 100755 autostart/autostart/voip.sh delete mode 100755 autostart/autostart/wallchanger.sh create mode 100755 autostart/autostart/wallpaper.sh create mode 100644 bookmarks/sysop create mode 100644 i3/i3.log create mode 100755 i3/i3/scripts/spotify-current create mode 100644 xinitrc.log create mode 100644 zsh/zsh/60_autojump.sh diff --git a/autostart/autostart/applications.sh b/autostart/autostart/applications.sh new file mode 100755 index 0000000..ed7b2a5 --- /dev/null +++ b/autostart/autostart/applications.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +log "Starting firefox" +firefox & + +log "Starting KeePassX" +keepassx & + +log "Starting first terminal" +urxvt -title "scratch" -e "tmux new-session -A -s scratch" diff --git a/autostart/autostart/browser.sh b/autostart/autostart/browser.sh deleted file mode 100755 index 9ef750c..0000000 --- a/autostart/autostart/browser.sh +++ /dev/null @@ -1 +0,0 @@ -qutebrowser & diff --git a/autostart/autostart/irc.sh b/autostart/autostart/irc.sh deleted file mode 100755 index 1bbdf69..0000000 --- a/autostart/autostart/irc.sh +++ /dev/null @@ -1 +0,0 @@ -quasselclient & diff --git a/autostart/autostart/keyboard.sh b/autostart/autostart/keyboard.sh index ba6289a..ab70c4d 100755 --- a/autostart/autostart/keyboard.sh +++ b/autostart/autostart/keyboard.sh @@ -1,3 +1,4 @@ +#!/bin/bash keyboard_layout=de keyboard_variant=nodeadkeys keyboard_repeat_delay=150 diff --git a/autostart/autostart/mail.sh b/autostart/autostart/mail.sh deleted file mode 100755 index 853b4b4..0000000 --- a/autostart/autostart/mail.sh +++ /dev/null @@ -1 +0,0 @@ -evolution & diff --git a/autostart/autostart/music.sh b/autostart/autostart/music.sh deleted file mode 100755 index 0d8e062..0000000 --- a/autostart/autostart/music.sh +++ /dev/null @@ -1 +0,0 @@ -clementine & diff --git a/autostart/autostart/owncloud.sh b/autostart/autostart/owncloud.sh deleted file mode 100755 index c370b5e..0000000 --- a/autostart/autostart/owncloud.sh +++ /dev/null @@ -1,2 +0,0 @@ -log "starting owncloud client" -owncloud & &>> $LOGFILE diff --git a/autostart/autostart/screen.sh b/autostart/autostart/screen.sh index 0a7580a..adaa2d2 100755 --- a/autostart/autostart/screen.sh +++ b/autostart/autostart/screen.sh @@ -3,5 +3,5 @@ log "execute xautorandr" xautorandr log "disable screen blanking" -xset -dpms & &>> $LOGFILE -xset s off & &>> $LOGFILE +xset -dpms &>> $LOGFILE +xset s off &>> $LOGFILE diff --git a/autostart/autostart/voip.sh b/autostart/autostart/voip.sh deleted file mode 100755 index 7bd91e6..0000000 --- a/autostart/autostart/voip.sh +++ /dev/null @@ -1,2 +0,0 @@ -mumble & -teamspeak3 & diff --git a/autostart/autostart/wallchanger.sh b/autostart/autostart/wallchanger.sh deleted file mode 100755 index 22c474a..0000000 --- a/autostart/autostart/wallchanger.sh +++ /dev/null @@ -1,10 +0,0 @@ -wallpaper_directory="$LIBDIR/wallpaper/current" -wallchanger_pidfile="$RUNDIR/wallchanger.${XDG_SESSION_ID}.pid" -wallpaper_logfile="$LOGDIR/wallpaper.log" -wallpaper_interval="10800" - -log "starting $path_wallchanger" -{ - wallchanger "$wallpaper_directory" "$wallpaper_interval" & - echo $! > "$wallchanger_pidfile" -} & &>> $LOGFILE diff --git a/autostart/autostart/wallpaper.sh b/autostart/autostart/wallpaper.sh new file mode 100755 index 0000000..d755523 --- /dev/null +++ b/autostart/autostart/wallpaper.sh @@ -0,0 +1,11 @@ +# wallpaper_directory="$LIBDIR/wallpaper/current" +# wallchanger_pidfile="$RUNDIR/wallchanger.${XDG_SESSION_ID}.pid" +# wallpaper_logfile="$LOGDIR/wallpaper.log" +# wallpaper_interval="10800" + +# log "starting wallchanger" +# { +# wallchanger "$wallpaper_directory" "$wallpaper_interval" & +# echo $! > "$wallchanger_pidfile" +# } & &>> $LOGFILE +xsetroot -solid '#555555' diff --git a/bookmarks/sysop b/bookmarks/sysop new file mode 100644 index 0000000..64bf931 --- /dev/null +++ b/bookmarks/sysop @@ -0,0 +1 @@ +$HOME/projects/sysop/ diff --git a/git/gitconfig b/git/gitconfig index 506fcdb..7873ed7 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -1,7 +1,8 @@ [user] name = Hannes Körber - email = hannes.koerber@haktec.de - signingkey = 0x078A167A8741BD30 + email = hannes.koerber@tradebyte.com +[github] + user = hakoerber [alias] untrack = "rm --cached" unstage = "reset HEAD" @@ -16,7 +17,9 @@ st = "status" br = "branch" rb = "rebase" - rbi = "rebase -i" + rbi = "rebase --interactive" + rbc = "rebase --continue" + rba = "rebase --abort" df = "diff" gr = "! git graph" @@ -30,17 +33,24 @@ pushall = "!sh -c 'for r in $(git remote) ; do [[ "$r" != "upstream" ]] && { echo \"--- [$r] ---\" ; git push $r \"$@\" ; } ; done' -" - graph = log --graph --pretty=format:'%C(yellow)%h%Creset%C(bold red)% D%Creset %C(green)(%cr) %C(blue)%an<%ae>%Creset%n %C(bold white)%s%Creset' --all + graph = log --graph --pretty=format:'%C(yellow)%h%Creset%C(bold red)% D%Creset %C(green)(%cr) %C(blue)%an<%ae>%Creset%n %C(bold white)%s%Creset' # --all intercommit = !bash -c 'interdiff <(git show $1) <(git show $2) | less -FRS' - + drop = !git rebase --onto $1^ -- + ; drop = !bash -c 'echo $1' - + + ; subcommit = '!sh -c 'git add $1 && git commit -m "Update submodule $1" -m "$(git diff --staged --submodule=log | tr ">" "*")'' + [core] - whitespace = "" - excludesfile = "~/.gitignore_global" + fileMode = true + whitespace = "blank-at-eol,space-before-tab,blank-at-eof" + ; excludesfile = "~/.gitignore_global" + abbrev = 8 [color] ui = true -[gui] - recentrepo = /home/hannes/programming/git-repositories/autobackup +[column] + ui = auto [push] default = simple [merge] @@ -48,16 +58,29 @@ [gc] auto = 0 [advice] - pushNonFastForward = false + pushUpdateRejected = false statusHints = false commitBeforeMerge = false + detachedHead = false [commit] - gpgSign = true +# gpgSign = true + cleanup = default + status = true [status] relativePaths = false + submoduleSummary = true [pager] - log = diff-so-fancy | less - show = diff-so-fancy | less - diff = diff-so-fancy | less + # log = diff-so-fancy | less + # show = diff-so-fancy | less + # diff = diff-so-fancy | less [interactive] - diffFilter = diff-so-fancy + #diffFilter = diff-so-fancy +[rebase] + autoSquash = true +[diff] + submodule = log + mnemonicPrefix = true +[branch] + autoSetupMerge = true +[clean] + requireForce = true diff --git a/git/gitignore_global b/git/gitignore_global index 5948fb9..8fb0268 100644 --- a/git/gitignore_global +++ b/git/gitignore_global @@ -58,9 +58,9 @@ Icon *.rpm ### logs and databases -*.log -*.sql -*.sqlite +#*.log +# *.sql +# *.sqlite ### eclipse specific *.pydevproject diff --git a/i3/i3.log b/i3/i3.log new file mode 100644 index 0000000..e69de29 diff --git a/i3/i3/config b/i3/i3/config index 3d88e1a..e48a2e1 100644 --- a/i3/i3/config +++ b/i3/i3/config @@ -38,15 +38,15 @@ set $signal_reboot reboot set $signal_shutdown shutdown - set $workspace1 1:web + set $workspace1 1 set $workspace2 2 set $workspace3 3 set $workspace4 4 set $workspace5 5 - set $workspace6 6:voip - set $workspace7 7:music - set $workspace8 8:irc - set $workspace9 9:mail + set $workspace6 6 + set $workspace7 7 + set $workspace8 8 + set $workspace9 9 set $workspace10 10 set $key_workspace1 1 @@ -92,6 +92,24 @@ set $kill Shift+Q + +################################################################################ +### WORKSPACE ASSIGNMENTS ###################################################### +################################################################################ + +workspace $workspace1 output HDMI3 +workspace $workspace2 output HDMI3 +workspace $workspace3 output HDMI2 +workspace $workspace4 output HDMI2 +workspace $workspace5 output HDMI2 +workspace $workspace6 output HDMI2 +workspace $workspace7 output LVDS1 +workspace $workspace8 output LVDS1 +workspace $workspace9 output LVDS1 +workspace $workspace10 output LVDS1 + +assign [class="^Keepassx$"] $workspace8 + ################################################################################ ### KEYBINDINGS ################################################################ ##################9############################################################# @@ -238,9 +256,7 @@ floating_minimum_size 0 x 0 floating_maximum_size 0 x 0 - smart_borders on - - font pango:Insonsolata 11 + font pango:Inconsolata 10 ################################################################################ ### COLOR SETTINGS ############################################################# @@ -256,12 +272,6 @@ client.urgent #2f343a #900000 #ffffff #900000 ### APPLICATION SPECIFIC SETTINGS ############################################## ################################################################################ -assign [class="^Mumble$"] $workspace6 -assign [class="^TeamSpeak 3$"] $workspace6 -assign [class="^Clementine$"] $workspace7 -assign [class="^quassel$"] $workspace8 -assign [class="^Thunderbird$"] $workspace9 -assign [class="^Evolution$"] $workspace9 bindsym $mod+F6 exec --no-startup-id mumble bindsym $mod+F7 exec --no-startup-id clementine @@ -272,23 +282,35 @@ bindsym $mod+F9 exec --no-startup-id evolution ### SPECIAL KEYBINDS ########################################################### ################################################################################ +#bindsym XF86Sleep exec --no-stratup-id dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause ; exec --no-startup-id $scriptdir/i3exit suspend bindsym XF86Sleep exec --no-startup-id $scriptdir/i3exit suspend -bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle ; exec --no-startup-id $update-status -bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +5 ; exec --no-startup-id $scriptdir/update-status -bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -5 ; exec --no-startup-id $scriptdir/update-status +bindsym XF86AudioMute exec --no-startup-id $scriptdir/pa-volume mute-toggle ; exec --no-startup-id $update-status +bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +3 ; exec --no-startup-id $scriptdir/update-status +bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -3 ; exec --no-startup-id $scriptdir/update-status + +bindsym XF86AudioPlay exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause +bindsym XF86AudioNext exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next +bindsym XF86AudioPrev exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous # keys seemingly switched bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -dec 5 ; exec --no-startup-id $scriptdir/update-status bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -inc 5 ; exec --no-startup-id $scriptdir/update-status -bindsym XF86AudioPlay exec --no-startup-id mpc toggle -bindsym XF86AudioPrev exec --no-startup-id mpc prev -bindsym XF86AudioNext exec --no-startup-id mpc next - bindsym $mod+o exec --no-startup-id xautorandr ; exec --no-startup-id kill -SIGUSR2 $(cat $RUNDIR/wallchanger.$XDG_SESSION_ID.pid)'" bindsym $mod+p exec --no-startup-id kill -SIGUSR1 $(cat $RUNDIR/wallchanger.$XDG_SESSION_ID.pid) -################################################################################ + + + +exec --no-startup-id autostart + + + + + + + +############################################################################### ### BARS ####################################################################### ################################################################################ # @@ -296,6 +318,8 @@ bar { mode dock position top + +#tray_output HDMI3 tray_output primary tray_padding 3 @@ -307,7 +331,7 @@ bar { id bar-0 - font pango:DejaVu Sans, Icons 11 + font pango:DejaVu Sans, Icons 10 colors { background #222222 diff --git a/i3/i3/i3blocks.conf b/i3/i3/i3blocks.conf index 8092c6a..ade7120 100644 --- a/i3/i3/i3blocks.conf +++ b/i3/i3/i3blocks.conf @@ -1,28 +1,15 @@ separator_block_width=33 -[vpn-main] -command=$HOME/.i3/scripts/openvpn main -label= -interval=5 +#[spotify] +#command=$HOME/.i3/scripts/spotify-current +#interval=1 -[vpn-mgmt] -command=$HOME/.i3/scripts/openvpn mgmt -label= -interval=5 - -[wifi] -command=$HOME/.i3/scripts/wifi -label= -interval=30 - -[network] -command=BLOCK_INSTANCE=wlp2s0 /usr/lib/i3blocks/iface -label= -interval=5 +# [wifi] +# command=$HOME/.i3/scripts/wifi +# interval=30 [load] command=$HOME/.i3/scripts/load -label= interval=30 [volume] @@ -43,7 +30,7 @@ interval=once [time] label= -command=date "+%a %d.%m %H:%M" +command=date "+[KW%V] %A %d.%m.%Y %H:%M:%S" interval=1 separator=false separator_block_width=12 diff --git a/i3/i3/scripts/appmenu b/i3/i3/scripts/appmenu index 6e5f4ce..aa5744f 100755 --- a/i3/i3/scripts/appmenu +++ b/i3/i3/scripts/appmenu @@ -1,2 +1,3 @@ #!/usr/bin/env bash -j4-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans:size=11' -h 24 -i -p '>' -nb '#000000' -nf '#ffffff' -sb '#e16b40' -sf '#000000'" +rofi -show run +#j4-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans:size=11' -i -p '>' -nb '#000000' -nf '#ffffff' -sb '#e16b40' -sf '#000000'" diff --git a/i3/i3/scripts/i3exit b/i3/i3/scripts/i3exit index 75ade5c..885f0b7 100755 --- a/i3/i3/scripts/i3exit +++ b/i3/i3/scripts/i3exit @@ -4,7 +4,7 @@ _logfile="$LOGDIR/i3/i3exit.log" -_fallback_color=000000 +_fallback_color="000000" touch "$_logfile" @@ -16,14 +16,25 @@ log() lock() { - if [[ "$LOCKSCREEN" ]] ; then - i3lock --show-failed-attempts --image "$LOCKSCREEN" - else - i3lock --show-failed-attempts --color "$_fallback_color" + set -x + playing=0 + if dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|grep -q Playing ; then + playing=1 fi + echo $playing + (( $playing )) && dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause + if [[ "$LOCKSCREEN" ]] ; then + i3lock --nofork --show-failed-attempts --image "$LOCKSCREEN" & + else + i3lock --nofork --show-failed-attempts --color "$_fallback_color" & + fi + screen_off + wait + (( $playing )) && dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play } screen_off() { + : xset dpms force off } @@ -33,7 +44,7 @@ log "[I] Received signal \"$signal\"." case "$signal" in lock) log "[I] Locking session." - lock && screen_off + lock ;; logout) log "[I] Exiting i3." diff --git a/i3/i3/scripts/pa-volume b/i3/i3/scripts/pa-volume index 413c83e..6a28c0e 100755 --- a/i3/i3/scripts/pa-volume +++ b/i3/i3/scripts/pa-volume @@ -1,11 +1,13 @@ #!/bin/bash # name of the sink. execute pactl list sinks to get a list -SINKNAME="alsa_output.pci-0000_00_1b.0.analog-stereo" +SINKNAME="$(pactl info | grep '^Default Sink:' | cut -d ' ' -f 3-)" +SINKNAME="alsa_output.usb-Logitech_Logitech_Wireless_Headset_88C626354D45-00.analog-stereo" # this is the worst SINK=$(( $(pactl list sinks | grep "Name: " | grep -n "${SINKNAME}"$ | grep -o "^[[:digit:]]*") -1)) + getvol() { echo $(pactl list sinks | grep "^[[:space:]]*Volume" | head -n $(( $SINK + 1 )) | tail -n 1 | grep -o "[[:digit:]]*%" | head -n 1 | cut -d "%" -f 1) } @@ -49,15 +51,15 @@ ismuted() { } mute() { - pactl set-sink-mute $SINK 1 + pactl set-sink-mute $SINKNAME 1 } unmute() { - pactl set-sink-mute $SINK 0 + pactl set-sink-mute $SINKNAME 0 } mute-toggle() { - pactl set-sink-mute $SINK toggle + pactl set-sink-mute $SINKNAME toggle } status() { @@ -76,6 +78,10 @@ usage() { } case "$1" in + "sink") + echo $SINKNAME + echo $SINK + ;; "get-vol") echo $(getvol) ;; diff --git a/i3/i3/scripts/shutdown-menu b/i3/i3/scripts/shutdown-menu index 57be77f..ac530b5 100755 --- a/i3/i3/scripts/shutdown-menu +++ b/i3/i3/scripts/shutdown-menu @@ -14,6 +14,6 @@ output=$( for option in "${options[@]}"; do echo "($i) $option" (( i++ )) -done | dmenu -fn 'DejaVu Sans Mono:size=11' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000' -w 200 -name 'shutdown-menu') +done | dmenu -fn 'DejaVu Sans Mono:size=10' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000') [[ "$output" ]] && "$(dirname "$0")"/i3exit "${output#(*) }" diff --git a/i3/i3/scripts/spotify-current b/i3/i3/scripts/spotify-current new file mode 100755 index 0000000..2a01e6e --- /dev/null +++ b/i3/i3/scripts/spotify-current @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +import dbus +session_bus = dbus.SessionBus() +spotify_bus = session_bus.get_object("org.mpris.MediaPlayer2.spotify", + "/org/mpris/MediaPlayer2") +spotify_properties = dbus.Interface(spotify_bus, + "org.freedesktop.DBus.Properties") +metadata = spotify_properties.Get("org.mpris.MediaPlayer2.Player", "Metadata") + +# The property Metadata behaves like a python dict +# for key, value in metadata.items(): +# print(key, value) + +# To just print the title +print("{}: {} - [{}]".format( + metadata['xesam:artist'][0], + metadata['xesam:title'], + metadata['xesam:album'] +)) + diff --git a/scripts/setup.bash b/scripts/setup.bash index 44a74ee..1c1c14e 100755 --- a/scripts/setup.bash +++ b/scripts/setup.bash @@ -3,7 +3,7 @@ # --dry-run -n : only show what would be done without doing anything # config directory -config_dir="$HOME/projects/dotfiles/" +config_dir="$HOME/dotfiles/" mapping_file="$config_dir/MAPPING" diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 3ff0c31..ea58e49 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -104,3 +104,8 @@ bind-key -n C-F2 split-window -h "exec htop" bind-key -n C-F3 set-option status bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf sourced" + +bind P paste-buffer +bind-key -t vi-copy 'v' begin-selection +bind-key -t vi-copy 'y' copy-selection +bind-key -t vi-copy 'r' rectangle-toggle diff --git a/vim/vimrc b/vim/vimrc index b1836ec..c153b82 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -28,7 +28,7 @@ Plugin 'sheerun/vim-polyglot' "Plugin 'Lokaltog/vim-easymotion' "Plugin 'PeterRincker/vim-argumentative' -"Plugin 'Valloric/YouCompleteMe' +Plugin 'Valloric/YouCompleteMe' "Plugin 'flazz/vim-colorschemes' "Plugin 'jmcantrell/vim-virtualenv' "Plugin 'kien/ctrlp.vim' @@ -115,7 +115,7 @@ set undodir=~/.vim/undo set undofile " == environment / directories == -set autochdir +set noautochdir set directory=/var/tmp,/tmp set viewdir=~/.vim/view @@ -227,7 +227,7 @@ let g:airline_right_sep = '' let g:airline_left_sep = '' let g:airline#extensions#disable_rtp_load = 1 let g:airline_extensions = ['whitespace'] -let g:airline_theme='powerlineish' +"let g:airline_theme='powerlineish' let g:airline_section_x = airline#section#create(['%{tagbar#currenttag("%s", "", "f")}','' , ' %{PencilMode()}', ' [', 'filetype', ']']) let g:pencil#mode_indicators = {'hard': 'H', 'auto': 'A', 'soft': 'S', 'off': '',} let g:airline#extensions#whitespace#enabled = 1 @@ -250,4 +250,7 @@ function! DeleteTrailingWS() %s/\s\+$//e exe "normal `z" endfunction -autocmd BufWritePre * :call DeleteTrailingWS() +"autocmd BufWritePre * :call DeleteTrailingWS() + +set completeopt-=preview +let g:ycm_add_preview_to_completeopt = 0 diff --git a/x/Xresources b/x/Xresources index 596d35e..f7ba4c8 100644 --- a/x/Xresources +++ b/x/Xresources @@ -2,13 +2,13 @@ Xcursor.theme: Vanilla-DMZ URxvt.scrollBar: false -URxvt.font: xft:Inconsolata:size=12 +URxvt.font: xft:Inconsolata:size=11 URxvt.letterSpace: -1 ! clickable URLs URxvt.perl-ext-common: default,matcher,selection-to-clipboard -URxvt.url-launcher: /usr/bin/firefox +URxvt.url-launcher: /usr/bin/firefox-trunk URxvt.matcher.button: 1 URxvt.intensityStyles: false @@ -24,6 +24,8 @@ URxvt.cursorBlink: true URxvt.transparent: true URxvt.shading: 0 +! URxvt.internalBorder: 6 + ! Solarized color scheme for the X Window System ! ! http://ethanschoonover.com/solarized diff --git a/x/xinitrc b/x/xinitrc index a746753..1b3d27a 100755 --- a/x/xinitrc +++ b/x/xinitrc @@ -1,12 +1,5 @@ #!/bin/bash -LOGFILE="$LOGDIR/xinitrc.log" - -log() { - echo "[$(date +%FT%T)] $*" >> "$LOGFILE" -} - - if [ -d /etc/X11/xinit/xinitrc.d ]; then for f in /etc/X11/xinit/xinitrc.d/*; do [ -x "$f" ] && . "$f" @@ -22,18 +15,5 @@ start_wm() { exec i3 -c "$HOME/.i3/config" >> "$LOGDIR/i3/i3.log" } -autostart() { - if [[ -d "$HOME/.autostart" ]] ; then - log "Looking for autostart files." - for f in "$HOME/.autostart/"*.sh ; do - if [[ -x "$f" ]] ; then - log "Executing autostart file \"$f\"" - "$f" - fi - done - fi -} - -autostart start_wm diff --git a/xinitrc.log b/xinitrc.log new file mode 100644 index 0000000..6a49533 --- /dev/null +++ b/xinitrc.log @@ -0,0 +1,20 @@ +[2017-01-04T10:35:52] Looking for autostart files. +[2017-01-04T10:35:52] Executing autostart file "/home/hak/.autostart/keyboard.sh" +[2017-01-04T10:35:52] Executing autostart file "/home/hak/.autostart/network.sh" +[2017-01-04T10:35:52] Executing autostart file "/home/hak/.autostart/pasystray.sh" +[2017-01-04T10:35:52] Executing autostart file "/home/hak/.autostart/redshift.sh" +[2017-01-04T10:35:52] Executing autostart file "/home/hak/.autostart/screen.sh" +[2017-01-04T10:35:52] Executing autostart file "/home/hak/.autostart/synclient.sh" +[2017-01-04T10:35:52] Executing autostart file "/home/hak/.autostart/xbindkeys.sh" +[2017-01-04T10:35:52] Executing autostart file "/home/hak/.autostart/xresources.sh" +[2017-01-04T10:35:52] starting i3 +[2017-01-04T10:36:26] Looking for autostart files. +[2017-01-04T10:36:26] Executing autostart file "/home/hak/.autostart/keyboard.sh" +[2017-01-04T10:36:26] Executing autostart file "/home/hak/.autostart/network.sh" +[2017-01-04T10:36:26] Executing autostart file "/home/hak/.autostart/pasystray.sh" +[2017-01-04T10:36:26] Executing autostart file "/home/hak/.autostart/redshift.sh" +[2017-01-04T10:36:26] Executing autostart file "/home/hak/.autostart/screen.sh" +[2017-01-04T10:36:26] Executing autostart file "/home/hak/.autostart/synclient.sh" +[2017-01-04T10:36:26] Executing autostart file "/home/hak/.autostart/xbindkeys.sh" +[2017-01-04T10:36:26] Executing autostart file "/home/hak/.autostart/xresources.sh" +[2017-01-04T10:36:26] starting i3 diff --git a/zsh/zprofile b/zsh/zprofile index a9af91c..296ef92 100644 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -9,7 +9,7 @@ _path=("$HOME/bin" "/usr/games") PATH="" -for part in ${_path} ; do +for part in ${_path[@]} ; do PATH="$PATH:${part}" done PATH="${PATH#:}" @@ -17,9 +17,10 @@ export PATH export EDITOR="vim" export VISUAL="vim" -export BROWSER="qutebrowser" +export BROWSER="firefox-trunk" export PAGER="less" +export LESS="FRX" export VIMRC="$HOME/.vimrc" @@ -34,6 +35,9 @@ export LANG=en_US.UTF-8 export LC_TIME=de_DE.UTF-8 export LC_COLLATE=C +export DOTFILES=~/dotfiles + + # Start the gpg-agent if not already running if ! pgrep -x --uid "${USER}" gpg-agent >/dev/null 2>&1; then gpg-connect-agent /bye >/dev/null 2>&1 @@ -47,6 +51,3 @@ fi # Set GPG TTY export GPG_TTY=$(tty) - -# exec startx breaks some logind fuckery, without exec it works -[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx diff --git a/zsh/zsh/20_aliases.sh b/zsh/zsh/20_aliases.sh index bd16fad..2d669da 100644 --- a/zsh/zsh/20_aliases.sh +++ b/zsh/zsh/20_aliases.sh @@ -1,5 +1,5 @@ ### TRANSLATIONS -alias vim="nvim -u $VIMRC" +#alias vim="nvim -u $VIMRC" ### COMMON OPERATIONS alias ll='ls -AlFh' @@ -7,9 +7,6 @@ alias la='ls -A' alias spm="sudo pacman" -alias tml="tmux list-sessions" -alias tma="tmux ls 2>/dev/null && tmux attach-session || tmux" - alias clip="xclip -selection clipboard" alias clipo="xclip -out -selection clipboard" @@ -23,8 +20,6 @@ alias calc='python3 -ic "from math import *; import cmath"' alias le_haxxor_1='clear && dmesg | pv -qL 20' alias le_haxxor_2='clear && hexdump -C /dev/urandom | pv -qlL 2' -alias b='cd $OLDPWD' - alias root='sudo -sE' ### USEFUL DEFAULT OPTIONS @@ -48,17 +43,15 @@ alias du='du -h' alias df='df -h' # show non-printable characters by default -alias cat="cat -v" +# alias cat="cat -v" ### SHORTENING COMMAND NAMES alias cs="cryptsetup" alias v="vim" alias g="git" -alias t="tmux" alias c="cd" alias l="ls" alias s="sudo" -alias t="tmux" alias cl="clear" alias nocolor="sed -r \"s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g\"" diff --git a/zsh/zsh/40_functions.sh b/zsh/zsh/40_functions.sh index caf3b79..3926039 100644 --- a/zsh/zsh/40_functions.sh +++ b/zsh/zsh/40_functions.sh @@ -130,3 +130,33 @@ man() { embiggen() { enscript --no-header --media=A4 --landscape --font="DejaVuSansMono30" -o - | ps2pdf - | zathura - } + +sshmux () { + ssh -t $@ "tmux a || tmux"; +} + +t() { + if [[ "$1" ]] ; then + tmux new-session -A -s "$1" + else + tmux attach-session + fi +} + +b() { + bookmarks=${DOTFILES}/bookmarks + bookmark="$1" + if ! [[ "${bookmark}" ]] ; then + printf 'Need a bookmark' >&2 + return 1 + fi + if ! [[ -r "${bookmark}" ]] ; then + printf 'Invalid bookmark %s' "${bookmark}" >&2 + return 1 + fi + target="$(head -1 ${bookmark})" + if ! [[ -e "${target}" ]] ; then + printf 'Traget not found: %s' "${target}" >&2 + fi + cd "$(eval ${target})" +} diff --git a/zsh/zsh/60_autojump.sh b/zsh/zsh/60_autojump.sh new file mode 100644 index 0000000..39843b2 --- /dev/null +++ b/zsh/zsh/60_autojump.sh @@ -0,0 +1 @@ +. /usr/share/autojump/autojump.sh From 87033cb0db8e5de11f40f8b3ce2b17ab1fc42931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Fri, 1 Sep 2017 11:28:23 +0200 Subject: [PATCH 02/18] Remove global gitignore from install.yml --- install.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/install.yml b/install.yml index 61454e0..43b91a1 100644 --- a/install.yml +++ b/install.yml @@ -9,8 +9,6 @@ ~/.autostart: ~/.gitconfig: path: git/gitconfig - ~/.gitignore_global: - path: git/gitignore_global ~/.gnupg/dirmngr.conf: path: gnupg/dirmngr.conf ~/.gnupg/gpg-agent.conf: From 46311776b624335da68e880306617bacb3271a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Fri, 1 Sep 2017 20:39:05 +0200 Subject: [PATCH 03/18] Update VIM config --- install.yml | 13 +++++- vim/vimrc | 93 ++++++++++++++++++--------------------- zsh/zshrc.d/20_aliases.sh | 2 - 3 files changed, 55 insertions(+), 53 deletions(-) diff --git a/install.yml b/install.yml index 43b91a1..a7081df 100644 --- a/install.yml +++ b/install.yml @@ -18,7 +18,7 @@ ~/.i3: ~/.tmux.conf: path: tmux/tmux.conf - ~/.vimrc: + ~/.config/nvim/init.vim: path: vim/vimrc ~/.Xresources: path: x/Xresources @@ -32,4 +32,15 @@ path: zsh/zshrc.d - shell: + - ln -sf ~/.config/nvim/init.vim ~/.vimrc - xrdb ~/.Xresources + - mkdir -p ~/.var/lib + - mkdir -p ~/.var/log + - mkdir -p ~/.var/run + - curl --fail --location --create-dirs --output ~/.local/share/nvim/site/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + - command: nvim -E +PlugInstall +qall || true + stdout: true + stderr: true + - command: cd ~/.local/share/nvim/plugged/YouCompleteMe && ./install.py || true + stdout: true + stderr: true diff --git a/vim/vimrc b/vim/vimrc index 121b41e..1e078a1 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,33 +1,31 @@ -" vim: set filetype=vim - set nocompatible filetype off -set rtp+=~/.vim/bundle/Vundle.vim/ -call vundle#begin() +call plug#begin('~/.local/share/nvim/plugged') -" === plugin setup === +" === plugins === -Plugin 'VundleVim/Vundle.vim' - -Plugin 'vim-airline/vim-airline' -Plugin 'vim-airline/vim-airline-themes' -Plugin 'godlygeek/tabular' -Plugin 'lepture/vim-jinja' -Plugin 'majutsushi/tagbar' -Plugin 'nblock/vim-dokuwiki' -Plugin 'reedes/vim-pencil' -Plugin 'saltstack/salt-vim' -Plugin 'sickill/vim-monokai' -Plugin 'sjl/gundo.vim' -Plugin 'tpope/vim-commentary' -Plugin 'tpope/vim-fugitive' -Plugin 'tpope/vim-speeddating' -Plugin 'tpope/vim-surround' -Plugin 'junegunn/goyo.vim' -Plugin 'junegunn/limelight.vim' -Plugin 'sheerun/vim-polyglot' -Plugin 'freitass/todo.txt-vim' -Plugin 'Valloric/YouCompleteMe' +"Plug 'vim-airline/vim-airline' +"Plug 'vim-airline/vim-airline-themes' +Plug 'itchyny/lightline.vim' +" Plug 'godlygeek/tabular' +" Plug 'lepture/vim-jinja' +Plug 'majutsushi/tagbar' +" Plug 'nblock/vim-dokuwiki' +Plug 'reedes/vim-pencil' +" Plug 'saltstack/salt-vim' +Plug 'sickill/vim-monokai' +" Plug 'sjl/gundo.vim' +" Plug 'tpope/vim-commentary' +" Plug 'tpope/vim-fugitive' +" Plug 'tpope/vim-speeddating' +" Plug 'tpope/vim-surround' +Plug 'airblade/vim-gitgutter' +Plug 'junegunn/goyo.vim' +Plug 'junegunn/limelight.vim' +" Plug 'sheerun/vim-polyglot' +" Plug 'freitass/todo.txt-vim' +Plug 'Valloric/YouCompleteMe' +Plug 'nathanaelkane/vim-indent-guides' "Plugin 'Lokaltog/vim-easymotion' "Plugin 'PeterRincker/vim-argumentative' @@ -36,21 +34,16 @@ Plugin 'Valloric/YouCompleteMe' "Plugin 'kien/ctrlp.vim' "Plugin 'klen/python-mode' "Plugin 'mbbill/undotree' -"Plugin 'scrooloose/nerdtree' +Plug 'scrooloose/nerdtree' "Plugin 'sjl/gundo.vim' "Plugin 'terryma/vim-expand-region' "Plugin 'terryma/vim-multiple-cursors' "Plugin 'wellle/targets.vim' "Plugin 'wincent/Command-T' -call vundle#end() +call plug#end() filetype plugin indent on - -" === General options === - -set t_Co=256 - " == formatting == set tabstop=4 set smarttab @@ -77,7 +70,7 @@ set matchtime=5 set mouse=a set mousehide set noerrorbells -set showmode +set noshowmode set numberwidth=2 set relativenumber set shortmess=rti @@ -135,7 +128,7 @@ set hidden " == editing == set backspace=indent,eol,start -set esckeys +" set esckeys set matchpairs=(:),{:},[:],<:> set notimeout set ttimeout @@ -211,7 +204,7 @@ let g:solarized_termtrans=1 let g:solarized_contrast="normal" let g:solarized_visibility="normal" syntax enable -" colorscheme monokai +colorscheme monokai " == tagbar == nnoremap :TagbarToggle @@ -225,21 +218,21 @@ let g:tagbar_sort = 0 " 1: sort by name, 0: sort by position let g:tagbar_compact = 1 let g:tagbar_indent = 2 let g:tagbar_show_linenumbers = 0 -let g:tagbar_foldlevel = 99 " unfold all +"let g:airline_right_sep = '' +"let g:airline_left_sep = '' +"let g:airline#extensions#disable_rtp_load = 1 +"let g:airline_extensions = ['whitespace'] +"let g:airline_theme='powerlineish' +"let g:airline_powerline_fonts = 1 +"let g:airline_section_x = airline#section#create(['%{tagbar#currenttag("%s", "", "f")}','' , ' %{PencilMode()}', ' [', 'filetype', ']']) +"let g:pencil#mode_indicators = {'hard': 'H', 'auto': 'A', 'soft': 'S', 'off': '',} +"let g:airline#extensions#whitespace#enabled = 1 +"let g:airline#extensions#whitespace#symbol = '' +"let g:airline#extensions#whitespace#checks = ['trailing'] -" == airline == -let g:airline_right_sep = '' -let g:airline_left_sep = '' -let g:airline#extensions#disable_rtp_load = 1 -let g:airline_extensions = ['whitespace'] -let g:airline_theme='powerlineish' -let g:airline_powerline_fonts = 1 - -let g:airline_section_x = airline#section#create(['%{tagbar#currenttag("%s", "", "f")}','' , ' %{PencilMode()}', ' [', 'filetype', ']']) -let g:pencil#mode_indicators = {'hard': 'H', 'auto': 'A', 'soft': 'S', 'off': '',} -let g:airline#extensions#whitespace#enabled = 1 -let g:airline#extensions#whitespace#symbol = '' -let g:airline#extensions#whitespace#checks = ['trailing'] +let g:lightline = { + \ 'colorscheme': 'powerline', + \ } " == pencil == let g:pencil#textwidth = 80 diff --git a/zsh/zshrc.d/20_aliases.sh b/zsh/zshrc.d/20_aliases.sh index 55a6f9b..43b9724 100644 --- a/zsh/zshrc.d/20_aliases.sh +++ b/zsh/zshrc.d/20_aliases.sh @@ -1,5 +1,3 @@ -### TRANSLATIONS - ### COMMON OPERATIONS alias ll='ls -AlFh' alias la='ls -A' From bae822cd0c8824e8b4c13f60657a6ccfd38bb0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Fri, 8 Sep 2017 10:39:59 +0200 Subject: [PATCH 04/18] more i3status --- i3/i3status.conf | 52 +++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/i3/i3status.conf b/i3/i3status.conf index 414f199..554c388 100644 --- a/i3/i3status.conf +++ b/i3/i3status.conf @@ -7,47 +7,57 @@ # If the above line is not correctly displayed, fix your editor first! general { - interval = 5 + interval = 1 # color = '#FFFFFF' # color_good = '#00FF00' # color_bad = '#FF0000' # color_degraded = '#FFFF00' color = '#FFFFFF' color_good = '#FFFFFF' - color_bad = '#FFFFFF' - color_degraded = '#FFFFFF' - + color_bad = '#F92672' + color_degraded = '#F4Bf75' } + +order += volume_status +order += spotify order += "wifi" -order += "sysdata" -# order += "exchange_rate nzdollar" +order += online_status order += "battery_level 0" order += "clock" battery_level 0 { - format = "{percent}%" + format = "  {percent}% " notification = true + threshold_full = 95 } clock { format = ["{Local}", "{NZ}"] - format_time = "[{name}] %a %Y-%m-%d %H:%M:%S" -} - -# exchange_rate nzdollar { -# base = "EUR" -# cache_timeout = 3600 -# format = "{NZD} NZ$" -# } - -sysdata { - format = "C {cpu_usage}% {cpu_temp} M {mem_used}G ({mem_used_percent}%)" - precision = 1 + format_time = "  [{name}] %a %Y-%m-%d %H:%M:%S " } wifi { - format_down = "W: down" - format_up = "W: {signal_percent} {ssid}" + bitrate_bad = 1 + bitrate_degraded = 1 + format_down = "  down " + format_up = "  {signal_percent} {ssid} " } +spotify { + format = "  {title} ({artist}) - {time} " + format_down = "no Spotify" +} + +online_status { + format = " {icon} " +} + +volume_status { + device = "12" + cache_timeout = 1 + format = "  {percentage}% " + format_muted = "  mute " + thresholds = [] + command = "pactl" +} From 2918f641dcb6c67069d04dd6b122cc53141abaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:33:00 +0100 Subject: [PATCH 05/18] Set wallpaper once --- autostart/40_wallpaper.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/autostart/40_wallpaper.sh b/autostart/40_wallpaper.sh index c8e8299..867eab4 100755 --- a/autostart/40_wallpaper.sh +++ b/autostart/40_wallpaper.sh @@ -1,12 +1,8 @@ #!/usr/bin/env bash -wallpaper_directory="$LIBDIR/wallpaper/current" -wallchanger_pidfile="$RUNDIR/wallchanger.${XDG_SESSION_ID}.pid" -wallpaper_logfile="$LOGDIR/wallpaper.log" -wallpaper_interval="10800" +wallpaper="$LIBDIR/wallpaper/current" -printf '%s' "starting $path_wallchanger" >>"$LOGFILE" +printf '%s' "setting wallpaper" >>"$LOGFILE" { - wallchanger "$wallpaper_directory" "$wallpaper_interval" & - echo $! > "$wallchanger_pidfile" + feh --bg-scale "${wallpaper}" } & &>> $LOGFILE From ac67da801800578665bc2c8835c02d2662664703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:33:20 +0100 Subject: [PATCH 06/18] Add some git shortcuts --- git/gitconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git/gitconfig b/git/gitconfig index ffb9b6f..647bbca 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -13,6 +13,7 @@ visual = "!gitk --all" staged = "diff --staged" + fe = "fetch --all --prune" co = "checkout" ci = "commit" st = "status" @@ -34,7 +35,8 @@ pushall = "!sh -c 'for r in $(git remote) ; do [[ "$r" != "upstream" ]] && { echo \"--- [$r] ---\" ; git push $r \"$@\" ; } ; done' -" - branch-clean = "!sh -c 'git branch --merged | grep -v master | xargs --no-run-if-empty git branch -d'" + branch-clean = "!sh -c 'git branch --merged | grep -v -e master -e develop -e '^*' | xargs --no-run-if-empty git branch -d'" + brc = "!git branch-clean" graph = log --graph --pretty=format:'%C(yellow)%h%Creset%C(bold red)% D%Creset %C(green)(%cr) %C(blue)%an<%ae>%Creset%n %C(bold white)%s%Creset' --all From 921383d0954ef28403eb9fce5b5bd2dab80f701c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:33:48 +0100 Subject: [PATCH 07/18] Update i3 settings --- i3/config | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/i3/config b/i3/config index eafd6e1..339eabe 100644 --- a/i3/config +++ b/i3/config @@ -19,7 +19,7 @@ set $mod Mod4 # The default terminal - set $terminal "urxvt256c -title terminal" + set $terminal "urxvt -title terminal" set $scriptdir ~/.i3/scripts @@ -192,12 +192,16 @@ assign [class="^Keepassx$"] $workspace8 bindsym $mod+d exec --no-startup-id ~/.i3/scripts/appmenu bindsym $mod+Return exec $terminal - bindsym $mod+F1 exec firefox - bindsym Print exec --no-startup-id ~/.i3/scripts/shutdown-menu + bindsym F1 exec --no-startup-id ~/.i3/scripts/shutdown-menu + bindsym $mod+F1 exec --no-startup-id ~/.i3/scripts/i3exit lock + bindsym $mod+Home exec --no-startup-id ~/.i3/scripts/shutdown-menu bindsym $mod+Shift+v exec --no-startup-id redshift-toggle + bindsync $mod+Shift+$scratchpad move scratchpad + bindsync $mod+$scratchpad scratchpad show + ################################################################################ ### MODES ###################################################################### ################################################################################ @@ -282,15 +286,14 @@ bindsym $mod+F9 exec --no-startup-id evolution ### SPECIAL KEYBINDS ########################################################### ################################################################################ -#bindsym XF86Sleep exec --no-stratup-id dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause ; exec --no-startup-id $scriptdir/i3exit suspend bindsym XF86Sleep exec --no-startup-id $scriptdir/i3exit suspend -bindsym XF86AudioMute exec --no-startup-id $scriptdir/pa-volume mute-toggle ; exec --no-startup-id $update-status -bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +3 ; exec --no-startup-id $scriptdir/update-status -bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -3 ; exec --no-startup-id $scriptdir/update-status +bindsym XF86AudioMute exec --no-startup-id $scriptdir/pa-volume mute-toggle +bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +3 +bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -3 -bindsym XF86AudioPlay exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause -bindsym XF86AudioNext exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next -bindsym XF86AudioPrev exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous +bindsym XF86AudioPlay exec $scriptdir/spotify-control toggle +bindsym XF86AudioNext exec $scriptdir/spotify-control next +bindsym XF86AudioPrev exec $scriptdir/spotify-control previous # keys seemingly switched bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -dec 5 ; exec --no-startup-id $scriptdir/update-status From a64cc7b3573b66c89ff4077fb5cf754b93f0c96b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:34:13 +0100 Subject: [PATCH 08/18] Use inconsolata --- i3/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3/config b/i3/config index 339eabe..0f7fe4f 100644 --- a/i3/config +++ b/i3/config @@ -334,7 +334,7 @@ bar { id bar-0 - font pango:DejaVu Sans, Icons 10 + font pango:Inconsolata, FontAwesome 10 colors { background #222222 From f36a90aa86f022e63a98d8213890782b712dfafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:34:57 +0100 Subject: [PATCH 09/18] Update bar --- i3/i3status.conf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/i3/i3status.conf b/i3/i3status.conf index 554c388..f48992c 100644 --- a/i3/i3status.conf +++ b/i3/i3status.conf @@ -33,20 +33,21 @@ battery_level 0 { } clock { - format = ["{Local}", "{NZ}"] - format_time = "  [{name}] %a %Y-%m-%d %H:%M:%S " + format = ["{Europe/Berlin}", "{NZ}", "{Cuba}" ] + format_time = "  {name} \[KW %V\] %a %Y-%m-%d %H:%M:%S " } wifi { - bitrate_bad = 1 - bitrate_degraded = 1 + bitrate_bad = 0 + bitrate_degraded = 0 format_down = "  down " format_up = "  {signal_percent} {ssid} " } spotify { - format = "  {title} ({artist}) - {time} " + format = "  {title} - {artist} " format_down = "no Spotify" + cache_timeout = 10 } online_status { @@ -54,8 +55,7 @@ online_status { } volume_status { - device = "12" - cache_timeout = 1 + cache_timeout = 10 format = "  {percentage}% " format_muted = "  mute " thresholds = [] From 7b752287320452bc660e55eb902d6cc04bafaa1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:36:03 +0100 Subject: [PATCH 10/18] Remove audio hooks, use extra script --- i3/scripts/bar-update | 9 +++++++++ i3/scripts/pa-volume | 18 ++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100755 i3/scripts/bar-update diff --git a/i3/scripts/bar-update b/i3/scripts/bar-update new file mode 100755 index 0000000..24906fc --- /dev/null +++ b/i3/scripts/bar-update @@ -0,0 +1,9 @@ +#!/bin/bash + +if [[ "$1" ]] ; then + modules="$1" +else + modules=all +fi + +py3-cmd refresh "$modules" diff --git a/i3/scripts/pa-volume b/i3/scripts/pa-volume index 6a28c0e..528015e 100755 --- a/i3/scripts/pa-volume +++ b/i3/scripts/pa-volume @@ -77,6 +77,10 @@ usage() { echo "$0 set-vol VOL_PERC" } +update_status_bar() { + ~/.i3/scripts/bar-update volume_status +} + case "$1" in "sink") echo $SINKNAME @@ -91,19 +95,19 @@ case "$1" in else setvol "$2" fi - hook="$3" + update_status_bar ;; "mute") mute - hook="$2" + update_status_bar ;; "unmute") unmute - hook="$2" + update_status_bar ;; "mute-toggle") mute-toggle - hook="$2" + update_status_bar ;; "is-muted") echo $(ismuted) @@ -113,10 +117,4 @@ case "$1" in ;; *) usage - ;; esac - -if [[ -n "$hook" ]] ; then - echo "volume changed, executing hook: $hook" - $hook -fi From 142922ed979dbf94ba67d50ce162159364c01029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:36:35 +0100 Subject: [PATCH 11/18] Update tmux --- tmux/tmux.conf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 28523be..805d729 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -1,5 +1,9 @@ set -g default-command "${SHELL}" -set -g default-terminal "tmux-256color" +set -g default-terminal "rxvt-unicode" + +set -g set-titles on +set -g set-titles-string '#S' +setw -g automatic-rename set -g prefix C-a unbind C-b @@ -26,7 +30,7 @@ bind l select-pane -R set -g bell-action any -set -g history-limit 5000 +set -g history-limit 50000 set -g base-index 1 set-window-option -g pane-base-index 1 @@ -85,7 +89,6 @@ bind-key c new-window -c "#{pane_current_path}" bind-key -n S-down new-window bind-key -n S-left prev bind-key -n S-right next -bind-key -n C-q detach bind-key -n C-F1 command-prompt "split-window -h 'exec man %%'" bind-key -n C-F2 split-window -h "exec htop" From 18e585b709745255fafa061474a17a2ae603d391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:36:52 +0100 Subject: [PATCH 12/18] Update vim --- vim/vimrc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 1e078a1..6d2b987 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -8,14 +8,14 @@ call plug#begin('~/.local/share/nvim/plugged') "Plug 'vim-airline/vim-airline-themes' Plug 'itchyny/lightline.vim' " Plug 'godlygeek/tabular' -" Plug 'lepture/vim-jinja' +Plug 'lepture/vim-jinja' Plug 'majutsushi/tagbar' " Plug 'nblock/vim-dokuwiki' Plug 'reedes/vim-pencil' " Plug 'saltstack/salt-vim' Plug 'sickill/vim-monokai' " Plug 'sjl/gundo.vim' -" Plug 'tpope/vim-commentary' +Plug 'tpope/vim-commentary' " Plug 'tpope/vim-fugitive' " Plug 'tpope/vim-speeddating' " Plug 'tpope/vim-surround' @@ -40,6 +40,11 @@ Plug 'scrooloose/nerdtree' "Plugin 'terryma/vim-multiple-cursors' "Plugin 'wellle/targets.vim' "Plugin 'wincent/Command-T' +Plug 'rodjek/vim-puppet' +Plug 'suan/vim-instant-markdown' +"Plug 'marshallward/vim-restructuredtext' +Plug 'vim-syntastic/syntastic' + call plug#end() filetype plugin indent on @@ -181,7 +186,10 @@ inoremap jj nnoremap v vl +nnoremap m :InstantMarkdownPreview + nnoremap u :GundoToggle +nnoremap d :diffupdate nmap :Goyo:TogglePencil:Limelight!! nmap w :Goyo:TogglePencil:Limelight!! @@ -259,3 +267,5 @@ autocmd FileType yaml set shiftwidth=2 set completeopt-=preview let g:ycm_add_preview_to_completeopt = 0 + +let g:instant_markdown_autostart = 0 From 91a0b94f21ecf88fad855b6fcb5421e4841a6234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 11:37:33 +0100 Subject: [PATCH 13/18] Update urxvt --- x/Xresources | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/Xresources b/x/Xresources index 748b607..ee4acd9 100644 --- a/x/Xresources +++ b/x/Xresources @@ -4,7 +4,7 @@ URxvt.scrollBar: false URxvt.font: xft:Inconsolata:size=10 URxvt.letterSpace: -1 -URxvt.perl-ext-common: default,matcher,selection-to-clipboard +URxvt.perl-ext-common: default,matcher,selection-to-clipboard,resize-font URxvt.url-launcher: /usr/bin/xdg-open URxvt.matcher.button: 1 URxvt.saveLines: 10000 @@ -14,8 +14,8 @@ URxvt.externalBorder: 0 URxvt.cursorBlink: true URxvt.title: term -URxvt.jumpScroll: false -URxvt.skipScroll: false +URxvt.jumpScroll: true +URxvt.skipScroll: true URxvt.secondaryScreen: 1 URxvt.secondaryScroll: 0 URxvt.secondaryWheel: 1 From c2b65731f7a4b6cf9bbe6f2a8590b1ccaf43bad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 12:42:35 +0100 Subject: [PATCH 14/18] Add some useful aliases --- zsh/zshrc | 2 ++ zsh/zshrc.d/20_aliases.sh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/zsh/zshrc b/zsh/zshrc index 016df15..77e1e71 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -14,3 +14,5 @@ for file in "${_zshdir}"/* ; do source "$file" fi done + +source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh diff --git a/zsh/zshrc.d/20_aliases.sh b/zsh/zshrc.d/20_aliases.sh index 43b9724..21ac07d 100644 --- a/zsh/zshrc.d/20_aliases.sh +++ b/zsh/zshrc.d/20_aliases.sh @@ -58,3 +58,8 @@ alias cl="clear" alias nocolor="sed -r \"s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g\"" alias ip="ip -color" + +alias yaml2js="python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)'" + +alias currentbranch='git rev-parse --abbrev-ref HEAD' +alias gpush='git push origin $(currentbranch)' From 9e6e83dd22472d59255aefab8dd59976ecf9c4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 12:47:13 +0100 Subject: [PATCH 15/18] Add spotify-control script --- i3/scripts/spotify-control | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 i3/scripts/spotify-control diff --git a/i3/scripts/spotify-control b/i3/scripts/spotify-control new file mode 100755 index 0000000..05618ad --- /dev/null +++ b/i3/scripts/spotify-control @@ -0,0 +1,20 @@ +#!/bin/bash + +case "$1" in +toggle) + cmd="PlayPause" + ;; +next) + cmd="Next" + ;; +previous) + cmd="Previous" + ;; +*) + echo "wrong argument $1" + exit 1 + ;; +esac + +dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player."${cmd}" +~/.i3/scripts/bar-update spotify From 0ffe64e468ccef7e6ae84a806e010e3cbfa73b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 12:48:21 +0100 Subject: [PATCH 16/18] Add ~/.usr/lib --- install.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.yml b/install.yml index a7081df..5e3885d 100644 --- a/install.yml +++ b/install.yml @@ -37,7 +37,8 @@ - mkdir -p ~/.var/lib - mkdir -p ~/.var/log - mkdir -p ~/.var/run - - curl --fail --location --create-dirs --output ~/.local/share/nvim/site/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + - mkdir -p ~/.usr/lib + - curl --fail --location --create-dirs --output ~/.local/share/nvim/site/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - command: nvim -E +PlugInstall +qall || true stdout: true stderr: true From 9b170f8aa32a2119a254f3bff27fef5695ea4657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 12:48:29 +0100 Subject: [PATCH 17/18] Remove i3.log --- i3/i3.log | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 i3/i3.log diff --git a/i3/i3.log b/i3/i3.log deleted file mode 100644 index e69de29..0000000 From ee816969c53099fb4e6a8f09e6d26c589d783ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 29 Jan 2018 12:59:37 +0100 Subject: [PATCH 18/18] Fix i3exit --- i3/scripts/i3exit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i3/scripts/i3exit b/i3/scripts/i3exit index 75da219..8cd5681 100755 --- a/i3/scripts/i3exit +++ b/i3/scripts/i3exit @@ -26,10 +26,10 @@ lock() (( $playing )) && dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause if [[ -f "$LOCKSCREEN" ]] ; then i3lock --nofork --show-failed-attempts --ignore-empty-password \ - --pointer win --image "$LOCKSCREEN" + --pointer win --image "$LOCKSCREEN" & else i3lock --nofork --show-failed-attempts --ignore-empty-password \ - --color "$_fallback_color" + --color "$_fallback_color" & fi screen_off wait