From 8eee1c45bef74aa6094f463f9888ac653958b3dc Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Mon, 30 Mar 2015 10:25:12 +0200 Subject: Moving back to stow for management reasons: dotfiles.sh misbehaving on freebsd --- .compton | 3 + .gitmodules | 31 +- Xresources | 43 - bash/.bashrc | 46 + bashrc | 46 - compton | 3 - config/herbstluftwm/autostart | 193 --- config/herbstluftwm/dependencylist | 15 - config/herbstluftwm/lock.sh | 7 - config/herbstluftwm/notify.sh | 19 - config/herbstluftwm/panel.sh | 160 -- config/herbstluftwm/panel_indicators.sh | 127 -- config/herbstluftwm/poligons.png | Bin 4592375 -> 0 bytes config/herbstluftwm/popup.sh | 46 - config/herbstluftwm/start.sh | 13 - config/herbstluftwm/theme.sh | 33 - config/redshift.conf | 46 - dotfiles.sh | 7 - dotfilesrc | 13 - herbstluftwm/.config/herbstluftwm/autostart | 193 +++ herbstluftwm/.config/herbstluftwm/dependencylist | 15 + herbstluftwm/.config/herbstluftwm/lock.sh | 7 + herbstluftwm/.config/herbstluftwm/notify.sh | 19 + herbstluftwm/.config/herbstluftwm/panel.sh | 160 ++ .../.config/herbstluftwm/panel_indicators.sh | 127 ++ herbstluftwm/.config/herbstluftwm/poligons.png | Bin 0 -> 4592375 bytes herbstluftwm/.config/herbstluftwm/popup.sh | 46 + herbstluftwm/.config/herbstluftwm/start.sh | 13 + herbstluftwm/.config/herbstluftwm/theme.sh | 33 + liquidprompt/.liquidpromptrc | 143 ++ liquidprompt/.lp_ps1 | 30 + liquidpromptrc | 143 -- lp_ps1 | 30 - redshift/.config/redshift.conf | 46 + themes/.themes/numix-no-title-max/index.theme | 10 + .../metacity-1/metacity-theme-3.xml | 1589 ++++++++++++++++++++ themes/.themes/numix-no-title/index.theme | 10 + .../numix-no-title/metacity-1/metacity-theme-3.xml | 1588 +++++++++++++++++++ themes/numix-no-title-max/index.theme | 10 - .../metacity-1/metacity-theme-3.xml | 1589 -------------------- themes/numix-no-title/index.theme | 10 - .../numix-no-title/metacity-1/metacity-theme-3.xml | 1588 ------------------- vim/.vim/autoload/pathogen.vim | 1 + vim/.vim/ftplugin/python.vim | 4 + vim/.vimrc | 36 + vim/autoload/pathogen.vim | 1 - vim/ftplugin/python.vim | 4 - vimperator/.vimperatorrc | 9 + vimperatorrc | 9 - vimrc | 36 - xorg/.Xresources | 43 + 51 files changed, 4185 insertions(+), 4208 deletions(-) create mode 100644 .compton delete mode 100644 Xresources create mode 100644 bash/.bashrc delete mode 100644 bashrc delete mode 100644 compton delete mode 100755 config/herbstluftwm/autostart delete mode 100644 config/herbstluftwm/dependencylist delete mode 100755 config/herbstluftwm/lock.sh delete mode 100755 config/herbstluftwm/notify.sh delete mode 100755 config/herbstluftwm/panel.sh delete mode 100644 config/herbstluftwm/panel_indicators.sh delete mode 100644 config/herbstluftwm/poligons.png delete mode 100755 config/herbstluftwm/popup.sh delete mode 100755 config/herbstluftwm/start.sh delete mode 100644 config/herbstluftwm/theme.sh delete mode 100644 config/redshift.conf delete mode 100755 dotfiles.sh delete mode 100644 dotfilesrc create mode 100755 herbstluftwm/.config/herbstluftwm/autostart create mode 100644 herbstluftwm/.config/herbstluftwm/dependencylist create mode 100755 herbstluftwm/.config/herbstluftwm/lock.sh create mode 100755 herbstluftwm/.config/herbstluftwm/notify.sh create mode 100755 herbstluftwm/.config/herbstluftwm/panel.sh create mode 100644 herbstluftwm/.config/herbstluftwm/panel_indicators.sh create mode 100644 herbstluftwm/.config/herbstluftwm/poligons.png create mode 100755 herbstluftwm/.config/herbstluftwm/popup.sh create mode 100755 herbstluftwm/.config/herbstluftwm/start.sh create mode 100644 herbstluftwm/.config/herbstluftwm/theme.sh create mode 100644 liquidprompt/.liquidpromptrc create mode 100644 liquidprompt/.lp_ps1 delete mode 100644 liquidpromptrc delete mode 100644 lp_ps1 create mode 100644 redshift/.config/redshift.conf create mode 100644 themes/.themes/numix-no-title-max/index.theme create mode 100644 themes/.themes/numix-no-title-max/metacity-1/metacity-theme-3.xml create mode 100644 themes/.themes/numix-no-title/index.theme create mode 100644 themes/.themes/numix-no-title/metacity-1/metacity-theme-3.xml delete mode 100644 themes/numix-no-title-max/index.theme delete mode 100644 themes/numix-no-title-max/metacity-1/metacity-theme-3.xml delete mode 100644 themes/numix-no-title/index.theme delete mode 100644 themes/numix-no-title/metacity-1/metacity-theme-3.xml create mode 120000 vim/.vim/autoload/pathogen.vim create mode 100644 vim/.vim/ftplugin/python.vim create mode 100644 vim/.vimrc delete mode 120000 vim/autoload/pathogen.vim delete mode 100644 vim/ftplugin/python.vim create mode 100644 vimperator/.vimperatorrc delete mode 100644 vimperatorrc delete mode 100644 vimrc create mode 100644 xorg/.Xresources diff --git a/.compton b/.compton new file mode 100644 index 0000000..2f736fd --- /dev/null +++ b/.compton @@ -0,0 +1,3 @@ +shadow = true; +clear-shadow = true; +shadow-exclude = ["g:si:dmenu"]; diff --git a/.gitmodules b/.gitmodules index 93ccec3..b993b7a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,24 +1,21 @@ -[submodule "dotfiles"] - path = dotfiles - url = https://github.com/jbernard/dotfiles.git -[submodule "vim/vim-pathogen"] - path = vim/vim-pathogen +[submodule "vim/.vim/vim-pathogen"] + path = vim/.vim/vim-pathogen url = https://github.com/tpope/vim-pathogen.git -[submodule "vim/bundle/nerdtree"] - path = vim/bundle/nerdtree +[submodule "vim/.vim/bundle/nerdtree"] + path = vim/.vim/bundle/nerdtree url = https://github.com/scrooloose/nerdtree.git -[submodule "vim/bundle/supertab"] - path = vim/bundle/supertab +[submodule "vim/.vim/bundle/supertab"] + path = vim/.vim/bundle/supertab url = https://github.com/ervandew/supertab.git -[submodule "vim/bundle/syntastic"] - path = vim/bundle/syntastic +[submodule "vim/.vim/bundle/syntastic"] + path = vim/.vim/bundle/syntastic url = https://github.com/scrooloose/syntastic.git -[submodule "vim/bundle/vim-fugitive"] - path = vim/bundle/vim-fugitive +[submodule "vim/.vim/bundle/vim-fugitive"] + path = vim/.vim/bundle/vim-fugitive url = https://github.com/tpope/vim-fugitive.git -[submodule "vim/bundle/vim-nerdtree-tabs"] - path = vim/bundle/vim-nerdtree-tabs +[submodule "vim/.vim/bundle/vim-nerdtree-tabs"] + path = vim/.vim/bundle/vim-nerdtree-tabs url = https://github.com/jistr/vim-nerdtree-tabs.git -[submodule "vim/bundle/nerdcommenter"] - path = vim/bundle/nerdcommenter +[submodule "vim/.vim/bundle/nerdcommenter"] + path = vim/.vim/bundle/nerdcommenter url = https://github.com/scrooloose/nerdcommenter.git diff --git a/Xresources b/Xresources deleted file mode 100644 index b489339..0000000 --- a/Xresources +++ /dev/null @@ -1,43 +0,0 @@ -!*dpi: 145 - -! Font and Fontsize -*faceName: Droid Sans Mono -*faceSize: 11 - -! Colors -*background: #2d2d2d -*foreground: #f9f9f9 - -! Darks -*color0: #2d2d2d -*color8: #333333 - -! Reds -*color1: #690a03 -*color9: #d64937 - -! Greens -*color2: #13a43b -*color10: #6dfb2d - -! Yellows -*color3: #f5a711 -*color11: #ffdc00 - -! Blues -*color4: #0f6cc9 -*color12: #32abd8 - -! Magentas -*color5: #93116b -*color13: #c61f93 - -! Cyanes -*color6: #3cb691 -*color14: #53b4bd - -!Whites -*color7: #d9d9d9 -*color15: #f9f9f9 - -XTerm*selectToClipboard: true diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..218b1a8 --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,46 @@ +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +alias ls='ls --color=auto' +alias jblive='mpv rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream 2> /dev/null &' + +pacaur() { + env pacman_program="pacaur" /usr/bin/pacmatic "$@" +} + +man() { + env LESS_TERMCAP_mb=$'\E[01;31m' \ + LESS_TERMCAP_md=$'\E[01;38;5;74m' \ + LESS_TERMCAP_me=$'\E[0m' \ + LESS_TERMCAP_se=$'\E[0m' \ + LESS_TERMCAP_so=$'\E[38;5;246m' \ + LESS_TERMCAP_ue=$'\E[0m' \ + LESS_TERMCAP_us=$'\E[04;38;5;146m' \ + man "$@" +} + +vim() { + if [[ -z $@ ]]; then + /usr/bin/vim + elif [[ -d $@ ]]; then + dir=$(pwd) + cd $@ && /usr/bin/vim && cd $dir + else + /usr/bin/vim $@ + fi +} + +export PS1='[\d][\t]\u on \h\n\w => ' +export GOPATH="$HOME/programming/go" +export GEM_HOME="$(ruby -e 'print Gem.user_dir')/bin" +export PATH="$PATH:$GEM_HOME:$GOPATH/bin" +export EDITOR="vim" + +source liquidprompt +archey3 + +# vim: set ts=8 sw=8 tw=0 noet : diff --git a/bashrc b/bashrc deleted file mode 100644 index 218b1a8..0000000 --- a/bashrc +++ /dev/null @@ -1,46 +0,0 @@ -# -# ~/.bashrc -# - -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -alias ls='ls --color=auto' -alias jblive='mpv rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream 2> /dev/null &' - -pacaur() { - env pacman_program="pacaur" /usr/bin/pacmatic "$@" -} - -man() { - env LESS_TERMCAP_mb=$'\E[01;31m' \ - LESS_TERMCAP_md=$'\E[01;38;5;74m' \ - LESS_TERMCAP_me=$'\E[0m' \ - LESS_TERMCAP_se=$'\E[0m' \ - LESS_TERMCAP_so=$'\E[38;5;246m' \ - LESS_TERMCAP_ue=$'\E[0m' \ - LESS_TERMCAP_us=$'\E[04;38;5;146m' \ - man "$@" -} - -vim() { - if [[ -z $@ ]]; then - /usr/bin/vim - elif [[ -d $@ ]]; then - dir=$(pwd) - cd $@ && /usr/bin/vim && cd $dir - else - /usr/bin/vim $@ - fi -} - -export PS1='[\d][\t]\u on \h\n\w => ' -export GOPATH="$HOME/programming/go" -export GEM_HOME="$(ruby -e 'print Gem.user_dir')/bin" -export PATH="$PATH:$GEM_HOME:$GOPATH/bin" -export EDITOR="vim" - -source liquidprompt -archey3 - -# vim: set ts=8 sw=8 tw=0 noet : diff --git a/compton b/compton deleted file mode 100644 index 2f736fd..0000000 --- a/compton +++ /dev/null @@ -1,3 +0,0 @@ -shadow = true; -clear-shadow = true; -shadow-exclude = ["g:si:dmenu"]; diff --git a/config/herbstluftwm/autostart b/config/herbstluftwm/autostart deleted file mode 100755 index 683fbf1..0000000 --- a/config/herbstluftwm/autostart +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/bash - -# this is a simple config for herbstluftwm - -hc() { - herbstclient "$@" -} - -#Include the theming script -dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -source "$dir/theme.sh" - -#Detect monitors -hc set auto_detect_monitors 1 -hc detect_monitors - -#Panel and window_p -monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')) -panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc) -dmenu_opts="-h $panel_h -w $panel_w -x $window_p -y $window_p -p Run: -nb $color_bg -nf $color_fg -sb $color_accent -sf $color_bg" - -# remove all existing keybindings -hc keyunbind --all - -# keybindings -Mod=Mod4 # Use the super key as the main modifier - -hc keybind $Mod-Shift-q quit -hc keybind $Mod-Shift-r reload -hc keybind $Mod-Shift-c close -hc keybind $Mod-Return spawn xterm -hc keybind $Mod-grave spawn dmenu_run $dmenu_opts -hc keybind XF86AudioLowerVolume spawn amixer set Master 1%- -hc keybind XF86AudioRaiseVolume spawn amixer set Master 1%+ - -# basic movement -# focusing clients -#hc keybind $Mod-Left focus left -#hc keybind $Mod-Down focus down -#hc keybind $Mod-Up focus up -#hc keybind $Mod-Right focus right -hc keybind $Mod-h focus left -hc keybind $Mod-j focus down -hc keybind $Mod-k focus up -hc keybind $Mod-l focus right - -# moving clients -#hc keybind $Mod-Shift-Left shift left -#hc keybind $Mod-Shift-Down shift down -#hc keybind $Mod-Shift-Up shift up -#hc keybind $Mod-Shift-Right shift right -hc keybind $Mod-Shift-h shift left -hc keybind $Mod-Shift-j shift down -hc keybind $Mod-Shift-k shift up -hc keybind $Mod-Shift-l shift right - -# splitting frames -# create an empty frame at the specified direction -hc keybind $Mod-u split bottom 0.5 -hc keybind $Mod-o split right 0.5 -# let the current frame explode into subframes -hc keybind $Mod-Control-space split explode - -# resizing frames -resizestep=0.05 -hc keybind $Mod-Control-h resize left +$resizestep -hc keybind $Mod-Control-j resize down +$resizestep -hc keybind $Mod-Control-k resize up +$resizestep -hc keybind $Mod-Control-l resize right +$resizestep -#hc keybind $Mod-Control-Left resize left +$resizestep -#hc keybind $Mod-Control-Down resize down +$resizestep -#hc keybind $Mod-Control-Up resize up +$resizestep -#hc keybind $Mod-Control-Right resize right +$resizestep - -# tags -tag_names=( I II III IV V VI VII VIII IX X ) -tag_keys=( {1..9} 0 ) - -# Selecting workspaces -#hc keybind Alt-Control-Left use_index -1 -#hc keybind Alt-Control-Right use_index +1 -hc keybind Alt-Control-h use_index -1 -hc keybind Alt-Control-l use_index +1 -hc rename default "${tag_names[0]}" || true -for i in ${!tag_names[@]} ; do - hc add "${tag_names[$i]}" - key="${tag_keys[$i]}" - if ! [ -z "$key" ] ; then - hc keybind "$Mod-$key" use_index "$i" - hc keybind "$Mod-Shift-$key" move_index "$i" - fi -done - -# cycle through tags -hc keybind $Mod-period use_index +1 --skip-visible -hc keybind $Mod-comma use_index -1 --skip-visible - -# layouting -hc keybind $Mod-r remove -hc keybind $Mod-space cycle_layout 1 -hc keybind $Mod-s floating toggle -hc keybind $Mod-f fullscreen toggle -hc keybind $Mod-p pseudotile toggle - -# mouse -hc mouseunbind --all -hc mousebind $Mod-Button1 move -hc mousebind $Mod-Button2 zoom -hc mousebind $Mod-Button3 resize - -# focus -hc keybind $Mod-BackSpace cycle_monitor -hc keybind $Mod-Tab cycle_all +1 -hc keybind $Mod-Shift-Tab cycle_all -1 -hc keybind $Mod-c cycle -hc keybind $Mod-i jumpto urgent -hc set focus_follows_mouse 1 - -# theme -hc attr theme.tiling.reset 1 -hc attr theme.floating.reset 1 -hc set frame_border_width 0 -hc set always_show_frame 0 -hc set frame_bg_transparent 1 -hc set frame_normal_opacity 0 -hc set frame_active_opacity 0 -hc set frame_transparent_width 0 -hc set frame_gap 0 - -hc attr theme.active.color $color_accent -hc attr theme.normal.color $color_bg -hc attr theme.urgent.color orange -hc attr theme.inner_width 1 -hc attr theme.inner_color $color_bg -hc attr theme.border_width 3 -hc attr theme.floating.border_width 4 -hc attr theme.floating.outer_width 1 -hc attr theme.floating.outer_color $color_bg -hc attr theme.active.inner_color $color_bg -hc attr theme.active.outer_color $color_bg -hc attr theme.background_color $color_bg - -hc set window_gap $window_p -hc set frame_padding 0 -hc set smart_window_surroundings 0 -hc set smart_frame_surroundings 1 -hc set mouse_recenter_gap 1 - -# rules -hc unrule -F -hc rule focus=on # normally focus new clients - -#hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on -hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on -hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off - -hc rule --class~'(.*[Ss]team.*)' --tag=IX --focus=off -hc rule --class~'(.*[Hh]exchat.*)' --tag=X --focus=off -hc rule --class~'(.*[Ss]potify.*)' --tag=X --focus=off -hc rule --class~'(.*[Ss]kype.*)' --tag=VIII --focus=off - -# unlock, just to be sure -hc unlock - -herbstclient set tree_style '╾│ ├└╼─┐' - -#Start panel in all monitors -start_panel() { - for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do - "$1" $monitor& - done -} - -# find the panel -panel=$dir/panel.sh -[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh -if pgrep panel.sh >> /dev/null -then - kill $(pgrep panel.sh) - start_panel $panel -else - start_panel $panel -fi - -pulseaudio --start - -$dir/start.sh "xautolock -time 5 -locker $dir/lock.sh" -$dir/start.sh "feh --bg-fill $wallpaper" -$dir/start.sh "compton --config $HOME/.compton" -$dir/start.sh "xrdb -load $HOME/.Xresources" -$dir/start.sh "xset +fp /usr/share/fonts/local" -$dir/start.sh "xset fp rehash" -#$dir/start.sh "$dir/notify.sh $dir/popup.sh" diff --git a/config/herbstluftwm/dependencylist b/config/herbstluftwm/dependencylist deleted file mode 100644 index 7d3babf..0000000 --- a/config/herbstluftwm/dependencylist +++ /dev/null @@ -1,15 +0,0 @@ -alsa-utils -bar-aint-recursive -bc -compton -dmenu2 -feh -i3lock -playerctl -pulseaudio -pulseaudio-alsa -scrot -sed -stlarch_font -wireless_tools -xautolock diff --git a/config/herbstluftwm/lock.sh b/config/herbstluftwm/lock.sh deleted file mode 100755 index 04c4638..0000000 --- a/config/herbstluftwm/lock.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCREENCAP="/tmp/lock.png" -scrot $SCREENCAP -convert -gaussian-blur "12x3" $SCREENCAP $SCREENCAP -i3lock -i $SCREENCAP -rm $SCREENCAP diff --git a/config/herbstluftwm/notify.sh b/config/herbstluftwm/notify.sh deleted file mode 100755 index 40c5330..0000000 --- a/config/herbstluftwm/notify.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -while true; do - - bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) - bat_stat=$(cat /sys/class/power_supply/BAT1/status) - - if [[ $bat_lvl -le 5 && $bat_stat == "Discharging" ]]; then - $1 -m "Battery level critical: $bat_lvl%%" -u "high" - elif [[ $bat_lvl -eq 10 && $bat_stat == "Discharging" ]]; then - $1 -m "Battery level low: $bat_lvl%%" - elif [[ $bat_lvl -eq 50 && $bat_stat == "Discharging" ]]; then - $1 -m "Battery level at $bat_lvl%%" - elif [[ $bat_lvl -eq 100 && $bat_stat == "Charging" ]]; then - $1 -m "Battery fully charged" - fi - - sleep 60; -done diff --git a/config/herbstluftwm/panel.sh b/config/herbstluftwm/panel.sh deleted file mode 100755 index 763c668..0000000 --- a/config/herbstluftwm/panel.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash - -hc() { - "${herbstclient_command[@]:-herbstclient}" "$@" ; -} - -dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -source "$dir/theme.sh" -source "$dir/panel_indicators.sh" - -monitor=${1:-0} - -geometry=( $(herbstclient monitor_rect "$monitor") ) -if [ -z "$geometry" ] ;then - echo "Invalid monitor $monitor" - exit 1 -fi -# geometry has the format W H X Y -x=$(echo "${geometry[0]} + $window_p" | bc) -y=$(echo "${geometry[1]} + $window_p" | bc) -panel_width=$(echo "${geometry[2]} - (2 * $window_p)" | bc) -bar_opts="-g ${panel_width}x${panel_h}+${x}+${y} -f $font,$font_sec -u 2 -B $acolor_bg -F $acolor_fg" - -hc pad $monitor $(echo "$panel_h + $window_p" | bc) - -if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then - # mawk needs "-W interactive" to line-buffer stdout correctly - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593504 - uniq_linebuffered() { - awk -W interactive '$0 != l { print ; l=$0 ; fflush(); }' "$@" - } -else - # other awk versions (e.g. gawk) issue a warning with "-W interactive", so - # we don't want to use it there. - uniq_linebuffered() { - awk '$0 != l { print ; l=$0 ; fflush(); }' "$@" - } -fi - -{ - ### Event generator ### - # \t [...] - # e.g. - # date ^fg(#efefef)18:33^fg(#909090), 2013-10-^fg(#efefef)29 - while true ; do - music - volume - network - battery - clock - sleep 1 || break - done > >(uniq_linebuffered) & - childpid=$! - hc --idle - kill $childpid -} 2> /dev/null | { - - IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" - visible=true - date="" - volume="" - battery="" - net="" - windowtitle="" - while true ; do - separator="%{F$acolor_accent}|%{F-}" - # draw tags - for i in "${tags[@]}" ; do - case ${i:0:1} in - '#') - echo -n "%{U$acolor_accent+u}%{F$acolor_fg}" - ;; - '+') - echo -n "%{U$acolor_fg+u}%{F$acolor_fg}" - ;; - ':') - echo -n "%{F$acolor_fg}" - ;; - '!') - echo -n "%{B$acolor_accent}%{U$acolor_accent+u}%{F$acolor_bg}" - ;; - *) - echo -n "%{F$acolor_fg}" - ;; - esac - echo -n "%{A:tag,${i:1}:} ${i:1} %{A}%{F-}%{U-u}%{B-}" - done - echo -n "$separator%{F-}%{B-} " - echo -n "${windowtitle//^/^^}" - - #Right part of panel - right="$music$volume$net$battery$date " - echo -n "%{r}$right" - - #DO NOT REMOVE THIS ECHO - echo - - # wait for next event - IFS=$'\t' read -ra cmd || break - case "${cmd[0]}" in - tag*) - #echo "resetting tags" >&2 - IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" - ;; - music) - music="${cmd[@]:1}" - if [ $music == "off" ] ; then - music="" - else - music="$music $separator%{B-} " - fi - ;; - volume) - volume="${cmd[@]:1}" - if [ $volume == "off" ] ; then - volume="" - else - volume="$volume $separator%{B-} " - fi - ;; - net) - net="${cmd[@]:1}" - if [ $net = "off" ] ; then - net="" - else - net="$net $separator%{B-} " - fi - ;; - battery) - battery="${cmd[@]:1}" - if [ $battery == "off" ] ; then - battery="" - else - battery="$battery $separator%{B-} " - fi - ;; - date) - #echo "resetting date" >&2 - date="${cmd[@]:1}" - ;; - focus_changed|window_title_changed) - windowtitle="${cmd[@]:2}" - ;; - esac - done -} 2> /dev/null | bar $bar_opts | { - #Handle clickable areas - while read line; do - IFS=',' read -a c <<< $(echo $line) - case "${c[0]}" in - tag) - herbstclient use "${c[1]}" - echo "herbstclient use \"${c[1]}\"" - ;; - *) - echo "${c[0]}: not valid command" - ;; - esac - done -} diff --git a/config/herbstluftwm/panel_indicators.sh b/config/herbstluftwm/panel_indicators.sh deleted file mode 100644 index e450337..0000000 --- a/config/herbstluftwm/panel_indicators.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash -battery_icon=("\ue113" "\ue114" "\ue115" "\ue116" "\ue042") -network_icon=("\ue0f1" "\ue0f2" "\ue0f3" "\ue0af") -music_icon="\ue05c" - -music() -{ - # Music - player_status=$(playerctl status) - if [ $player_status = "Playing" ]; then - player_artist=$(playerctl metadata artist) - player_title=$(playerctl metadata title) - playing="$player_title - $player_artist" - - if [ "$current" != "$playing" ] ; then - current=$playing - scrolling=$current - elif [ ${#scrolling} -gt "24" ] ; then - scrolling=${scrolling:1} - else - scrolling=$current - fi - - echo -e "music\t$music_icon ${scrolling:0:24}" - else - echo -e "music\toff" - fi -} - -volume() -{ - # Volume - if pgrep pulseaudio >> /dev/null ; then - volumes=$(\ - amixer get Master | \ - grep "Front Right: Playback"\ - ) - vol=$(\ - echo $volumes | \ - sed "s/.*\[\([0-9]*\)%\].*/\1/"\ - ) - if [ -z $vol ] ; then - echo -e "volume\toff" - else - echo -e "volume\t%{F$acolor_fg}\ue05d $vol%%%{F-}" - fi - else - echo -e "volume\toff" - fi -} - -network() -{ - # Network - read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'` - if iwconfig $int1 >/dev/null 2>&1; then - wifi=$int1 - eth=$int2 - else - wifi=$int2 - eth=$int1 - fi - - ip link show $eth | grep 'state UP' >/dev/null && int=$eth || int=$wifi - - if [ $int == $wifi ] ; then - iwconfig=$(iwconfig $int) - ssid=$( - echo $iwconfig | \ - sed "s/.*ESSID:\(\".*\"\).*/\1/" | \ - sed "s/.*\(off\/any\).*/\"\1\"/" | \ - sed "s/.*\"\(.*\)\".*/\1/" - ) - - quality=$( \ - echo $iwconfig | \ - sed "s/^.*Link Quality=\([0-9]*\)\/\([0-9]*\) .*$/(\1*100)\/\2/" | \ - bc - ) - - if [ $ssid == "off/any" ] ; then - echo -e "net\toff" - elif [ $quality -lt 33 ] ; then - echo -e "net\t${network_icon[0]} $ssid" - elif [ $quality -lt 66 ] ; then - echo -e "net\t${network_icon[1]} $ssid" - else - echo -e "net\t${network_icon[2]} $ssid" - fi - - elif [ $int == $eth ] ; then - echo -e "net\t${network_icon[3]} ethernet" - else - echo -e "net\toff" - fi -} - -battery() -{ - # Battery - if $(test -e /sys/class/power_supply/BAT1) ; then - - bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) - bat_state=$(cat /sys/class/power_supply/BAT1/status) - - if [ $bat_state == "Charging" ] ; then - bat_status="${battery_icon[4]}" - elif [ $bat_lvl -lt 10 ] ; then - bat_status="${F$acolor_accent}${battery_icon[0]}${F-}" - elif [ $bat_ -lt 33 ] ; then - bat_status="${battery_icon[1]}" - elif [ $bat_lvl -lt 66 ] ; then - bat_status="${battery_icon[2]}" - else - bat_status="${battery_icon[3]}" - fi - - echo -e "battery\t$bat_status $bat_lvl%%%{F-}" - else - echo -e "battery\toff" - fi -} - -clock() -{ - echo -e $(date +$"date\t%{F$acolor_fg}%H:%M:%S %{F$acolor_fg}(%d-%m-%Y)%{F-}") -} diff --git a/config/herbstluftwm/poligons.png b/config/herbstluftwm/poligons.png deleted file mode 100644 index e5c7cda..0000000 Binary files a/config/herbstluftwm/poligons.png and /dev/null differ diff --git a/config/herbstluftwm/popup.sh b/config/herbstluftwm/popup.sh deleted file mode 100755 index eda37f5..0000000 --- a/config/herbstluftwm/popup.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -help () { - echo -e "Usage: popup.sh [OPTIONS]" - echo -e "Spawns a popup for a certain amount of time" - echo -e "" - echo -e "Options:" - echo -e " -m MESSAGE\t\tSpecifies message to be displayed" - echo -e " -t TIMEOUT\t\tAmount of time in seconds the popup is displayed" - echo -e " -u LEVEL\t\tUrgency level (info or high)" -} - -dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -source "$dir/theme.sh" - -timeout=10 -message="" -urgency="info" - -while getopts ":m:t:x:y:w:h:u:" opt; do - case $opt in - m) message=$OPTARG ;; - t) timeout=$OPTARG ;; - u) urgency=$OPTARG ;; - esac -done - -if test ! $message; then - help -else - - bar_opts="-f $font,$font_sec -B $acolor_bg -F $acolor_fg -g ${popup_width}x${height}+${popup_x}+${popup_y} -u 2" - - t=$(date +%T) - - if [ $urgency == "info" ]; then - prefix="Info:" - elif [ $urgency == "high" ]; then - prefix="!!WARNING:" - fi - - { - echo "%{F$acolor_accent} $prefix %{F$acolor_fg}$message %{F$acolor_fg}($t)%{F-}" - sleep $timeout - } | bar $bar_opts -fi diff --git a/config/herbstluftwm/start.sh b/config/herbstluftwm/start.sh deleted file mode 100755 index f10fca6..0000000 --- a/config/herbstluftwm/start.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -opts=($@) - -program=$(echo ${opts[0]} | sed 's/^.*\/\(.*\)/\1/') - -if pgrep $program >> /dev/null -then - killall $program - ${opts[@]} & -else - ${opts[@]} & -fi diff --git a/config/herbstluftwm/theme.sh b/config/herbstluftwm/theme.sh deleted file mode 100644 index 34e22a7..0000000 --- a/config/herbstluftwm/theme.sh +++ /dev/null @@ -1,33 +0,0 @@ -# Get color from ~/.Xresources -get_x_color() { - xresources=$(cat ~/.Xresources) - color=$(echo $xresources | sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/") - echo $color -} - -# Add alpha channel to a hexadecimal color -add_alpha_channel(){ - echo "$1" | \ - sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" -} - -# Wallpaper -wallpaper="$HOME/.config/herbstluftwm/poligons.png" - -# Padding -window_p=20 - -# Panel -panel_h=24 -font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" -font_sec="-*-stlarch-medium-*-*-*-10-*-*-*-*-*-*-*" - -# Colors -color_fg=$(get_x_color 15) -color_accent=$(get_x_color 5) -color_bg=$(get_x_color 0) - -# Alpha Colors for use with bar -acolor_fg=$(add_alpha_channel $color_fg) -acolor_accent=$(add_alpha_channel $color_accent) -acolor_bg=$(add_alpha_channel $color_bg) diff --git a/config/redshift.conf b/config/redshift.conf deleted file mode 100644 index 2b88434..0000000 --- a/config/redshift.conf +++ /dev/null @@ -1,46 +0,0 @@ -; Global settings for redshift -[redshift] -; Set the day and night screen temperatures -temp-day=6500 -temp-night=4200 - -; Enable/Disable a smooth transition between day and night -; 0 will cause a direct change from day to night screen temperature. -; 1 will gradually increase or decrease the screen temperature -transition=1 - -; Set the screen brightness. Default is 1.0 -;brightness=0.9 -; It is also possible to use different settings for day and night since version 1.8. -;brightness-day=0.7 -;brightness-night=0.4 -; Set the screen gamma (for all colors, or each color channel individually) -gamma=0.8 -;gamma=0.8:0.7:0.8 - -; Set the location-provider: 'geoclue', 'gnome-clock', 'manual' -; type 'redshift -l list' to see possible values -; The location provider settings are in a different section. -location-provider=manual - -; Set the adjustment-method: 'randr', 'vidmode' -; type 'redshift -m list' to see all possible values -; 'randr' is the preferred method, 'vidmode' is an older API -; but works in some cases when 'randr' does not. -; The adjustment method settings are in a different section. -adjustment-method=randr - -; Configuration of the location-provider: -; type 'redshift -l PROVIDER:help' to see the settings -; e.g. 'redshift -l manual:help' -[manual] -lat=52.6 -lon=5.1 - -; Configuration of the adjustment-method -; type 'redshift -m METHOD:help' to see the settings -; ex: 'redshift -m randr:help' -; In this example, randr is configured to adjust screen 1. -; Note that the numbering starts from 0, so this is actually the second screen. -[randr] -screen=0 diff --git a/dotfiles.sh b/dotfiles.sh deleted file mode 100755 index 0cc525a..0000000 --- a/dotfiles.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -DOTFILES=$HOME/dotfiles -DOTFILESRC=$DOTFILES/dotfilesrc -PATH=$PATH:$DOTFILES/dotfiles/bin - -dotfiles --repo="$DOTFILES" --config="$DOTFILESRC" $@ diff --git a/dotfilesrc b/dotfilesrc deleted file mode 100644 index f5d8526..0000000 --- a/dotfilesrc +++ /dev/null @@ -1,13 +0,0 @@ -[dotfiles] -repository = ~/dotfiles - -packages = ['config', - 'themes'] - -ignore = [ - '.git', - '.gitignore', - '.gitmodules', - 'dotfiles*', - '*.swp', - 'README.md'] diff --git a/herbstluftwm/.config/herbstluftwm/autostart b/herbstluftwm/.config/herbstluftwm/autostart new file mode 100755 index 0000000..683fbf1 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/autostart @@ -0,0 +1,193 @@ +#!/bin/bash + +# this is a simple config for herbstluftwm + +hc() { + herbstclient "$@" +} + +#Include the theming script +dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +source "$dir/theme.sh" + +#Detect monitors +hc set auto_detect_monitors 1 +hc detect_monitors + +#Panel and window_p +monitor_w=($(hc list_monitors | sed 's/^[0-9]: \([0-9]*\)x.*$/\1/')) +panel_w=$(echo "$monitor_w - (2 * $window_p)" | bc) +dmenu_opts="-h $panel_h -w $panel_w -x $window_p -y $window_p -p Run: -nb $color_bg -nf $color_fg -sb $color_accent -sf $color_bg" + +# remove all existing keybindings +hc keyunbind --all + +# keybindings +Mod=Mod4 # Use the super key as the main modifier + +hc keybind $Mod-Shift-q quit +hc keybind $Mod-Shift-r reload +hc keybind $Mod-Shift-c close +hc keybind $Mod-Return spawn xterm +hc keybind $Mod-grave spawn dmenu_run $dmenu_opts +hc keybind XF86AudioLowerVolume spawn amixer set Master 1%- +hc keybind XF86AudioRaiseVolume spawn amixer set Master 1%+ + +# basic movement +# focusing clients +#hc keybind $Mod-Left focus left +#hc keybind $Mod-Down focus down +#hc keybind $Mod-Up focus up +#hc keybind $Mod-Right focus right +hc keybind $Mod-h focus left +hc keybind $Mod-j focus down +hc keybind $Mod-k focus up +hc keybind $Mod-l focus right + +# moving clients +#hc keybind $Mod-Shift-Left shift left +#hc keybind $Mod-Shift-Down shift down +#hc keybind $Mod-Shift-Up shift up +#hc keybind $Mod-Shift-Right shift right +hc keybind $Mod-Shift-h shift left +hc keybind $Mod-Shift-j shift down +hc keybind $Mod-Shift-k shift up +hc keybind $Mod-Shift-l shift right + +# splitting frames +# create an empty frame at the specified direction +hc keybind $Mod-u split bottom 0.5 +hc keybind $Mod-o split right 0.5 +# let the current frame explode into subframes +hc keybind $Mod-Control-space split explode + +# resizing frames +resizestep=0.05 +hc keybind $Mod-Control-h resize left +$resizestep +hc keybind $Mod-Control-j resize down +$resizestep +hc keybind $Mod-Control-k resize up +$resizestep +hc keybind $Mod-Control-l resize right +$resizestep +#hc keybind $Mod-Control-Left resize left +$resizestep +#hc keybind $Mod-Control-Down resize down +$resizestep +#hc keybind $Mod-Control-Up resize up +$resizestep +#hc keybind $Mod-Control-Right resize right +$resizestep + +# tags +tag_names=( I II III IV V VI VII VIII IX X ) +tag_keys=( {1..9} 0 ) + +# Selecting workspaces +#hc keybind Alt-Control-Left use_index -1 +#hc keybind Alt-Control-Right use_index +1 +hc keybind Alt-Control-h use_index -1 +hc keybind Alt-Control-l use_index +1 +hc rename default "${tag_names[0]}" || true +for i in ${!tag_names[@]} ; do + hc add "${tag_names[$i]}" + key="${tag_keys[$i]}" + if ! [ -z "$key" ] ; then + hc keybind "$Mod-$key" use_index "$i" + hc keybind "$Mod-Shift-$key" move_index "$i" + fi +done + +# cycle through tags +hc keybind $Mod-period use_index +1 --skip-visible +hc keybind $Mod-comma use_index -1 --skip-visible + +# layouting +hc keybind $Mod-r remove +hc keybind $Mod-space cycle_layout 1 +hc keybind $Mod-s floating toggle +hc keybind $Mod-f fullscreen toggle +hc keybind $Mod-p pseudotile toggle + +# mouse +hc mouseunbind --all +hc mousebind $Mod-Button1 move +hc mousebind $Mod-Button2 zoom +hc mousebind $Mod-Button3 resize + +# focus +hc keybind $Mod-BackSpace cycle_monitor +hc keybind $Mod-Tab cycle_all +1 +hc keybind $Mod-Shift-Tab cycle_all -1 +hc keybind $Mod-c cycle +hc keybind $Mod-i jumpto urgent +hc set focus_follows_mouse 1 + +# theme +hc attr theme.tiling.reset 1 +hc attr theme.floating.reset 1 +hc set frame_border_width 0 +hc set always_show_frame 0 +hc set frame_bg_transparent 1 +hc set frame_normal_opacity 0 +hc set frame_active_opacity 0 +hc set frame_transparent_width 0 +hc set frame_gap 0 + +hc attr theme.active.color $color_accent +hc attr theme.normal.color $color_bg +hc attr theme.urgent.color orange +hc attr theme.inner_width 1 +hc attr theme.inner_color $color_bg +hc attr theme.border_width 3 +hc attr theme.floating.border_width 4 +hc attr theme.floating.outer_width 1 +hc attr theme.floating.outer_color $color_bg +hc attr theme.active.inner_color $color_bg +hc attr theme.active.outer_color $color_bg +hc attr theme.background_color $color_bg + +hc set window_gap $window_p +hc set frame_padding 0 +hc set smart_window_surroundings 0 +hc set smart_frame_surroundings 1 +hc set mouse_recenter_gap 1 + +# rules +hc unrule -F +hc rule focus=on # normally focus new clients + +#hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on +hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on +hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off + +hc rule --class~'(.*[Ss]team.*)' --tag=IX --focus=off +hc rule --class~'(.*[Hh]exchat.*)' --tag=X --focus=off +hc rule --class~'(.*[Ss]potify.*)' --tag=X --focus=off +hc rule --class~'(.*[Ss]kype.*)' --tag=VIII --focus=off + +# unlock, just to be sure +hc unlock + +herbstclient set tree_style '╾│ ├└╼─┐' + +#Start panel in all monitors +start_panel() { + for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do + "$1" $monitor& + done +} + +# find the panel +panel=$dir/panel.sh +[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh +if pgrep panel.sh >> /dev/null +then + kill $(pgrep panel.sh) + start_panel $panel +else + start_panel $panel +fi + +pulseaudio --start + +$dir/start.sh "xautolock -time 5 -locker $dir/lock.sh" +$dir/start.sh "feh --bg-fill $wallpaper" +$dir/start.sh "compton --config $HOME/.compton" +$dir/start.sh "xrdb -load $HOME/.Xresources" +$dir/start.sh "xset +fp /usr/share/fonts/local" +$dir/start.sh "xset fp rehash" +#$dir/start.sh "$dir/notify.sh $dir/popup.sh" diff --git a/herbstluftwm/.config/herbstluftwm/dependencylist b/herbstluftwm/.config/herbstluftwm/dependencylist new file mode 100644 index 0000000..7d3babf --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/dependencylist @@ -0,0 +1,15 @@ +alsa-utils +bar-aint-recursive +bc +compton +dmenu2 +feh +i3lock +playerctl +pulseaudio +pulseaudio-alsa +scrot +sed +stlarch_font +wireless_tools +xautolock diff --git a/herbstluftwm/.config/herbstluftwm/lock.sh b/herbstluftwm/.config/herbstluftwm/lock.sh new file mode 100755 index 0000000..04c4638 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/lock.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +SCREENCAP="/tmp/lock.png" +scrot $SCREENCAP +convert -gaussian-blur "12x3" $SCREENCAP $SCREENCAP +i3lock -i $SCREENCAP +rm $SCREENCAP diff --git a/herbstluftwm/.config/herbstluftwm/notify.sh b/herbstluftwm/.config/herbstluftwm/notify.sh new file mode 100755 index 0000000..40c5330 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/notify.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +while true; do + + bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) + bat_stat=$(cat /sys/class/power_supply/BAT1/status) + + if [[ $bat_lvl -le 5 && $bat_stat == "Discharging" ]]; then + $1 -m "Battery level critical: $bat_lvl%%" -u "high" + elif [[ $bat_lvl -eq 10 && $bat_stat == "Discharging" ]]; then + $1 -m "Battery level low: $bat_lvl%%" + elif [[ $bat_lvl -eq 50 && $bat_stat == "Discharging" ]]; then + $1 -m "Battery level at $bat_lvl%%" + elif [[ $bat_lvl -eq 100 && $bat_stat == "Charging" ]]; then + $1 -m "Battery fully charged" + fi + + sleep 60; +done diff --git a/herbstluftwm/.config/herbstluftwm/panel.sh b/herbstluftwm/.config/herbstluftwm/panel.sh new file mode 100755 index 0000000..763c668 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/panel.sh @@ -0,0 +1,160 @@ +#!/bin/bash + +hc() { + "${herbstclient_command[@]:-herbstclient}" "$@" ; +} + +dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +source "$dir/theme.sh" +source "$dir/panel_indicators.sh" + +monitor=${1:-0} + +geometry=( $(herbstclient monitor_rect "$monitor") ) +if [ -z "$geometry" ] ;then + echo "Invalid monitor $monitor" + exit 1 +fi +# geometry has the format W H X Y +x=$(echo "${geometry[0]} + $window_p" | bc) +y=$(echo "${geometry[1]} + $window_p" | bc) +panel_width=$(echo "${geometry[2]} - (2 * $window_p)" | bc) +bar_opts="-g ${panel_width}x${panel_h}+${x}+${y} -f $font,$font_sec -u 2 -B $acolor_bg -F $acolor_fg" + +hc pad $monitor $(echo "$panel_h + $window_p" | bc) + +if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then + # mawk needs "-W interactive" to line-buffer stdout correctly + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593504 + uniq_linebuffered() { + awk -W interactive '$0 != l { print ; l=$0 ; fflush(); }' "$@" + } +else + # other awk versions (e.g. gawk) issue a warning with "-W interactive", so + # we don't want to use it there. + uniq_linebuffered() { + awk '$0 != l { print ; l=$0 ; fflush(); }' "$@" + } +fi + +{ + ### Event generator ### + # \t [...] + # e.g. + # date ^fg(#efefef)18:33^fg(#909090), 2013-10-^fg(#efefef)29 + while true ; do + music + volume + network + battery + clock + sleep 1 || break + done > >(uniq_linebuffered) & + childpid=$! + hc --idle + kill $childpid +} 2> /dev/null | { + + IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" + visible=true + date="" + volume="" + battery="" + net="" + windowtitle="" + while true ; do + separator="%{F$acolor_accent}|%{F-}" + # draw tags + for i in "${tags[@]}" ; do + case ${i:0:1} in + '#') + echo -n "%{U$acolor_accent+u}%{F$acolor_fg}" + ;; + '+') + echo -n "%{U$acolor_fg+u}%{F$acolor_fg}" + ;; + ':') + echo -n "%{F$acolor_fg}" + ;; + '!') + echo -n "%{B$acolor_accent}%{U$acolor_accent+u}%{F$acolor_bg}" + ;; + *) + echo -n "%{F$acolor_fg}" + ;; + esac + echo -n "%{A:tag,${i:1}:} ${i:1} %{A}%{F-}%{U-u}%{B-}" + done + echo -n "$separator%{F-}%{B-} " + echo -n "${windowtitle//^/^^}" + + #Right part of panel + right="$music$volume$net$battery$date " + echo -n "%{r}$right" + + #DO NOT REMOVE THIS ECHO + echo + + # wait for next event + IFS=$'\t' read -ra cmd || break + case "${cmd[0]}" in + tag*) + #echo "resetting tags" >&2 + IFS=$'\t' read -ra tags <<< "$(hc tag_status $monitor)" + ;; + music) + music="${cmd[@]:1}" + if [ $music == "off" ] ; then + music="" + else + music="$music $separator%{B-} " + fi + ;; + volume) + volume="${cmd[@]:1}" + if [ $volume == "off" ] ; then + volume="" + else + volume="$volume $separator%{B-} " + fi + ;; + net) + net="${cmd[@]:1}" + if [ $net = "off" ] ; then + net="" + else + net="$net $separator%{B-} " + fi + ;; + battery) + battery="${cmd[@]:1}" + if [ $battery == "off" ] ; then + battery="" + else + battery="$battery $separator%{B-} " + fi + ;; + date) + #echo "resetting date" >&2 + date="${cmd[@]:1}" + ;; + focus_changed|window_title_changed) + windowtitle="${cmd[@]:2}" + ;; + esac + done +} 2> /dev/null | bar $bar_opts | { + #Handle clickable areas + while read line; do + IFS=',' read -a c <<< $(echo $line) + case "${c[0]}" in + tag) + herbstclient use "${c[1]}" + echo "herbstclient use \"${c[1]}\"" + ;; + *) + echo "${c[0]}: not valid command" + ;; + esac + done +} diff --git a/herbstluftwm/.config/herbstluftwm/panel_indicators.sh b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh new file mode 100644 index 0000000..e450337 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh @@ -0,0 +1,127 @@ +#!/bin/bash +battery_icon=("\ue113" "\ue114" "\ue115" "\ue116" "\ue042") +network_icon=("\ue0f1" "\ue0f2" "\ue0f3" "\ue0af") +music_icon="\ue05c" + +music() +{ + # Music + player_status=$(playerctl status) + if [ $player_status = "Playing" ]; then + player_artist=$(playerctl metadata artist) + player_title=$(playerctl metadata title) + playing="$player_title - $player_artist" + + if [ "$current" != "$playing" ] ; then + current=$playing + scrolling=$current + elif [ ${#scrolling} -gt "24" ] ; then + scrolling=${scrolling:1} + else + scrolling=$current + fi + + echo -e "music\t$music_icon ${scrolling:0:24}" + else + echo -e "music\toff" + fi +} + +volume() +{ + # Volume + if pgrep pulseaudio >> /dev/null ; then + volumes=$(\ + amixer get Master | \ + grep "Front Right: Playback"\ + ) + vol=$(\ + echo $volumes | \ + sed "s/.*\[\([0-9]*\)%\].*/\1/"\ + ) + if [ -z $vol ] ; then + echo -e "volume\toff" + else + echo -e "volume\t%{F$acolor_fg}\ue05d $vol%%%{F-}" + fi + else + echo -e "volume\toff" + fi +} + +network() +{ + # Network + read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'` + if iwconfig $int1 >/dev/null 2>&1; then + wifi=$int1 + eth=$int2 + else + wifi=$int2 + eth=$int1 + fi + + ip link show $eth | grep 'state UP' >/dev/null && int=$eth || int=$wifi + + if [ $int == $wifi ] ; then + iwconfig=$(iwconfig $int) + ssid=$( + echo $iwconfig | \ + sed "s/.*ESSID:\(\".*\"\).*/\1/" | \ + sed "s/.*\(off\/any\).*/\"\1\"/" | \ + sed "s/.*\"\(.*\)\".*/\1/" + ) + + quality=$( \ + echo $iwconfig | \ + sed "s/^.*Link Quality=\([0-9]*\)\/\([0-9]*\) .*$/(\1*100)\/\2/" | \ + bc + ) + + if [ $ssid == "off/any" ] ; then + echo -e "net\toff" + elif [ $quality -lt 33 ] ; then + echo -e "net\t${network_icon[0]} $ssid" + elif [ $quality -lt 66 ] ; then + echo -e "net\t${network_icon[1]} $ssid" + else + echo -e "net\t${network_icon[2]} $ssid" + fi + + elif [ $int == $eth ] ; then + echo -e "net\t${network_icon[3]} ethernet" + else + echo -e "net\toff" + fi +} + +battery() +{ + # Battery + if $(test -e /sys/class/power_supply/BAT1) ; then + + bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) + bat_state=$(cat /sys/class/power_supply/BAT1/status) + + if [ $bat_state == "Charging" ] ; then + bat_status="${battery_icon[4]}" + elif [ $bat_lvl -lt 10 ] ; then + bat_status="${F$acolor_accent}${battery_icon[0]}${F-}" + elif [ $bat_ -lt 33 ] ; then + bat_status="${battery_icon[1]}" + elif [ $bat_lvl -lt 66 ] ; then + bat_status="${battery_icon[2]}" + else + bat_status="${battery_icon[3]}" + fi + + echo -e "battery\t$bat_status $bat_lvl%%%{F-}" + else + echo -e "battery\toff" + fi +} + +clock() +{ + echo -e $(date +$"date\t%{F$acolor_fg}%H:%M:%S %{F$acolor_fg}(%d-%m-%Y)%{F-}") +} diff --git a/herbstluftwm/.config/herbstluftwm/poligons.png b/herbstluftwm/.config/herbstluftwm/poligons.png new file mode 100644 index 0000000..e5c7cda Binary files /dev/null and b/herbstluftwm/.config/herbstluftwm/poligons.png differ diff --git a/herbstluftwm/.config/herbstluftwm/popup.sh b/herbstluftwm/.config/herbstluftwm/popup.sh new file mode 100755 index 0000000..eda37f5 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/popup.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +help () { + echo -e "Usage: popup.sh [OPTIONS]" + echo -e "Spawns a popup for a certain amount of time" + echo -e "" + echo -e "Options:" + echo -e " -m MESSAGE\t\tSpecifies message to be displayed" + echo -e " -t TIMEOUT\t\tAmount of time in seconds the popup is displayed" + echo -e " -u LEVEL\t\tUrgency level (info or high)" +} + +dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +source "$dir/theme.sh" + +timeout=10 +message="" +urgency="info" + +while getopts ":m:t:x:y:w:h:u:" opt; do + case $opt in + m) message=$OPTARG ;; + t) timeout=$OPTARG ;; + u) urgency=$OPTARG ;; + esac +done + +if test ! $message; then + help +else + + bar_opts="-f $font,$font_sec -B $acolor_bg -F $acolor_fg -g ${popup_width}x${height}+${popup_x}+${popup_y} -u 2" + + t=$(date +%T) + + if [ $urgency == "info" ]; then + prefix="Info:" + elif [ $urgency == "high" ]; then + prefix="!!WARNING:" + fi + + { + echo "%{F$acolor_accent} $prefix %{F$acolor_fg}$message %{F$acolor_fg}($t)%{F-}" + sleep $timeout + } | bar $bar_opts +fi diff --git a/herbstluftwm/.config/herbstluftwm/start.sh b/herbstluftwm/.config/herbstluftwm/start.sh new file mode 100755 index 0000000..f10fca6 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +opts=($@) + +program=$(echo ${opts[0]} | sed 's/^.*\/\(.*\)/\1/') + +if pgrep $program >> /dev/null +then + killall $program + ${opts[@]} & +else + ${opts[@]} & +fi diff --git a/herbstluftwm/.config/herbstluftwm/theme.sh b/herbstluftwm/.config/herbstluftwm/theme.sh new file mode 100644 index 0000000..34e22a7 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/theme.sh @@ -0,0 +1,33 @@ +# Get color from ~/.Xresources +get_x_color() { + xresources=$(cat ~/.Xresources) + color=$(echo $xresources | sed "s/.*\*color$1: \(#[0-9A-Fa-f]*\).*/\1/") + echo $color +} + +# Add alpha channel to a hexadecimal color +add_alpha_channel(){ + echo "$1" | \ + sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" +} + +# Wallpaper +wallpaper="$HOME/.config/herbstluftwm/poligons.png" + +# Padding +window_p=20 + +# Panel +panel_h=24 +font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*" +font_sec="-*-stlarch-medium-*-*-*-10-*-*-*-*-*-*-*" + +# Colors +color_fg=$(get_x_color 15) +color_accent=$(get_x_color 5) +color_bg=$(get_x_color 0) + +# Alpha Colors for use with bar +acolor_fg=$(add_alpha_channel $color_fg) +acolor_accent=$(add_alpha_channel $color_accent) +acolor_bg=$(add_alpha_channel $color_bg) diff --git a/liquidprompt/.liquidpromptrc b/liquidprompt/.liquidpromptrc new file mode 100644 index 0000000..57414d5 --- /dev/null +++ b/liquidprompt/.liquidpromptrc @@ -0,0 +1,143 @@ + +#################################### +# LIQUID PROMPT CONFIGURATION FILE # +#################################### + +# If you want to use different themes and features, +# you can load the corresponding files here: +#source ~/code/liquidprompt/nojhan.theme + +LP_PS1_FILE="$HOME/.lp_ps1" + +############# +# BEHAVIOUR # +############# + +# Maximal value under which the battery level is displayed +# Recommended value is 75 +LP_BATTERY_THRESHOLD=75 + +# Minimal value after which the load average is displayed +# Recommended value is 60 +LP_LOAD_THRESHOLD=60 + +# Minimal value after which the temperature is displayed (in celsius degrees) +# Recommended value is 60 +LP_TEMP_THRESHOLD=60 + +# The maximum percentage of the screen width used to display the path +# Recommended value is 35 +LP_PATH_LENGTH=35 + +# How many directories to keep at the beginning of a shortened path +# Recommended value is 2 +LP_PATH_KEEP=2 + +# Do you want to display the hostname, even if not connected through network? +# Defaults to 0 (do not display hostname when localy connected) +# set to 1 if you want to always see the hostname +LP_HOSTNAME_ALWAYS=1 + +# Do you want to display the user, even if he is the same than the logged one? +# Defaults to 1 (always display the user) +# set to 0 if you want to hide the logged user (it will always display different users) +LP_USER_ALWAYS=1 + +# Do you want to display the percentages of load/batteries along with their +# corresponding marks? Set to 0 to only print the colored marks. +# Defaults to 1 (display percentages) +LP_PERCENTS_ALWAYS=1 + +# Do you want to use the permissions feature ? +# Recommended value is 1 +LP_ENABLE_PERM=1 + +# Do you want to use the shorten path feature ? +# Recommended value is 1 +LP_ENABLE_SHORTEN_PATH=1 + +# Do you want to use the proxy detection feature ? +# Recommended value is 1 +LP_ENABLE_PROXY=1 + +# Do you want to use the jobs feature ? +# Recommended value is 1 +LP_ENABLE_JOBS=1 + +# Do you want to use the load feature ? +# Recommended value is 1 +LP_ENABLE_LOAD=1 + +# Do you want to use the batt feature ? +# Recommended value is 1 +LP_ENABLE_BATT=1 + +# Do you want to use vcs features with root account +# Recommended value is 0 +LP_ENABLE_VCS_ROOT=0 + +# Do you want to use the git special features ? +# Recommended value is 1 +LP_ENABLE_GIT=1 + +# Do you want to use the svn special features ? +# Recommended value is 1 +LP_ENABLE_SVN=1 + +# Do you want to use the mercurial special features ? +# Recommended value is 1 +LP_ENABLE_HG=1 + +# Do you want to use the fossil special features ? +# Recommended value is 1 +LP_ENABLE_FOSSIL=1 + +# Do you want to use the bzr special features ? +# Recommanded value is 1 +LP_ENABLE_BZR=1 + +# Show time of the last prompt display +# Recommended value is 0 +LP_ENABLE_TIME=1 + +# Show runtime of the last command if over LP_RUNTIME_THRESHOLD +# Recommended value is 0 +LP_ENABLE_RUNTIME=0 + +# Minimal runtime to be displayed +# Recommended value is 2 +LP_RUNTIME_THRESHOLD=2 + +# Display the virtualenv that is currently activated, if any +# Recommended value is 1 +LP_ENABLE_VIRTUALENV=1 + +# Show average system temperature +LP_ENABLE_TEMP=0 + +# When showing time, use an analog clock instead of numeric values. +# The analog clock is "accurate" to the nearest half hour. +# You must have a unicode-capable terminal and a font with the "CLOCK" +# characters. +# Recommended value is 0 +LP_TIME_ANALOG=0 + +# Use the liquid prompt as the title of the terminal window +# The content is not customizable, the implementation is very basic, +# and this may not work properly on exotic terminals, thus the +# recommended value is +# See LP_TITLE_OPEN and LP_TITLE_CLOSE to change escape characters to adapt this +# feature to your specific terminal. +LP_ENABLE_TITLE=0 + +# Enable Title for screen and byobu +LP_ENABLE_SCREEN_TITLE=0 + +# Use differents colors for differents hosts you SSH in +LP_ENABLE_SSH_COLORS=0 + +# Specify a list of complete and colon (":") separated paths in which, all vcs +# will be disabled +LP_DISABLED_VCS_PATH="" + +# vim: set et sts=4 sw=4 tw=120 ft=sh: diff --git a/liquidprompt/.lp_ps1 b/liquidprompt/.lp_ps1 new file mode 100644 index 0000000..93987bb --- /dev/null +++ b/liquidprompt/.lp_ps1 @@ -0,0 +1,30 @@ + +####################################### +# LIQUID PROMPT DEFAULT TEMPLATE FILE # +####################################### + +# Available features: +# LP_BATT battery +# LP_LOAD load +# LP_JOBS screen sessions/running jobs/suspended jobs +# LP_USER user +# LP_HOST hostname +# LP_PERM a colon ":" +# LP_PWD current working directory +# LP_PROXY HTTP proxy +# LP_VCS the content of the current repository +# LP_ERR last error code +# LP_MARK prompt mark +# LP_TIME current time +# LP_RUNTIME runtime of last command +# LP_PS1_PREFIX user-defined general-purpose prefix (default set a generic prompt as the window title) + +# Remember that most features come with their corresponding colors, +# see the README. + +LP_PS1="[\d][\t]\u on \h\n\w${LP_VCS} ${LP_MARK}" + +LP_TITLE=$(_lp_title $PS1) +PS1="${LP_TITLE}${PS1}" + +# vim: set et sts=4 sw=4 tw=120 ft=sh: diff --git a/liquidpromptrc b/liquidpromptrc deleted file mode 100644 index 57414d5..0000000 --- a/liquidpromptrc +++ /dev/null @@ -1,143 +0,0 @@ - -#################################### -# LIQUID PROMPT CONFIGURATION FILE # -#################################### - -# If you want to use different themes and features, -# you can load the corresponding files here: -#source ~/code/liquidprompt/nojhan.theme - -LP_PS1_FILE="$HOME/.lp_ps1" - -############# -# BEHAVIOUR # -############# - -# Maximal value under which the battery level is displayed -# Recommended value is 75 -LP_BATTERY_THRESHOLD=75 - -# Minimal value after which the load average is displayed -# Recommended value is 60 -LP_LOAD_THRESHOLD=60 - -# Minimal value after which the temperature is displayed (in celsius degrees) -# Recommended value is 60 -LP_TEMP_THRESHOLD=60 - -# The maximum percentage of the screen width used to display the path -# Recommended value is 35 -LP_PATH_LENGTH=35 - -# How many directories to keep at the beginning of a shortened path -# Recommended value is 2 -LP_PATH_KEEP=2 - -# Do you want to display the hostname, even if not connected through network? -# Defaults to 0 (do not display hostname when localy connected) -# set to 1 if you want to always see the hostname -LP_HOSTNAME_ALWAYS=1 - -# Do you want to display the user, even if he is the same than the logged one? -# Defaults to 1 (always display the user) -# set to 0 if you want to hide the logged user (it will always display different users) -LP_USER_ALWAYS=1 - -# Do you want to display the percentages of load/batteries along with their -# corresponding marks? Set to 0 to only print the colored marks. -# Defaults to 1 (display percentages) -LP_PERCENTS_ALWAYS=1 - -# Do you want to use the permissions feature ? -# Recommended value is 1 -LP_ENABLE_PERM=1 - -# Do you want to use the shorten path feature ? -# Recommended value is 1 -LP_ENABLE_SHORTEN_PATH=1 - -# Do you want to use the proxy detection feature ? -# Recommended value is 1 -LP_ENABLE_PROXY=1 - -# Do you want to use the jobs feature ? -# Recommended value is 1 -LP_ENABLE_JOBS=1 - -# Do you want to use the load feature ? -# Recommended value is 1 -LP_ENABLE_LOAD=1 - -# Do you want to use the batt feature ? -# Recommended value is 1 -LP_ENABLE_BATT=1 - -# Do you want to use vcs features with root account -# Recommended value is 0 -LP_ENABLE_VCS_ROOT=0 - -# Do you want to use the git special features ? -# Recommended value is 1 -LP_ENABLE_GIT=1 - -# Do you want to use the svn special features ? -# Recommended value is 1 -LP_ENABLE_SVN=1 - -# Do you want to use the mercurial special features ? -# Recommended value is 1 -LP_ENABLE_HG=1 - -# Do you want to use the fossil special features ? -# Recommended value is 1 -LP_ENABLE_FOSSIL=1 - -# Do you want to use the bzr special features ? -# Recommanded value is 1 -LP_ENABLE_BZR=1 - -# Show time of the last prompt display -# Recommended value is 0 -LP_ENABLE_TIME=1 - -# Show runtime of the last command if over LP_RUNTIME_THRESHOLD -# Recommended value is 0 -LP_ENABLE_RUNTIME=0 - -# Minimal runtime to be displayed -# Recommended value is 2 -LP_RUNTIME_THRESHOLD=2 - -# Display the virtualenv that is currently activated, if any -# Recommended value is 1 -LP_ENABLE_VIRTUALENV=1 - -# Show average system temperature -LP_ENABLE_TEMP=0 - -# When showing time, use an analog clock instead of numeric values. -# The analog clock is "accurate" to the nearest half hour. -# You must have a unicode-capable terminal and a font with the "CLOCK" -# characters. -# Recommended value is 0 -LP_TIME_ANALOG=0 - -# Use the liquid prompt as the title of the terminal window -# The content is not customizable, the implementation is very basic, -# and this may not work properly on exotic terminals, thus the -# recommended value is -# See LP_TITLE_OPEN and LP_TITLE_CLOSE to change escape characters to adapt this -# feature to your specific terminal. -LP_ENABLE_TITLE=0 - -# Enable Title for screen and byobu -LP_ENABLE_SCREEN_TITLE=0 - -# Use differents colors for differents hosts you SSH in -LP_ENABLE_SSH_COLORS=0 - -# Specify a list of complete and colon (":") separated paths in which, all vcs -# will be disabled -LP_DISABLED_VCS_PATH="" - -# vim: set et sts=4 sw=4 tw=120 ft=sh: diff --git a/lp_ps1 b/lp_ps1 deleted file mode 100644 index 93987bb..0000000 --- a/lp_ps1 +++ /dev/null @@ -1,30 +0,0 @@ - -####################################### -# LIQUID PROMPT DEFAULT TEMPLATE FILE # -####################################### - -# Available features: -# LP_BATT battery -# LP_LOAD load -# LP_JOBS screen sessions/running jobs/suspended jobs -# LP_USER user -# LP_HOST hostname -# LP_PERM a colon ":" -# LP_PWD current working directory -# LP_PROXY HTTP proxy -# LP_VCS the content of the current repository -# LP_ERR last error code -# LP_MARK prompt mark -# LP_TIME current time -# LP_RUNTIME runtime of last command -# LP_PS1_PREFIX user-defined general-purpose prefix (default set a generic prompt as the window title) - -# Remember that most features come with their corresponding colors, -# see the README. - -LP_PS1="[\d][\t]\u on \h\n\w${LP_VCS} ${LP_MARK}" - -LP_TITLE=$(_lp_title $PS1) -PS1="${LP_TITLE}${PS1}" - -# vim: set et sts=4 sw=4 tw=120 ft=sh: diff --git a/redshift/.config/redshift.conf b/redshift/.config/redshift.conf new file mode 100644 index 0000000..2b88434 --- /dev/null +++ b/redshift/.config/redshift.conf @@ -0,0 +1,46 @@ +; Global settings for redshift +[redshift] +; Set the day and night screen temperatures +temp-day=6500 +temp-night=4200 + +; Enable/Disable a smooth transition between day and night +; 0 will cause a direct change from day to night screen temperature. +; 1 will gradually increase or decrease the screen temperature +transition=1 + +; Set the screen brightness. Default is 1.0 +;brightness=0.9 +; It is also possible to use different settings for day and night since version 1.8. +;brightness-day=0.7 +;brightness-night=0.4 +; Set the screen gamma (for all colors, or each color channel individually) +gamma=0.8 +;gamma=0.8:0.7:0.8 + +; Set the location-provider: 'geoclue', 'gnome-clock', 'manual' +; type 'redshift -l list' to see possible values +; The location provider settings are in a different section. +location-provider=manual + +; Set the adjustment-method: 'randr', 'vidmode' +; type 'redshift -m list' to see all possible values +; 'randr' is the preferred method, 'vidmode' is an older API +; but works in some cases when 'randr' does not. +; The adjustment method settings are in a different section. +adjustment-method=randr + +; Configuration of the location-provider: +; type 'redshift -l PROVIDER:help' to see the settings +; e.g. 'redshift -l manual:help' +[manual] +lat=52.6 +lon=5.1 + +; Configuration of the adjustment-method +; type 'redshift -m METHOD:help' to see the settings +; ex: 'redshift -m randr:help' +; In this example, randr is configured to adjust screen 1. +; Note that the numbering starts from 0, so this is actually the second screen. +[randr] +screen=0 diff --git a/themes/.themes/numix-no-title-max/index.theme b/themes/.themes/numix-no-title-max/index.theme new file mode 100644 index 0000000..553f572 --- /dev/null +++ b/themes/.themes/numix-no-title-max/index.theme @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=X-GNOME-Metatheme +Name=Numix - No title max +Comment=A modern flat theme +Encoding=UTF-8 + +[X-GNOME-Metatheme] +GtkTheme=Numix - No title max +MetacityTheme=Numix - No title max +ButtonLayout=:minimize diff --git a/themes/.themes/numix-no-title-max/metacity-1/metacity-theme-3.xml b/themes/.themes/numix-no-title-max/metacity-1/metacity-theme-3.xml new file mode 100644 index 0000000..264fb01 --- /dev/null +++ b/themes/.themes/numix-no-title-max/metacity-1/metacity-theme-3.xml @@ -0,0 +1,1589 @@ + + + + Numix + Satyajit Sahoo + GPL-3.0+ + 11 December 2013 + Numix Mutter Theme + + + + + + + + + + + + + + + + + + + + +