Browse Source

bspwm

master
Juni Kim 2 years ago
parent
commit
69485e48b0
  1. 5
      install.sh
  2. 20
      polybar/.config/polybar/config.ini
  3. 22
      polybar/.config/polybar/launch.role.sh
  4. 2
      polybar/.config/polybar/launch.sh
  5. 7
      wm/.config/berry/kill.sh
  6. 2
      wm/.config/berry/sxhkdrc
  7. 47
      wm/.config/bspwm/bspwmrc
  8. 7
      wm/.config/bspwm/kill.sh
  9. 171
      wm/.config/bspwm/sxhkdrc

5
install.sh

@ -3,8 +3,7 @@
DIR="$(realpath "$(dirname "$0")")"
if ! grep 'Pop!_OS' /etc/os-release > /dev/null 2>&1; then
echo "This is not Pop!_OS, exiting..."
exit
echo "This is not Pop!_OS..."
fi
# script must start at home directory
@ -125,7 +124,7 @@ neovim_fonts() {
wm() {
sudo add-apt-repository -y ppa:papirus/papirus
sudo apt update && sudo apt install -y i3 polybar nitrogen feh picom rofi stow papirus-icon-theme conky
sudo apt update && sudo apt install -y i3 polybar nitrogen feh picom rofi stow papirus-icon-theme conky dmenu scrot
# installing siji
mkdir -p "$HOME/repos/siji"
cd "$HOME/repos/siji" || exit 1

20
polybar/.config/polybar/config.ini

@ -55,19 +55,24 @@ cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
[bar/workspaces]
[bar/workspaces-roleless]
width = 370
inherit = bar/base
modules-center = xworkspaces-roleless
[bar/top]
[bar/workspaces-role]
width = 370
inherit = bar/base
modules-center = xworkspaces-role
[bar/bottom]
width = 500
offset-x = 100%:-500
inherit = bar/base
modules-left = date
modules-right = eth wlan
[bar/bottom]
[bar/top]
inherit = bar/base
bottom = true
width = 100%
@ -127,9 +132,13 @@ label-empty = 
type = internal/xworkspaces
inherit = module/workspaces
format = <label-state>
label-active = %icon%
label-active-foreground = ${colors.background}
label-active-underline = ${colors.primary-underline}
label-occupied = %icon%
label-occupied-foreground = ${colors.background}
label-urgent = %icon%
label-empty-foreground = ${colors.disabled}
label-empty = %icon%
@ -186,8 +195,11 @@ format-muted-background = ${colors.primary}
format-volume-foreground = ${colors.background}
format-muted-foreground = ${colors.background}
format-volume-alignment = center
format-volume-spacing = 1
format-volume = <bar-volume>
format-volume = "<bar-volume> <label-volume> "
label-volume-foreground = ${colors.background}
label-volume = %percentage:2%%
bar-volume-width = 12
bar-volume-padding = 1

22
polybar/.config/polybar/launch.role.sh

@ -0,0 +1,22 @@
#!/bin/sh
if test "$1" = "-r"; then
RELOAD=1
echo "Hot reload..."
else
RELOAD=
fi
pkill polybar
bar() {
if test -z "$RELOAD"; then
polybar -c "$HOME/.config/polybar/config.ini" "$@" &
else
polybar -r -c "$HOME/.config/polybar/config.ini" -l warning "$@" &
fi
}
bar top
bar workspaces-role
bar bottom

2
polybar/.config/polybar/launch.sh

@ -18,5 +18,5 @@ bar() {
}
bar top
bar workspaces
bar workspaces-roleless
bar bottom

7
wm/.config/berry/kill.sh

@ -0,0 +1,7 @@
#!/usr/bin/env bash
QUIT=$(printf "No\nYes" | dmenu -i -p "Are you sure u want to kill bspwm?")
if test "$QUIT" == "Yes" ; then
pkill berry
fi

2
wm/.config/berry/sxhkdrc

@ -58,7 +58,7 @@ super + {Tab,r}
berryc cycle_focus
super + shift + e
killall berry
~/.config/berry/kill.sh
super + shift + q
berryc window_close

47
wm/.config/bspwm/bspwmrc

@ -0,0 +1,47 @@
#!/bin/sh
xrandr -s 1920x1080
pgrep -x sxhkd > /dev/null || sxhkd -c ~/.config/bspwm/sxhkdrc &
pkill conky; conky -d
feh --bg-fill /usr/share/backgrounds/pop/jared-evans-119758.jpg
pkill picom; picom --corner-radius 15 &
~/.config/polybar/launch.role.sh &
bspc monitor -d 0 1 2 3 4 5 6 7 8
bspc config border_width 2
bspc config window_gap 12
bspc config top_padding 25
bspc config split_ratio 0.50
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc rule -a Alacritty desktop='^1'
bspc rule -a Kitty desktop='^1'
bspc rule -a "Brave-browser" desktop='^2'
bspc rule -a "Tor Browser" desktop='^2'
bspc rule -a "torbrowser" desktop='^2'
bspc rule -a "firefox" desktop='^2'
bspc rule -a "discord" desktop='^4'
bspc rule -a "Skype" desktop='^4'
bspc rule -a "zoom" desktop='^4' state=floating
bspc rule -a "Signal" desktop='^4'
bspc rule -a "GStreamer" desktop='^4'
bspc rule -a "Code" desktop='^3'
bspc rule -a "jetbrains" desktop='^3'
bspc rule -a "sublime" desktop='^3'
bspc rule -a "Pulsar" desktop='^3'
bspc rule -a "Virt-manager" desktop='^5'
bspc rule -a "cantata" desktop='^6'
bspc rule -a "youtube-music" desktop='^6'
bspc rule -a "Blueberry.py" desktop='^7'
bspc rule -a "control-center" desktop='^7'

7
wm/.config/bspwm/kill.sh

@ -0,0 +1,7 @@
#!/usr/bin/env bash
QUIT=$(printf "No\nYes" | dmenu -i -p "Are you sure u want to kill bspwm?")
if test "$QUIT" == "Yes" ; then
pkill bspwm
fi

171
wm/.config/bspwm/sxhkdrc

@ -0,0 +1,171 @@
#
# wm independent hotkeys
# vim:ft=conf
#
# terminal emulator
super + shift + Return
alacritty -e tmux
super + shift + a
alacritty
# browser
super + shift + w
brave-browser
# program launcher
super + space
rofi -show drun
super + w
rofi -show window
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
super + e
mt
#
# bspwm hotkeys
#
# quit/restart bspwm
super + shift + r
bspc wm -r
super + shift + e
~/.config/bspwm/kill.sh
# close and kill
super + shift + q
bspc node -c
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest window
super + g
bspc node -s biggest.window
#
# state/flags
#
# set the window state
super + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
#super + {p,b,comma,period}
# bspc node -f @{parent,brother,first,second}
# focus the next/previous window in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local.!hidden.window
# focus the next/previous desktop in the current monitor
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
super + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
#
# preselect
#
# preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
super + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
#fn + {F8,F9}
# brightnessctl set {10%-,10%+}
# old alt keybindings
#
alt + {Left,Right}
brightnessctl set {10%-,10%+}
alt + {Up,Down}
pamixer set-sink-volume 0 {+,-}5%
# audio stuff
XF86AudioRaiseVolume
pamixer set-sink-volume 0 +5%
XF86AudioLowerVolume
pamixer set-sink-volume 0 -5%
XF86AudioMute
pactl set-sink-mute 0 toggle
# brightness stuff
{XF86MonBrightnessUp,XF86MonBrightnessDown}
brightnessctl set {10%+,10%-}
# screenshot capability
super + shift + s
mkdir -p ~/screenshots && scrot ~/screenshots/%Y-%m-%d-%T-screenshot.png
Print
mkdir -p ~/screenshots && scrot ~/screenshots/%Y-%m-%d-%T-screenshot.png
Loading…
Cancel
Save