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 c82b4ba4b0e9492ebdfc112cdf9e5586a93cfda5
parent 9dcf2d4c75a83a82c4b13a718619270f723bbbbc
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date:   Mon,  3 Feb 2014 15:46:35 +0100

Added xclock colors

Diffstat:
M.Xresources | 7+++++++
A.config/bspwm/bspwmrc | 49+++++++++++++++++++++++++++++++++++++++++++++++++
A.config/sxhkd/sxhkdrc | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.xbindkeysrc | 4++--
M.xinitrc | 16++++++++++++----
Abin/install_bspwm.sh | 33+++++++++++++++++++++++++++++++++
Abin/panel | 35+++++++++++++++++++++++++++++++++++
Abin/panel_bar | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/panel_colors | 20++++++++++++++++++++
Mcreate_symlinks.sh | 2+-
10 files changed, 361 insertions(+), 7 deletions(-)

diff --git a/.Xresources b/.Xresources @@ -115,3 +115,10 @@ xscreensaver.passwd.thermometer.background: #000000 xscreensaver.passwd.thermometer.width: 8 !datestamp format--see the strftime(3) manual page for details xscreensaver.dateFormat: %I:%M%P %a %b %d, %Y + +xclock*background: #181512 +xclock*majorColor: #9a875f +xclock*minorColor: #9a875f +xclock*minuteColor: #9a875f +xclock*hourColor: #9a875f +xclock*secondColor: #9a875f diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc @@ -0,0 +1,49 @@ +#!/bin/sh + +# 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=I +REMAINING_DESKS_SECONDARY="II III IV" + +#MONITORS_ASSOCIATED=`bspc query -M | wc -l` +if [[ -z `xrandr | grep " connected" | grep 'VGA\|DP-1'` ]]; then + #No monitor connected + bspc desktop ^1 -n $FIRST_DESK_MAIN + bspc monitor -a $REMAINING_DESKS_MAIN + bspc config top_padding 14 +else + 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 +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 + +# 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/bin/panel > ~/.panel.log 2> ~/.panel.err & +#/home/adc/bin/panel dzen2 > ~/.panel.log 2> ~/.panel.err & diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc @@ -0,0 +1,137 @@ +# +# bspwm hotkeys +# +# See `man bspwm` for details + +# Quit Bspwm +super + alt + Escape + bspc quit + +# Close the selected window +super + w + bspc window --close + +# Select next layout (windowed/full) +super + t + bspc desktop --layout next + +# Adjust ratios so that all windows occupy the same area +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 + +# 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 + +# Transplant the selected window to the last manually focused window +super + y + bspc window --to-window last.manual + +# Swap the selected window with the biggest window +super + m + bspc window --swap biggest + +# 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 +~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} + +super + !button{1-3} + bspc pointer -t %i %i + +super + @button{1-3} + bspc pointer -u + +# +# wm independent hotkeys +# + +super + Return + urxvt + +super + space + dmenu_run -nb \#222222 -nf \#888888 -sb \#333333 -sf \#ffffff + +super + shift + f + firefox + +super + shift + t + tor-browser.sh + +# mpd control +super + shift + p + mpc toggle + +super + shift + b + mpc prev + +super + shift + n + mpc next + +super + shift + s + mpc stop + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd diff --git a/.xbindkeysrc b/.xbindkeysrc @@ -27,8 +27,8 @@ "mpc next" XF86AudioNext -"keyboard-layout-switch.sh" - Mod1+Mod4 + l +#"keyboard-layout-switch.sh" +# Mod1+Mod4 + l "amixer set Master toggle" XF86AudioMute diff --git a/.xinitrc b/.xinitrc @@ -8,7 +8,8 @@ xset -b # Keyboard layout with caps as ctrl #setxkbmap dk -setxkbmap us -option ctrl:nocaps +#setxkbmap us -option ctrl:nocaps +setxkbmap us #setxkbmap dvorak -option ctrl:nocaps # Read .xbindkeysrc for special key-bindings @@ -67,7 +68,14 @@ synclient TapButton1=1 TapButton2=2 TapButton3=3 xautolock -time 10 -locker "i3lock -c 1d1f21" & # Read .Xmodmap for modified keys -setxkbmap -option ctrl:nocaps -xmodmap ~/.Xmodmap +#setxkbmap -option ctrl:nocaps +#xmodmap ~/.Xmodmap -exec i3 +#exec i3 + +# Setup two monitors at iddqd +xrandr --output DVI-D-0 --primary +xrandr --output DP-1 --auto --left-of DVI-D-0 + +sxhkd & +exec bspwm diff --git a/bin/install_bspwm.sh b/bin/install_bspwm.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# Using the guide from +# https://github.com/windelicato/dotfiles/wiki/bspwm-for-dummies + +# Debian dependencies +sudo apt-get install xcb libxcb-util0-dev libxcb-ewmh-dev libxcb-randr0-dev \ + libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-xinerama0-dev xfonts-terminus \ + dzen2 + +# Core folder +FOLDER=~/code + +cd $FOLDER && \ +git clone git@github.com:baskerville/bspwm.git && \ +cd bspwm && make && sudo make install && cd .. && \ +git clone git@github.com:baskerville/sxhkd.git && \ +cd sxhkd && make && sudo make install && cd .. + +# Panel +git clone git@github.com:baskerville/sutils.git && \ +cd sutils && make && sudo make install && cd .. && \ +git clone git@github.com:baskerville/xtitle.git && \ +cd xtitle && make && sudo make install && cd .. && \ +git clone git@github.com:LemonBoy/bar.git && \ +cd bar && make && sudo make install && cd .. + +# Panel configuration +# Execute the following as root: +# echo 'export PANEL_FIFO="/tmp/panel-fifo"' >> /etc/profile +# echo 'export PANEL_FIFO="/tmp/panel-fifo"' >> /etc/zsh/zprofile + +#cp $FOLDER/bspwm/examples/panel/panel $FOLDER/bspwm/examples/panel/panel_bar ~/bin diff --git a/bin/panel b/bin/panel @@ -0,0 +1,35 @@ +#!/bin/sh + +if [ $(pgrep -cx panel) -gt 1 ] ; then + printf "%s\n" "The panel is already running." >&2 + exit 1 +fi + +trap 'trap - TERM; kill 0' INT TERM QUIT EXIT + +flavor=${1:-bar} + +[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO" +mkfifo "$PANEL_FIFO" + +bspc config top_padding $PANEL_HEIGHT + +bspc control --put-status + +bspc control --subscribe > "$PANEL_FIFO" & +xtitle -sf 'T%s' > "$PANEL_FIFO" & +clock -sf 'S%Y-%m-%d %H:%M' > "$PANEL_FIFO" & + +case "$flavor" in + bar) + cat "$PANEL_FIFO" | panel_bar | bar & + ;; + dzen2) + . 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 + +wait diff --git a/bin/panel_bar b/bin/panel_bar @@ -0,0 +1,65 @@ +#!/bin/sh + +while read -r line ; do + case $line in + S*) + # clock output + sys_infos="\\br\\f7${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" + ;; + [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 " +done diff --git a/bin/panel_colors b/bin/panel_colors @@ -0,0 +1,20 @@ +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' diff --git a/create_symlinks.sh b/create_symlinks.sh @@ -14,7 +14,7 @@ for F in .bashrc .vimrc .inputrc .tmux.conf .xpdfrc .signature .Xresources .Xmod done # Home folder dotfolders -for F in .colors .config/uzbl .config/awesome .config/luakit .config/openbox .i3 .mutt .ncmpcpp .vim .w3m; do +for F in .colors .config/uzbl .config/awesome .config/bspwm .config/sxhkd .config/luakit .config/openbox .i3 .mutt .ncmpcpp .vim .w3m; do SOURCE=$PWD/$F TARGET=~/$F