bspwmrc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/bash
  2. ## Environtment
  3. export PATH="${PATH}:~/.config/bspwm/bin"
  4. ## Get colors from .Xresources -------------------------------#
  5. xrdb ~/.Xresources
  6. getcolors () {
  7. FOREGROUND=$(xrdb -query | grep 'foreground:'| awk '{print $NF}')
  8. BACKGROUND=$(xrdb -query | grep 'background:'| awk '{print $NF}')
  9. BLACK=$(xrdb -query | grep 'color0:'| awk '{print $NF}')
  10. RED=$(xrdb -query | grep 'color1:'| awk '{print $NF}')
  11. GREEN=$(xrdb -query | grep 'color2:'| awk '{print $NF}')
  12. YELLOW=$(xrdb -query | grep 'color3:'| awk '{print $NF}')
  13. BLUE=$(xrdb -query | grep 'color4:'| awk '{print $NF}')
  14. MAGENTA=$(xrdb -query | grep 'color5:'| awk '{print $NF}')
  15. CYAN=$(xrdb -query | grep 'color6:'| awk '{print $NF}')
  16. WHITE=$(xrdb -query | grep 'color7:'| awk '{print $NF}')
  17. }
  18. getcolors
  19. ## Configurations -------------------------------#
  20. `/opt/bin/monitor/multiple_monitor.sh -i`
  21. is_connected=`/opt/bin/monitor/multiple_monitor.sh -c`
  22. echo $is_connected
  23. if [ $is_connected = true ]; then
  24. bspc monitor DP-5 -d 6 7 8 9 0
  25. bspc monitor DP-4 -d 1 2 3 4 5
  26. else
  27. bspc monitor -d 'I' 'II' 'III' 'IV' 'V' 'VI' 'VII' 'VIII' 'IX' 'X'
  28. fi
  29. bspc config border_width 1
  30. bspc config window_gap 6
  31. bspc config split_ratio .5
  32. bspc config focused_border_color "$BLUE"
  33. bspc config normal_border_color "$BACKGROUND"
  34. bspc config active_border_color "$MAGENTA"
  35. bspc config presel_feedback_color "$GREEN"
  36. bspc config borderless_monocle true
  37. bspc config gapless_monocle true
  38. bspc config paddingless_monocle true
  39. bspc config single_monocle false
  40. bspc config focus_follows_pointer true
  41. # remove all rules first
  42. bspc rule -r *:*
  43. ## Autostart -------------------------------#
  44. # Kill if already running
  45. killall -9 sxhkd dunst #xfce4-power-manager xsettingsd
  46. # Lauch notification daemon
  47. dunst \
  48. -geom "280x50-10+38" -frame_width "1" -font "Iosevka Custom 9" \
  49. -lb "$BACKGROUND" -lf "$FOREGROUND" -lfr "$BLUE" \
  50. -nb "$BACKGROUND" -nf "$FOREGROUND" -nfr "$BLUE" \
  51. -cb "$BACKGROUND" -cf "$RED" -cfr "$RED" &
  52. # Lauch xsettingsd daemon
  53. #xsettingsd &
  54. # polkit agent
  55. if [[ ! `pidof xfce-polkit` ]]; then
  56. /usr/lib/xfce-polkit/xfce-polkit &
  57. fi
  58. # Lauch keybindings daemon
  59. sxhkd &
  60. # Enable Super Keys For Menu
  61. # ksuperkey -e 'Super_L=Alt_L|F1' &
  62. # ksuperkey -e 'Super_R=Alt_L|F1' &
  63. # Enable power management
  64. #xfce4-power-manager &
  65. # Fix cursor
  66. xsetroot -cursor_name left_ptr
  67. # Restore wallpaper
  68. bash $HOME/.fehbg
  69. # Start mpd
  70. #exec mpd &
  71. # Start bspwm scripts
  72. /home/lildurden/.config/bspwm/bin/bspcolors
  73. /home/lildurden/.config/bspwm/bin/bspcomp
  74. /home/lildurden/.config/bspwm/bin/bspbar
  75. /home/lildurden/.config/bspwm/bin/bspfloat &
  76. #/usr/bin/nm-applet &
  77. /usr/bin/blueman-applet &
  78. systemctl --user start low_battery.service
  79. ## Adjust backlight (AMD)
  80. #blight -d amdgpu_bl0 set 15%