Merge branch 'common'

This commit is contained in:
2018-01-29 13:15:50 +01:00
19 changed files with 149 additions and 52 deletions

View File

@@ -1,12 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
wallpaper_directory="$LIBDIR/wallpaper/current" wallpaper="$LIBDIR/wallpaper/current"
wallchanger_pidfile="$RUNDIR/wallchanger.${XDG_SESSION_ID}.pid"
wallpaper_logfile="$LOGDIR/wallpaper.log"
wallpaper_interval="10800"
printf '%s' "starting $path_wallchanger" >>"$LOGFILE" printf '%s' "setting wallpaper" >>"$LOGFILE"
{ {
wallchanger "$wallpaper_directory" "$wallpaper_interval" & feh --bg-scale "${wallpaper}"
echo $! > "$wallchanger_pidfile"
} & &>> $LOGFILE } & &>> $LOGFILE

View File

@@ -13,6 +13,7 @@
visual = "!gitk --all" visual = "!gitk --all"
staged = "diff --staged" staged = "diff --staged"
fe = "fetch --all --prune"
co = "checkout" co = "checkout"
ci = "commit" ci = "commit"
st = "status" st = "status"
@@ -34,17 +35,19 @@
pushall = "!sh -c 'for r in $(git remote) ; do [[ "$r" != "upstream" ]] && { echo \"--- [$r] ---\" ; git push $r \"$@\" ; } ; done' -" 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 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' - intercommit = !bash -c 'interdiff <(git show $1) <(git show $2) | less -FRS' -
drop = !git rebase --onto $1^ --
[core] [core]
fileMode = true fileMode = true
whitespace = "blank-at-eol,space-before-tab,blank-at-eof" whitespace = "blank-at-eol,space-before-tab,blank-at-eof"
abbrev = 8 abbrev = 8
[color] [color]
ui = true ui = true
[column] [column]
@@ -64,6 +67,7 @@
[commit] [commit]
gpgSign = true gpgSign = true
cleanup = default cleanup = default
status = true
[status] [status]
relativePaths = false relativePaths = false
submoduleSummary = true submoduleSummary = true

View File

