d0tfiles

*nix dotfiles for arch linux setup
Log | Files | Refs | README | LICENSE

bspwmrc (3576B)


      1 #!/bin/bash
      2 
      3 ## Environtment
      4 export PATH="${PATH}:$HOME/.config/bspwm/bin"
      5 
      6 ## Get colors from .Xresources -------------------------------#
      7 xrdb ~/.Xresources
      8 getcolors () {
      9 	FOREGROUND=$(xrdb -query | grep 'foreground:'| awk '{print $NF}')
     10 	BACKGROUND=$(xrdb -query | grep 'background:'| awk '{print $NF}')
     11 	BLACK=$(xrdb -query | grep 'color0:'| awk '{print $NF}')
     12 	RED=$(xrdb -query | grep 'color1:'| awk '{print $NF}')
     13 	GREEN=$(xrdb -query | grep 'color2:'| awk '{print $NF}')
     14 	YELLOW=$(xrdb -query | grep 'color3:'| awk '{print $NF}')
     15 	BLUE=$(xrdb -query | grep 'color4:'| awk '{print $NF}')
     16 	MAGENTA=$(xrdb -query | grep 'color5:'| awk '{print $NF}')
     17 	CYAN=$(xrdb -query | grep 'color6:'| awk '{print $NF}')
     18 	WHITE=$(xrdb -query | grep 'color7:'| awk '{print $NF}')
     19 }
     20 getcolors
     21 
     22 ## Configurations -------------------------------#
     23 bspc monitor -d 'main' 'web' 'code' 'art' 'dev' 'chat' 'news' 'music'
     24 
     25 bspc config border_width 1
     26 bspc config window_gap 10
     27 bspc config split_ratio 0.50
     28 
     29 bspc config focused_border_color "$BLUE" 
     30 bspc config normal_border_color "$BACKGROUND"
     31 bspc config active_border_color "$MAGENTA"
     32 bspc config presel_feedback_color "$GREEN"
     33 
     34 bspc config borderless_monocle true
     35 bspc config gapless_monocle true
     36 bspc config paddingless_monocle true
     37 bspc config single_monocle false
     38 bspc config focus_follows_pointer true
     39 
     40 
     41 ## Window rules -------------------------------#
     42 
     43 # remove all rules first
     44 bspc rule -r *:*
     45 
     46 # 1 > terminal
     47 bspc rule -a Termite desktop='^1' follow=on focus=on
     48 
     49 # 2 > web
     50 bspc rule -a firefox desktop='^2' follow=on focus=on
     51 
     52 # 3 > file
     53 bspc rule -a Pcmanfm desktop='^3' follow=on focus=on
     54 
     55 # 4 > office
     56 declare -a office=(Geany Gucharmap Evince \
     57 libreoffice-writer libreoffice-calc libreoffice-impress \
     58 libreoffice-startcenter libreoffice Soffice *:libreofficedev *:soffice)
     59 for i in ${office[@]}; do
     60    bspc rule -a $i desktop='^4' follow=on focus=on; done
     61 
     62 # 5 > media
     63 declare -a media=(Audacity mpv mplayer lxmusic Gimp Gimp-2.8)
     64 for i in ${media[@]}; do
     65    bspc rule -a $i desktop='^5' follow=on focus=on; done
     66 
     67 # 6 > settings
     68 bspc rule -a GParted desktop='^6' follow=on focus=on
     69 declare -a settings=(Lxappearance Lxtask Lxrandr Arandr \
     70 System-config-printer.py Pavucontrol Exo-helper-1)
     71 for i in ${settings[@]}; do
     72    bspc rule -a $i desktop='^6' state=floating follow=on focus=on; done
     73 
     74 # special rules
     75 bspc rule -a termite-float state=floating follow=on focus=on
     76 bspc rule -a Pcmanfm state=floating follow=on focus=on
     77 bspc rule -a Onboard state=floating follow=on focus=on
     78 bspc rule -a Audacious state=floating follow=on focus=on
     79 bspc rule -a Firefox:Places state=floating follow=on focus=on
     80 bspc rule -a Viewnior state=floating follow=on focus=on
     81 bspc rule -a Conky state=floating manage=off
     82 bspc rule -a stalonetray state=floating manage=off
     83 
     84 ## Autostart -------------------------------#
     85 
     86 # Kill if already running
     87 killall -9 sxhkd xsettingsd dunst xfce4-power-manager
     88 
     89 # Lauch notification daemon
     90 dunst \
     91 -geom "280x50-10+40" -frame_width "1" -font "Iosevka Custom 9" \
     92 -lb "$BACKGROUND" -lf "$FOREGROUND" -lfr "$BLUE" \
     93 -nb "$BACKGROUND" -nf "$FOREGROUND" -nfr "$BLUE" \
     94 -cb "$BACKGROUND" -cf "$RED" -cfr "$RED" &
     95 
     96 # Lauch keybindings daemon
     97 sxhkd &
     98 
     99 # Enable Super Keys For Menu
    100 ksuperkey -e 'Super_L=Alt_L|F1' &
    101 ksuperkey -e 'Super_R=Alt_L|F1' &
    102 
    103 # Enable power management
    104 xfce4-power-manager &
    105 
    106 # Fix cursor
    107 xsetroot -cursor_name left_ptr
    108 
    109 # Restore wallpaper
    110 bash $HOME/.fehbg
    111 
    112 # Start mpd
    113 exec mpd &
    114 
    115 # Start bspwm scripts
    116 bspcolors
    117 bspcomp
    118 bspbar
    119 bspfloat &
    120 
    121 # Issue Tracker (Don't Remove IT)
    122 issue_tracker.sh