bspwmrc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. #!/usr/bin/env dash
  2. coded_by='
  3. In the name of Allah, the most Gracious, the most Merciful.
  4. ▓▓▓▓▓▓▓▓▓▓
  5. ░▓ Author ▓ Abdullah <https://abdullah.today>
  6. ░▓▓▓▓▓▓▓▓▓▓
  7. ░░░░░░░░░░
  8. ░█▀▄░█▀▀░█▀█░█░█░█▄█
  9. ░█▀▄░▀▀█░█▀▀░█▄█░█░█
  10. ░▀▀░░▀▀▀░▀░░░▀░▀░▀░▀
  11. '
  12. # Define some functions
  13. multimonitors()
  14. {
  15. start_from=1
  16. monitors_connected=$(bspc query -M | wc -l)
  17. per_monitor=$(( 10 / monitors_connected ))
  18. for monitor in $(bspc query -M); do
  19. bspc monitor $monitor -d $(seq $start_from $(( start_from + per_monitor - 1)))
  20. start_from=$(( start_from + per_monitor ))
  21. done
  22. }
  23. multibar() {
  24. # check how many monitors are connected and start polybar on all of them.
  25. pkill polybar
  26. while pgrep -x polybar >/dev/null; do sleep 1; done
  27. xrandr -q | awk '/ connected / {print $1}' | while read -r monitor _; do
  28. polybar -r "$monitor" &
  29. done
  30. }
  31. # Divide workspaces/desktops to all connected monitors
  32. multimonitors
  33. for monitor in unplugged disabled ; do
  34. bspc config \
  35. remove_${monitor}_monitors true
  36. done
  37. bspc config \
  38. merge_overlapping_monitors true
  39. # Rules for windows
  40. bspc config external_rules_command "$HOME"/.config/bspwm/external_rules
  41. # Start polybar on all connected monitors
  42. # multibar &
  43. # Start stalonetray
  44. # stalonetray &
  45. # Start lemonbar
  46. #$HOME/.local/bin/mypanel &
  47. #SXHKD_SHELL=`which dash` sxhkd &
  48. # Border width and gaps between windows
  49. border_width=1
  50. window_gaps=5
  51. bspc config border_width $border_width
  52. bspc config window_gap $window_gaps
  53. # Padding
  54. padding="0"
  55. for side in right bottom left ; do
  56. bspc config ${side}_padding $padding
  57. done
  58. for side in top right bottom left; do
  59. bspc config ${side}_monocle_padding 0
  60. done
  61. # Ignore EWMH focus requests. If true, opening new program in already
  62. # opened instance will have direct
  63. # focus too. Like if you're on desktop 8 and you open a URL from mutt, and
  64. # chrome is configured as url launcher, it will send the url to chrome opened
  65. # in 2nd desktop and switch to it.
  66. bspc config ignore_ewmh_focus false
  67. # On which child should a new window be attached
  68. bspc config initial_polarity second_child
  69. # Split ration for new windows
  70. bspc config split_ratio 0.50
  71. # If monocle layout, no border to windows.
  72. bspc config borderless_monocle true
  73. # No gaps as well
  74. bspc config gapless_monocle true
  75. # Move focus from tiled windows to floating
  76. bspc config directional_focus_tightness low
  77. # Focus the window under the pointer
  78. bspc config focus_follows_pointer true
  79. # When focusing a monitor/window, put the pointer to its center.
  80. bspc config pointer_follows_monitor true
  81. bspc config pointer_follows_focus false
  82. # Button used to focusing a window/monitor
  83. bspc config click_to_focus any
  84. # if there is only one window, set the layout monocle.
  85. bspc config single_monocle true
  86. # Pointer actions when pressing mod + button
  87. bspc config pointer_action1 move
  88. bspc config pointer_action2 resize_side
  89. bspc config pointer_action3 resize_corner
  90. # Show where new window will be opened
  91. bspc config presel_feedback true
  92. # Prefix prepended to status program
  93. bspc config status_prefix 'W'
  94. # Insertion scheme
  95. bspc config automatic_scheme longest_side
  96. # Colors
  97. dark_moderate_blue="#5e81ac"
  98. mint_cream="#EFF8F5"
  99. baby_blue="#58FAF4"
  100. black="#000000"
  101. white="#FFFFFF"
  102. pink_flamingo="#FA58F4"
  103. pure_cyan="#00FFFF"
  104. pure_magenta="#FF00FF"
  105. vivid_red="#ff3232"
  106. hot_pink="#ff69b4"
  107. maroon="#800000"
  108. up_maroon="#7b1113"
  109. awesome="#B443F3"
  110. pink="#F10CF1"
  111. sky_blue="#28DECB"
  112. # Feedback color of preselection
  113. bspc config presel_feedback_color $baby_blue
  114. # Focused Border color
  115. bspc config focused_border_color $maroon
  116. # Active border color
  117. bspc config active_border_color $pink
  118. # Normal border color
  119. bspc config normal_border_color $sky_blue
  120. # Mouse
  121. bspc config pointer_modifier mod4
  122. bspc config pointer_action3 resize_side
  123. bspc config pointer_action3 resize_corner
  124. bspc config pointer_action1 move
  125. #sleep 1
  126. #urxvtc -g 70x20 -title 'scratchpad'
  127. #picom -b &
  128. #feh --bg-scale --randomize ~/pix/wall/blurry/ &
  129. # alacritty -t 'scratchpad' &
  130. # Start some useful programs. Only useful if you don't use some display manager.
  131. # If you use one, that will source ~/.xprofile so execute these programs from
  132. # there instead.
  133. "$HOME"/.config/bspwm/autostart.sh &