@@ -92,6 +92,24 @@
set $kill Shift+Q 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 ################################################################ ### KEYBINDINGS ################################################################
##################9############################################################# ##################9#############################################################
@@ -174,12 +192,16 @@
bindsym $mod+d exec --no-startup-id ~/.i3/scripts/appmenu bindsym $mod+d exec --no-startup-id ~/.i3/scripts/appmenu
bindsym $mod+Return exec $terminal 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 bindsym $mod+Shift+v exec --no-startup-id redshift-toggle
bindsync $mod+Shift+$scratchpad move scratchpad
bindsync $mod+$scratchpad scratchpad show
################################################################################ ################################################################################
### MODES ###################################################################### ### MODES ######################################################################
################################################################################ ################################################################################
@@ -238,7 +260,7 @@
floating_minimum_size 0 x 0 floating_minimum_size 0 x 0
floating_maximum_size 0 x 0 floating_maximum_size 0 x 0
font pango:Insonsolata 9 font pango:Inconsolata 10
################################################################################ ################################################################################
### COLOR SETTINGS ############################################################# ### COLOR SETTINGS #############################################################
@@ -280,7 +302,18 @@ bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -inc 5 ; exec --no
bindsym $mod+o exec --no-startup-id xautorandr ; exec --no-startup-id kill -SIGUSR2 $(cat $RUNDIR/wallchanger.$XDG_SESSION_ID.pid)'" 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) bindsym $mod+p exec --no-startup-id kill -SIGUSR1 $(cat $RUNDIR/wallchanger.$XDG_SESSION_ID.pid)
################################################################################
exec --no-startup-id autostart
###############################################################################
### BARS ####################################################################### ### BARS #######################################################################
################################################################################ ################################################################################
# #
@@ -288,6 +321,8 @@ bar {
mode dock mode dock
position top position top
#tray_output HDMI3
tray_output primary tray_output primary
tray_padding 3 tray_padding 3
@@ -299,7 +334,7 @@ bar {
id bar-0 id bar-0
font pango:Inconsolata, Icons 9 font pango:Inconsolata, FontAwesome 10
colors { colors {
background #222222 background #222222

View File

@@ -50,9 +50,9 @@ wifi {
spotify { spotify {
format = "  {title} - {artist} " format = "  {title} - {artist} "
format_down = "  off "
cache_timeout = 1 cache_timeout = 1
color_offline = '#FFFFFF' color_offline = '#FFFFFF'
format_down = "no Spotify"
} }
online_status { online_status {
@@ -60,7 +60,6 @@ online_status {
} }
volume_status { volume_status {
device = "12"
cache_timeout = 10 cache_timeout = 10
format = "  {percentage}% " format = "  {percentage}% "
format_muted = "  mute " format_muted = "  mute "

View File

@@ -1,2 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
i3-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans:size=11' -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'"

View File

@@ -17,6 +17,13 @@ log()
lock() lock()
{ {
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 [[ -f "$LOCKSCREEN" ]] ; then if [[ -f "$LOCKSCREEN" ]] ; then
i3lock --nofork --show-failed-attempts --ignore-empty-password \ i3lock --nofork --show-failed-attempts --ignore-empty-password \
--pointer win --image "$LOCKSCREEN" & --pointer win --image "$LOCKSCREEN" &
@@ -24,9 +31,13 @@ lock()
i3lock --nofork --show-failed-attempts --ignore-empty-password \ i3lock --nofork --show-failed-attempts --ignore-empty-password \
--color "$_fallback_color" & --color "$_fallback_color" &
fi fi
screen_off
wait
(( $playing )) && dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play
} }
screen_off() { screen_off() {
:
xset dpms force off xset dpms force off
} }

View File

@@ -1,11 +1,13 @@
#!/bin/bash #!/bin/bash
# name of the sink. execute pactl list sinks to get a list # 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 # this is the worst
SINK=$(( $(pactl list sinks | grep "Name: " | grep -n "${SINKNAME}"$ | grep -o "^[[:digit:]]*") -1)) SINK=$(( $(pactl list sinks | grep "Name: " | grep -n "${SINKNAME}"$ | grep -o "^[[:digit:]]*") -1))
getvol() { 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) echo $(pactl list sinks | grep "^[[:space:]]*Volume" | head -n $(( $SINK + 1 )) | tail -n 1 | grep -o "[[:digit:]]*%" | head -n 1 | cut -d "%" -f 1)
} }
@@ -80,6 +82,10 @@ update_status_bar() {
} }
case "$1" in case "$1" in
"sink")
echo $SINKNAME
echo $SINK
;;
"get-vol") "get-vol")
echo $(getvol) echo $(getvol)
;; ;;
@@ -111,5 +117,4 @@ case "$1" in
;; ;;
*) *)
usage usage
;;
esac esac

View File

@@ -14,6 +14,6 @@ output=$(
for option in "${options[@]}"; do for option in "${options[@]}"; do
echo "($i) $option" echo "($i) $option"
(( i++ )) (( i++ ))
done | dmenu -fn 'Inconsolata:size=9' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000') done | dmenu -fn 'Inconsolata:size=10' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000')
[[ "$output" ]] && "$(dirname "$0")"/i3exit "${output#(*) }" [[ "$output" ]] && "$(dirname "$0")"/i3exit "${output#(*) }"

View File

@@ -17,3 +17,4 @@ previous)
esac esac
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player."${cmd}" dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player."${cmd}"
~/.i3/scripts/bar-update spotify

20
i3/scripts/spotify-current Executable file
View File

@@ -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']
))

View File

@@ -37,6 +37,7 @@
- mkdir -p ~/.var/lib - mkdir -p ~/.var/lib
- mkdir -p ~/.var/log - mkdir -p ~/.var/log
- mkdir -p ~/.var/run - mkdir -p ~/.var/run
- mkdir -p ~/.usr/lib
- command: curl --fail --location --create-dirs --output ~/.local/share/nvim/site/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - command: curl --fail --location --create-dirs --output ~/.local/share/nvim/site/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
stdout: true stdout: true
stderr: true stderr: true

