dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 2e58a51095a5167cc1d20c14f6ff1a93e3f5e2a0
parent 9bc150a4a17d38d0069856b907289abcad1f7f56
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date:   Wed,  4 Feb 2015 09:13:37 +0100

add custom i3status, test bspwm

Diffstat:
M.config/bspwm/bspwmrc | 86++++++++++++++++++++++++++++++-------------------------------------------------
M.config/bspwm/panel/panel | 150++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
M.config/bspwm/panel/panel_bar | 156++++++++++++++++++++++++++++++++++++-------------------------------------------
D.config/bspwm/panel/panel_battery | 65-----------------------------------------------------------------
M.config/bspwm/panel/panel_colors | 44++++++++++++++++++++++++--------------------
D.config/bspwm/panel/panel_conky | 10----------
D.config/bspwm/panel/panel_wifi | 33---------------------------------
M.config/sxhkd/sxhkdrc | 139++++++++++++++++++++-----------------------------------------------------------
M.i3/config | 3++-
M.xinitrc | 2+-
Abin/i3status-mpc.sh | 13+++++++++++++
11 files changed, 300 insertions(+), 401 deletions(-)

diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc @@ -1,58 +1,36 @@ #!/bin/bash +# +# BSPWM config file +# + +bspc config border_width 2 +bspc config window_gap 10 + +bspc monitor -d 1 2 3 4 5 + +bspc config top_padding 30 + +bspc config split_ratio 0.5 +bspc config gapless_monocle true +bspc config borderless_monocle true -# See more in `man bspwm` or on -# https://wiki.archlinux.org/index.php/Bspwm - - -FIRST_DESK_MAIN=i -REMAINING_DESKS_MAIN="ii iii iv" -FIRST_DESK_SECONDARY=v -REMAINING_DESKS_SECONDARY="vi vii viii" - -#MONITORS_ASSOCIATED=`bspc query -M | wc -l` -#if [[ -z `xrandr | grep " connected" | grep 'VGA\|DP-1'` ]]; then -HOSTNAME=`hostname` -if [[ "$HOSTNAME" == 'iddqd' ]]; then - bspc desktop ^1 -n $FIRST_DESK_SECONDARY - bspc config -m ^1 top_padding 14 - bspc monitor -a $REMAINING_DESKS_SECONDARY - - bspc monitor -f next - - bspc desktop Desktop2 -n $FIRST_DESK_MAIN - bspc monitor -a $REMAINING_DESKS_MAIN - bspc config -m ^2 top_padding 14 -else - bspc desktop ^1 -n $FIRST_DESK_MAIN - bspc monitor -a $REMAINING_DESKS_MAIN - bspc config top_padding 14 -fi - -# Visual options -bspc config border_width 2 -bspc config window_gap 12 -bspc config split_ratio 0.50 -bspc config borderless_monocle true -bspc config gapless_monocle true bspc config focus_follows_pointer true -bspc config normal_border_color "#504339" -bspc config active_border_color "#504339" -bspc config focused_border_color "#605655" -bspc config presel_border_color "#9a875f" -bspc config urgent_border_color "#504339" -bspc config normal_frame_opacity 0.0 -bspc config focused_frame_opacity 0.05 -bspc config rule_command "$(which rule_command)" - -# Placement rules -#bspc rule -a Gimp desktop=^8 follow=on floating=on -#bspc rule -a Chromium desktop=^2 -#bspc rule -a mplayer2 floating=on -#bspc rule -a Kupfer.py focus=on -#bspc rule -a Screenkey manage=off - -# Move focus to the primary monitor -bspc monitor -f primary - -/home/adc/.config/bspwm/panel/panel & +bspc config focused_border_color \#202020 +bspc config active_border_color \#202020 +bspc config normal_border_color \#202020 +bspc config presel_border_color \#202020 + +bspc config focused_locked_border_color \#a54242 +bspc config active_locked_border_color \#a54242 +bspc config normal_locked_border_color \#a54242 + +bspc config focused_sticky_border_color \#8c9440 +bspc config active_sticky_border_color \#8c9440 +bspc config normal_sticky_border_color \#8c9440 + +bspc config focused_private_border_color \#85678f +bspc config active_private_border_color \#85678f +bspc config normal_private_border_color \#85678f + +bspc config urgent_border_color \#de935f diff --git a/.config/bspwm/panel/panel b/.config/bspwm/panel/panel @@ -1,36 +1,132 @@ -#!/bin/sh +#!/bin/bash +# +# Bar Ain't Recursive panel +# by Ivan Sokolov +# -if [ $(pgrep -cx panel) -gt 1 ] ; then - printf "%s\n" "The panel is already running." >&2 - exit 1 -fi +WHITE=f8f8f8 +RED=a54242 +GREEN=8c9440 +BLACK=202020 +GRAY=404040 -trap 'trap - TERM; kill 0' INT TERM QUIT EXIT +function A { + echo -n "%{A:$2:}$1%{A}" +} -flavor=${1:-bar} +function B { + echo -n "%{B#ff$2}$1%{B-}" +} -[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO" -mkfifo "$PANEL_FIFO" +function F { + echo -n "%{F#ff$2}$1%{F-}" +} -bspc config top_padding $PANEL_HEIGHT +function o { + echo "%{+o}$1%{-o}" +} -bspc control --put-status +function u { + echo "%{+u}$1%{-u}" +} -bspc control --subscribe > "$PANEL_FIFO" & -xtitle -sf 'T%s' > "$PANEL_FIFO" & -#clock -sf 'S%Y-%m-%d %H:%M' > "$PANEL_FIFO" & -conky -c ~/.config/bspwm/panel/panel_conky > "$PANEL_FIFO" & +### -case "$flavor" in - bar) - cat "$PANEL_FIFO" | ~/.config/bspwm/panel/panel_bar | bar & - ;; - dzen2) - . ~/.config/bspwm/panel/panel_colors - FONT_FAMILY='DejaVu Sans' - FONT_SIZE=11 - cat "$PANEL_FIFO" | panel_dzen2 -f "$FONT_FAMILY" -s "$FONT_SIZE" | dzen2 -h $PANEL_HEIGHT -dock -ta l -title-name panel -fn "${FONT_FAMILY}:pixelsize=${FONT_SIZE}" -fg "$COLOR_FOREGROUND" -bg "$COLOR_BACKGROUND" & - ;; -esac +DIV=$(F '|' $GRAY) -wait +### + +network() { + ping -c 1 8.8.8.8 >/dev/null 2>&1 && echo -n $(F + $GREEN) || echo -n $(F - $RED) +} + +calendar() { + #DATE=$(date -u +%d/%m/%y) + DATE=$(date -u +%Y-%m-%y) + echo -n $(F $DATE $WHITE) +} + +clock() { + TIME=$(date -u +%H:%M:%S) + echo -n $(F $TIME $WHITE) +} + +volume() { + #VOLUME=$(pamixer --get-volume) + VOLUME=$(amixer get Master | grep '\[' | awk '{ print $5; }' | sed 's/\[//' | sed 's/%\]//') + VCOLOR=$WHITE + #if [[ $(pamixer --get-mute) -eq 'true' ]] + #then + # VCOLOR=$WHITE + #else + # VCOLOR=$GRAY + #fi + #echo -n "$(A $(F $VOLUME $VCOLOR) volume)" + #echo -n "$(A $(F $VOLUME) volume)" + echo -n "v:$(A $VOLUME)" +} + +battery() { + BATTERY=$(acpi -b | awk '{gsub(/%,/,""); print $4}' | sed 's/%//g') + if [[ $BATTERY -gt 20 ]] + then + BCOLOR=$WHITE + else + BCOLOR=$RED + fi + echo -n b:$(F $BATTERY ff$BCOLOR) +} + +layout() { + #echo -n "$(A $(F $(xkb-switch) $WHITE) layout)" + echo -n "$(cat ~/.kbd-layout)" +} + +mpc_status() { + if [[ -n $(mpc | grep playing) ]] + then + echo -n "$(F "$(mpc current -f "[%title%]")" $WHITE) $DIV " + echo -n "$(F "$(mpc current -f "[%album%]")" $WHITE) $DIV " + echo -n "$(F "$(mpc current -f "[%artist%]")" $WHITE) " + else + echo -n '' + fi +} + +# echo -n "$(F "$(mpc current -f "[%title% $(F - $GRAY) %album% $(F - $GRAY) %artist%]|[%file%]")" $WHITE)" + +mpc_controls() { + echo -n '' +} + +while true +do + # Left + printf '%s' '%{l}' + # Desktops + for i in 1 2 3 4 5 + do + printf ' %s' "%{A:$i:}$(F \| $GRAY)$(F $i $WHITE)$(F \| $GRAY)%{A}" + done + + # Center + printf '%s' '%{c}' + printf '%s' "$(mpc_status)" + # printf '%s' "$(mpc_controls)" + + # Right + printf '%s' '%{r}' + printf ' %s' $(network) $DIV + printf ' %s' $(layout) $DIV + printf ' %s' $(volume) $DIV + printf ' %s' $(battery) $DIV + printf ' %s' $(clock) + printf ' %s \n' $(calendar) + + sleep 0.5s +done | bar \ #bar-aint-recursive \ + -F \#ff$WHITE \ + -B \#ff$BLACK \ + -g 1346x20+10+10 \ + | ~/.config/bspwm/spawner + #-f '-*-terminus-medium-r-normal-*-12-*-*-*-c-*-*-u' \ diff --git a/.config/bspwm/panel/panel_bar b/.config/bspwm/panel/panel_bar @@ -1,88 +1,74 @@ -#!/bin/sh +#! /bin/sh +# +# Example panel for LemonBoy's bar + +. ~/.config/bspwm/panel/panel_colors + +num_mon=$(bspc query -M | wc -l) while read -r line ; do - case $line in - S*) - # clock output - sys_infos="\\br\\f4${line#?}" - ;; - T*) - # xtitle output - title="\\br\\f4${line#?}" - ;; - W*) - # bspwm internal state - wm_infos="" - IFS=':' - set -- ${line#?} - while [ $# -gt 0 ] ; do - item=$1 - name=${item#?} - case $item in - #O*) - ## focused occupied desktop - #wm_infos="$wm_infos \\u3\\br\\fr${name}\\ur" - #;; - #F*) - ## focused free desktop - #wm_infos="$wm_infos \\u4\\br\\f7${name}\\ur" - #;; - #U*) - ## focused urgent desktop - #wm_infos="$wm_infos \\u9\\br\\fr${name}\\ur" - #;; - #o*) - ## occupied desktop - #wm_infos="$wm_infos \\br\\fr${name}" - #;; - #f*) - ## free desktop - #wm_infos="$wm_infos \\br\\f7${name}" - #;; - #u*) - ## urgent desktop - #wm_infos="$wm_infos \\b1\\fr${name}" - #;; - #L*) - ## layout - #layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/') - #wm_infos="$wm_infos \\br\\f2$layout" - #;; - [OFU]*) - # active desktop - wm_infos="$wm_infos\\f9 • \\fr\\br" - ;; - o*) - # inactive but occupied desktop - wm_infos="$wm_infos\\f8 • \\fr" - ;; - f*) - # inactive desktop - wm_infos="$wm_infos\\f8 ○ \\fr" - ;; - u*) - # urgent desktop - wm_infos="$wm_infos\\f3•\\fr " - ;; - L*) - # layout -# layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/') - layout="" - wm_infos="$wm_infos \\b4\\f0$layout\\br\\fr" - ;; - [Mm]*) - # monitor - if [ "$name" = "DVI-D-0" ] ; then - #if [ "$name" = "DP-1" ] ; then - wm_infos="$wm_infos \\s1" # move the main information to the 2nd monitor - fi - ;; - esac - shift - done - ;; - esac - #printf "%s\n" "\\l $wm_infos \\c $title \\r $sys_infos " - #printf "%s\n" "\\l $wm_infos $title \\r $sys_infos " - printf "%s\n" "\\l $title \\c $wm_infos \\r $sys_infos " + case $line in + S*) + # clock output + sys_infos="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${line#?} %{B-}%{F-}" + ;; + T*) + # xtitle output + title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG} ${line#?} %{B-}%{F-}" + ;; + W*) + # bspwm internal state + wm_infos="" + IFS=':' + set -- ${line#?} + while [ $# -gt 0 ] ; do + item=$1 + name=${item#?} + case $item in + M*) + # active monitor + if [ $num_mon -gt 1 ] ; then + wm_infos="$wm_infos %{F$COLOR_ACTIVE_MONITOR_FG}%{B$COLOR_ACTIVE_MONITOR_BG} ${name} %{B-}%{F-} " + fi + ;; + m*) + # inactive monitor + if [ $num_mon -gt 1 ] ; then + wm_infos="$wm_infos %{F$COLOR_INACTIVE_MONITOR_FG}%{B$COLOR_INACTIVE_MONITOR_BG} ${name} %{B-}%{F-} " + fi + ;; + O*) + # focused occupied desktop + wm_infos="${wm_infos}%{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u} ${name} %{-u}%{B-}%{F-}" + ;; + F*) + # focused free desktop + wm_infos="${wm_infos}%{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_FOREGROUND}%{+u} ${name} %{-u}%{B-}%{F-}" + ;; + U*) + # focused urgent desktop + wm_infos="${wm_infos}%{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_FOREGROUND}%{+u} ${name} %{-u}%{B-}%{F-}" + ;; + o*) + # occupied desktop + wm_infos="${wm_infos}%{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG} ${name} %{B-}%{F-}" + ;; + f*) + # free desktop + wm_infos="${wm_infos}%{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG} ${name} %{B-}%{F-}" + ;; + u*) + # urgent desktop + wm_infos="${wm_infos}%{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG} ${name} %{B-}%{F-}" + ;; + L*) + # layout + wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG} ${name} %{B-}%{F-}" + ;; + esac + shift + done + ;; + esac + printf "%s\n" "%{l}${wm_infos}%{c}${title}%{r}${sys_infos}" done diff --git a/.config/bspwm/panel/panel_battery b/.config/bspwm/panel/panel_battery @@ -1,65 +0,0 @@ -#!/bin/bash - -# BATTERY ICONS: -#      - -BAT=`acpi -b | awk '{gsub(/%,/,""); print $4}' | sed 's/%//g'` -STATUS=`acpi -b | awk '{gsub(/,/,""); print $3}'` -REMAINING=`acpi -b | awk '{print $5}'` - -# Set Icon -icon="" -if [[ $STATUS != "Discharging" ]]; then - icon="" -elif [[ $BAT -lt 10 ]]; then - icon="" -elif [[ $BAT -lt 40 ]]; then - icon="" -elif [[ $BAT -lt 70 ]]; then - icon="" -else - icon="" -fi - -bar="" -case $BAT in - 100) - #bar="" - bar="—————————" - ;; - [0-5]) - bar="\f8—————————" - ;; - [5-9]) - bar="\f3—\f8————————" - ;; - [1-2]*) - bar="——\f8———————" - ;; - 3*) - bar="———\f8——————" - ;; - 4*) - bar="————\f8—————" - ;; - 5*) - bar="—————\f8————" - ;; - 6*) - bar="——————\f8———" - ;; - 7*) - bar="———————\f8——" - ;; - 8*) - bar="————————\f8—" - ;; - *) - bar="—————————" - ;; -esac - -# Create Bar - -#echo "$icon \f9$bar" -echo "$REMAINING \f9$bar" diff --git a/.config/bspwm/panel/panel_colors b/.config/bspwm/panel/panel_colors @@ -1,20 +1,24 @@ -COLOR_FOREGROUND='#A3A6AB' -COLOR_BACKGROUND='#34322E' -COLOR_FOCUSED_OCCUPIED_FG='#F6F9FF' -COLOR_FOCUSED_OCCUPIED_BG='#5C5955' -COLOR_FOCUSED_FREE_FG='#F6F9FF' -COLOR_FOCUSED_FREE_BG='#6D561C' -COLOR_FOCUSED_URGENT_FG='#34322E' -COLOR_FOCUSED_URGENT_BG='#F9A299' -COLOR_OCCUPIED_FG='#A3A6AB' -COLOR_OCCUPIED_BG='#34322E' -COLOR_FREE_FG='#6F7277' -COLOR_FREE_BG='#34322E' -COLOR_URGENT_FG='#F9A299' -COLOR_URGENT_BG='#34322E' -COLOR_LAYOUT_FG='#A3A6AB' -COLOR_LAYOUT_BG='#34322E' -COLOR_TITLE_FG='#A3A6AB' -COLOR_TITLE_BG='#34322E' -COLOR_STATUS_FG='#A3A6AB' -COLOR_STATUS_BG='#34322E' +COLOR_FOREGROUND='#FFA3A6AB' +COLOR_BACKGROUND='#FF34322E' +COLOR_ACTIVE_MONITOR_FG='#FF34322E' +COLOR_ACTIVE_MONITOR_BG='#FF58C5F1' +COLOR_INACTIVE_MONITOR_FG='#FF58C5F1' +COLOR_INACTIVE_MONITOR_BG='#FF34322E' +COLOR_FOCUSED_OCCUPIED_FG='#FFF6F9FF' +COLOR_FOCUSED_OCCUPIED_BG='#FF5C5955' +COLOR_FOCUSED_FREE_FG='#FFF6F9FF' +COLOR_FOCUSED_FREE_BG='#FF6D561C' +COLOR_FOCUSED_URGENT_FG='#FF34322E' +COLOR_FOCUSED_URGENT_BG='#FFF9A299' +COLOR_OCCUPIED_FG='#FFA3A6AB' +COLOR_OCCUPIED_BG='#FF34322E' +COLOR_FREE_FG='#FF6F7277' +COLOR_FREE_BG='#FF34322E' +COLOR_URGENT_FG='#FFF9A299' +COLOR_URGENT_BG='#FF34322E' +COLOR_LAYOUT_FG='#FFA3A6AB' +COLOR_LAYOUT_BG='#FF34322E' +COLOR_TITLE_FG='#FFA3A6AB' +COLOR_TITLE_BG='#FF34322E' +COLOR_STATUS_FG='#FFA3A6AB' +COLOR_STATUS_BG='#FF34322E' diff --git a/.config/bspwm/panel/panel_conky b/.config/bspwm/panel/panel_conky @@ -1,10 +0,0 @@ -short_units yes -background yes -out_to_console yes -out_to_x no -# Update interval in seconds -update_interval 3 -update_interval_on_battery 3 - -TEXT -S \f8${downspeed wlan0}/${upspeed wlan0} \f8${execi 5 ~/.config/bspwm/panel/panel_wifi} \f9${wireless_essid wlan0} \f8${execi 10 ~/.config/bspwm/panel/panel_battery} ${cpu}% \fr${time %Y-%m-%d %H:%M } diff --git a/.config/bspwm/panel/panel_wifi b/.config/bspwm/panel/panel_wifi @@ -1,33 +0,0 @@ -#!/bin/bash - -# WIFI ICONS -#  - -QUAL=`iwconfig wlan0 | grep 'Link Quality=' | awk '{gsub(/[=/]/," "); print $3}'` -MAX=`iwconfig wlan0 | grep 'Link Quality=' | awk '{gsub(/[=/]/," "); print $4}'` -PERC=`echo $QUAL*100/$MAX | bc` - -icon="" -case $PERC in - [0-4]) - icon="" - ;; - [4-9]) - icon="" - ;; - [2-3]*) - icon="" - ;; - [4-5]*) - icon="" - ;; - [6-7]*) - icon="" - ;; - *) - icon="" - ;; -esac - -#echo "$icon" -echo "$PERC" diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc @@ -1,99 +1,41 @@ +#!/bin/bash + # -# bspwm hotkeys +# BSPWM hotkeys # -# See `man bspwm` for details - -# Kill panel and quit Bspwm -super + alt + Escape - pkill -x panel; bspc quit - -# Close the selected window -super + w - bspc window --close -# Select next layout (windowed/full) -super + t - bspc desktop --layout next +# Quit +#super + alt + Escape +super + shift + e + pamixer --get-volume > ~/.volume \ + pkill panel -# Adjust ratios so that all windows occupy the same area +# Balance tree super + b - bspc desktop --balance - -# Place the current window in floating (s) or full screen (f) mode -super + {s,f} - bspc window --toggle {floating,fullscreen} - -# Select the last window (`) or desktop (Tab) -super + {grave,Tab} - bspc {window,desktop} --focus last - -# Swap the current and last selected windows (') -super + apostrophe - bspc window --swap last + bspc desktop -B -# Enable/disable recording of window focus history? -super + {o,i} - bspc control --record-history off; \ - bspc window {older,newer} -f; \ - bspc control --record-history on +# Change windows params +super + {g,f,s,l} + bspc window -t {floating,fullscreen,sticky,locked} -# Transplant the selected window to the last manually focused window -super + y - bspc window --to-window last.manual +# Close window +alt + w + bspc window -c -# Swap the selected window with the biggest window -super + m - bspc window --swap biggest +# Desktops +super + {1-5} + bspc desktop -f ^{1-5} # Move focus: super+h,j,k,l # Swap windows: super+shift+h,j,k,l super + {_,shift + }{h,j,k,l} bspc window --{focus,swap} {left,down,up,right} -# Shift focus to the next (super+c) or previous (super+shift+c) window -super + {_,shift + }c - bspc window --focus {next,prev} - -# Circulate the leaves of the tree of the selected desktop -super + {comma,period} - bspc desktop --circulate {backward,forward} - -# Switch focus to next (super + ]) or previous (super + [) desktop -super + bracket{left,right} - bspc desktop --focus {prev,next} - -# Preselect the splitting area of the selected window -super + ctrl + {h,j,k,l} - bspc window --presel {left,down,up,right} - -# Cancel the preselect above (super + ctrl + space) -super + ctrl + {_,shift + }space - bspc {window --presel cancel,desktop -c} - -# Change the window splitting ratio incrementally -super + alt + {h,j,k,l} - bspc window --edge {left -10,down +10,up -10,right +10} -# Change the window splitting ratio incrementally -super + alt + shift + {h,j,k,l} - bspc window --edge {right -10,up +10,down -10,left +10} - -# Set the window splitting ratio -super + ctrl + {1-9} - bspc window --ratio 0.{1-9} - -# Move focus to desktop (super + number) or move window to desktop (super + -# shift+ + number) -super + {_,shift + }{1-9,0} - bspc {desktop --focus,window --to-desktop} ^{1-9,10} - -# Set focus with mouse click +# Mouse ~button1 bspc pointer -g focus -# Move windows with super + left click -# Resize windows along edge with super + middle click -# Resize windows along corner with super + right click super + button{1-3} bspc pointer -g {move,resize_side,resize_corner} @@ -104,37 +46,24 @@ super + @button{1-3} bspc pointer -u # -# wm independent hotkeys +# Non WM hotkeys # +# URxvt super + Return + urxvt -e tmux +super + shift + Return urxvt -super + space - dmenu_run -nb \#222222 -nf \#888888 -sb \#333333 -sf \#ffffff - -super + shift + f - firefox - -super + shift + t - tor-browser.sh +# XTerm +super + alt + Return + xterm -super + z - /home/adc/bin/zzz - -# mpd control -super + shift + p - mpc toggle - -super + shift + b - mpc prev - -super + shift + n - mpc next - -super + shift + s - mpc stop +# dmenu +super + space + dmenu_wrapper -# make sxhkd reload its configuration files: -super + Escape - pkill -USR1 -x sxhkd +# Reload SXHKD +super + r + pkill -USR1 -x sxhkd \ + ~/.config/bspwm/bspwmrc diff --git a/.i3/config b/.i3/config @@ -233,7 +233,8 @@ bindsym $mod+r mode "resize" # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) bar { - status_command i3status --config ~/.i3/status + #status_command i3status --config ~/.i3/status + status_command ~/bin/i3status-mpc.sh #status_command conky -c ~/.i3/conkyrc #position top position bottom diff --git a/.xinitrc b/.xinitrc @@ -27,7 +27,7 @@ $HOME/bin/wallpaper.sh #unclutter -grab -noevents -root & # Add shadows -#compton & +compton & # Keyboard layout #setxkbmap dk diff --git a/bin/i3status-mpc.sh b/bin/i3status-mpc.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +i3status --config ~/.i3/status | (read line && echo $line && read line && echo $line && while : +do + read line + dat="" + if [[ -n $(mpc | grep playing) ]] + then + dat="$(mpc current -f '[%artist%]'): $(mpc current -f '[%title%]')" + fi + dat="[{ \"full_text\": \"${dat}\" }," + echo "${line/[/$dat}" || exit 1 +done)