View File

@@ -1,5 +1,9 @@
set -g default-command "${SHELL}" 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 set -g prefix C-a
unbind C-b unbind C-b
@@ -26,7 +30,7 @@ bind l select-pane -R
set -g bell-action any set -g bell-action any
set -g history-limit 5000 set -g history-limit 50000
set -g base-index 1 set -g base-index 1
set-window-option -g pane-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-down new-window
bind-key -n S-left prev bind-key -n S-left prev
bind-key -n S-right next 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-F1 command-prompt "split-window -h 'exec man %%'"
bind-key -n C-F2 split-window -h "exec htop" bind-key -n C-F2 split-window -h "exec htop"
@@ -94,3 +97,6 @@ bind-key -n C-F3 set-option status
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf sourced" bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf sourced"
bind P paste-buffer 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

View File

@@ -8,14 +8,14 @@ call plug#begin('~/.local/share/nvim/plugged')
"Plug 'vim-airline/vim-airline-themes' "Plug 'vim-airline/vim-airline-themes'
Plug 'itchyny/lightline.vim' Plug 'itchyny/lightline.vim'
" Plug 'godlygeek/tabular' " Plug 'godlygeek/tabular'
" Plug 'lepture/vim-jinja' Plug 'lepture/vim-jinja'
Plug 'majutsushi/tagbar' Plug 'majutsushi/tagbar'
" Plug 'nblock/vim-dokuwiki' " Plug 'nblock/vim-dokuwiki'
Plug 'reedes/vim-pencil' Plug 'reedes/vim-pencil'
" Plug 'saltstack/salt-vim' " Plug 'saltstack/salt-vim'
Plug 'sickill/vim-monokai' Plug 'sickill/vim-monokai'
" Plug 'sjl/gundo.vim' " Plug 'sjl/gundo.vim'
" Plug 'tpope/vim-commentary' Plug 'tpope/vim-commentary'
" Plug 'tpope/vim-fugitive' " Plug 'tpope/vim-fugitive'
" Plug 'tpope/vim-speeddating' " Plug 'tpope/vim-speeddating'
" Plug 'tpope/vim-surround' " Plug 'tpope/vim-surround'
@@ -43,6 +43,10 @@ Plug 'scrooloose/nerdtree'
Plug 'vimwiki/vimwiki' Plug 'vimwiki/vimwiki'
Plug 'blindFS/vim-taskwarrior' Plug 'blindFS/vim-taskwarrior'
Plug 'tbabej/taskwiki' Plug 'tbabej/taskwiki'
Plug 'rodjek/vim-puppet'
Plug 'suan/vim-instant-markdown'
"Plug 'marshallward/vim-restructuredtext'
Plug 'vim-syntastic/syntastic'
call plug#end() call plug#end()
filetype plugin indent on filetype plugin indent on
@@ -114,7 +118,7 @@ set undodir=~/.vim/undo
set undofile set undofile
" == environment / directories == " == environment / directories ==
set autochdir set noautochdir
set directory=/var/tmp,/tmp set directory=/var/tmp,/tmp
set viewdir=~/.vim/view set viewdir=~/.vim/view
@@ -184,7 +188,10 @@ inoremap jj <ESC>
nnoremap <leader>v <C-w>v<C-w>l nnoremap <leader>v <C-w>v<C-w>l
nnoremap <leader>m :InstantMarkdownPreview<CR>
nnoremap <leader>u :GundoToggle<CR> nnoremap <leader>u :GundoToggle<CR>
nnoremap <leader>d :diffupdate<CR>
nmap <F9> :Goyo<CR>:TogglePencil<CR>:Limelight!!<CR> nmap <F9> :Goyo<CR>:TogglePencil<CR>:Limelight!!<CR>
nmap <leader>w :Goyo<CR>:TogglePencil<CR>:Limelight!!<CR> nmap <leader>w :Goyo<CR>:TogglePencil<CR>:Limelight!!<CR>
@@ -264,3 +271,8 @@ autocmd BufWritePre * :call DeleteTrailingWS()
autocmd FileType yaml set shiftwidth=2 autocmd FileType yaml set shiftwidth=2
set completeopt-=preview set completeopt-=preview
let g:ycm_add_preview_to_completeopt = 0 let g:ycm_add_preview_to_completeopt = 0
set completeopt-=preview
let g:ycm_add_preview_to_completeopt = 0
let g:instant_markdown_autostart = 0

View File

@@ -2,11 +2,10 @@ Xcursor.theme: Vanilla-DMZ
URxvt.scrollBar: false URxvt.scrollBar: false
URxvt.font: xft:Inconsolata:size=9, xft:FontAwesome:size=9 URxvt.font: xft:Inconsolata:size=10
URxvt.letterSpace: -1 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.url-launcher: /usr/bin/xdg-open
URxvt.matcher.button: 1 URxvt.matcher.button: 1
URxvt.saveLines: 10000 URxvt.saveLines: 10000
@@ -60,4 +59,3 @@ URxvt.fading: 15
! white ! white
*.color7: #f8f8f2 *.color7: #f8f8f2
*.color15: #f9f8f5 *.color15: #f9f8f5

View File

@@ -6,7 +6,6 @@ log() {
echo "[$(date +%FT%T)] $*" >> "$LOGFILE" echo "[$(date +%FT%T)] $*" >> "$LOGFILE"
} }
if [ -d /etc/X11/xinit/xinitrc.d ]; then if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f" [ -x "$f" ] && . "$f"
@@ -22,18 +21,5 @@ start_wm() {
exec i3 -c "$HOME/.i3/config" >> "$LOGDIR/i3/i3.log" 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 start_wm

View File

@@ -17,7 +17,7 @@ export PATH
export EDITOR="vim" export EDITOR="vim"
export VISUAL="vim" export VISUAL="vim"
export BROWSER="/usr/bin/xdg-open" export BROWSER="firefox"
export PAGER="less" export PAGER="less"
export LESS="FRX" export LESS="FRX"

View File

@@ -14,3 +14,5 @@ for file in "${_zshdir}"/* ; do
source "$file" source "$file"
fi fi
done done
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

View File

@@ -1,8 +1,3 @@
### TRANSLATIONS
alias vim="nvim"
alias urxvt="urxvt256c"
### COMMON OPERATIONS ### COMMON OPERATIONS
alias ll='ls -AlFh' alias ll='ls -AlFh'
alias la='ls -A' alias la='ls -A'
@@ -26,8 +21,6 @@ alias calc='python3 -ic "from math import *; import cmath"'
alias le_haxxor_1='clear && dmesg | pv -qL 20' alias le_haxxor_1='clear && dmesg | pv -qL 20'
alias le_haxxor_2='clear && hexdump -C /dev/urandom | pv -qlL 2' alias le_haxxor_2='clear && hexdump -C /dev/urandom | pv -qlL 2'
alias b='cd $OLDPWD'
alias root='sudo -sE' alias root='sudo -sE'
### USEFUL DEFAULT OPTIONS ### USEFUL DEFAULT OPTIONS
@@ -69,3 +62,8 @@ alias tw="task"
alias twl="task list" alias twl="task list"
alias twa="task add" alias twa="task add"
alias twd="task done" alias twd="task done"
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)'

View File

@@ -148,6 +148,10 @@ resolvecd() {
cd "$(readlink -f $(pwd))" cd "$(readlink -f $(pwd))"
} }
sshmux () {
ssh -t $@ "tmux a || tmux";
}
t() { t() {
if [[ "$1" ]] ; then if [[ "$1" ]] ; then
tmux new-session -A -s "$1" tmux new-session -A -s "$1"
@@ -155,3 +159,21 @@ t() {
tmux attach-session tmux attach-session
fi 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})"
}