Rework on i3 and bspwm config

This commit is contained in:
Thomas Dehaeze 2019-12-30 17:21:56 +01:00
parent c53b09bd20
commit 983fe0e05d
4 changed files with 98 additions and 177 deletions

View File

@ -6,13 +6,12 @@
#+PROPERTY: header-args:bash+ :tangle ~/.config/bspwm/bspwmrc #+PROPERTY: header-args:bash+ :tangle ~/.config/bspwm/bspwmrc
:END: :END:
* List Desktops
#+begin_src bash #+begin_src bash
# If refreshing bspwm, remove all previous rules to prevent doubling up.
bspc rule -r "*"
bspc monitor -d code web mail misc figs bspc monitor -d code web mail misc figs
#+end_src #+end_src
* Basic Config
#+begin_src bash #+begin_src bash
bspc config border_width 1 bspc config border_width 1
bspc config window_gap 8 bspc config window_gap 8
@ -25,20 +24,27 @@
bspc config focus_follows_pointer true bspc config focus_follows_pointer true
#+end_src #+end_src
* Colors
#+begin_src bash #+begin_src bash
bspc config normal_border_color \#32302f bspc config normal_border_color \#32302f
bspc config focused_border_color \#bdae93 bspc config focused_border_color \#bdae93
#+end_src #+end_src
* Rules
Use =xprop= to obtain information about the window.
#+begin_src bash #+begin_src bash
# If refreshing bspwm, remove all previous rules to prevent doubling up.
bspc rule -r "*"
bspc rule --add qutebrowser desktop='web' follow=on state=tiled bspc rule --add qutebrowser desktop='web' follow=on state=tiled
bspc rule --add Emacs desktop='code' follow=on state=tiled bspc rule --add Emacs desktop='code' follow=on state=tiled
bspc rule --add Pavucontrol state=floating
#+end_src #+end_src
* Run Polybar and SXHKD
#+begin_src bash #+begin_src bash
$HOME/.config/polybar/scripts/launch.sh $HOME/.config/polybar/scripts/launch.sh
#+end_src
#+begin_src bash
sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.bspwm & sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.bspwm &
#+end_src #+end_src

View File

@ -183,6 +183,11 @@ To display names or symbols instead of plain workspace numbers you can use somet
floating_modifier $mod floating_modifier $mod
#+end_src #+end_src
** Back and Forth
#+begin_src conf
workspace_auto_back_and_forth yes
#+end_src
** Application Specific ** Application Specific
*** Open applications on specific workspaces *** Open applications on specific workspaces
#+begin_src conf #+begin_src conf
@ -215,74 +220,7 @@ To display names or symbols instead of plain workspace numbers you can use somet
for_window [title="Simulink Library Browser"] floating enable for_window [title="Simulink Library Browser"] floating enable
#+end_src #+end_src
* Windows Manager * TODO Scratchpad
** DONE Change focus
#+begin_src conf
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
#+end_src
** DONE Move focused window
#+begin_src conf
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#+end_src
** DONE Split orientation
#+begin_src conf
bindsym $mod+q split h
bindsym $mod+v split v
#+end_src
** DONE Kill focused window
#+begin_src conf
bindsym $mod+Shift+q kill
#+end_src
** DONE Toggle fullscreen mode for the focused container
#+begin_src conf
bindsym $mod+f fullscreen toggle
#+end_src
** DONE Change container layout (stacked, tabbed, toggle split)
#+begin_src conf
# Toggle between stacking/tabbed/split:
bindsym $mod+x layout toggle tabbed split
#+end_src
** DONE Toggle tiling / floating
#+begin_src conf
bindsym $mod+Shift+space floating toggle
#+end_src
** DONE Change focus between tiling / floating windows
#+begin_src conf
bindsym $mod+a focus mode_toggle
#+end_src
** DONE Resize Window
#+begin_src conf
bindsym $mod+Shift+y resize shrink width 10 px or 10 ppt
bindsym $mod+Shift+u resize grow height 10 px or 10 ppt
bindsym $mod+Shift+i resize shrink height 10 px or 10 ppt
bindsym $mod+Shift+o resize grow width 10 px or 10 ppt
#+end_src
** TODO Scratchpad
#+begin_src conf #+begin_src conf
# move the currently focused window to the scratchpad # move the currently focused window to the scratchpad
bindsym $mod+Shift+BackSpace move scratchpad bindsym $mod+Shift+BackSpace move scratchpad
@ -292,73 +230,8 @@ To display names or symbols instead of plain workspace numbers you can use somet
bindsym $mod+BackSpace scratchpad show bindsym $mod+BackSpace scratchpad show
#+end_src #+end_src
* DONE Workspaces * Run Polybar and SXHKD
:PROPERTIES:
:header-args:conf+: :tangle no
:END:
** DONE Switch to workspace
#+begin_src conf
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
#+end_src
** DONE Workspace back and forth (with/without active container)
#+begin_src conf
workspace_auto_back_and_forth yes
bindsym $mod+b workspace back_and_forth
#+end_src
** DONE Move to prev/next workspace
#+begin_src conf
bindsym $mod+n workspace next
bindsym $mod+p workspace prev
#+end_src
** DONE Move focused container to workspace
#+begin_src conf
bindsym $mod+Ctrl+1 move container to workspace $ws1
bindsym $mod+Ctrl+2 move container to workspace $ws2
bindsym $mod+Ctrl+3 move container to workspace $ws3
bindsym $mod+Ctrl+4 move container to workspace $ws4
bindsym $mod+Ctrl+5 move container to workspace $ws5
bindsym $mod+Ctrl+6 move container to workspace $ws6
bindsym $mod+Ctrl+7 move container to workspace $ws7
bindsym $mod+Ctrl+8 move container to workspace $ws8
#+end_src
** DONE Move to workspace with focused container
#+begin_src conf
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
#+end_src
* DONE I3 Bindings
:PROPERTIES:
:header-args:conf+: :tangle no
:END:
Restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
#+begin_src conf
bindsym $mod+Shift+r restart
#+end_src
* Run Polybar
#+begin_src conf #+begin_src conf
exec_always --no-startup-id $HOME/.config/polybar/scripts/launch.sh exec_always --no-startup-id $HOME/.config/polybar/scripts/launch.sh
#+end_src
* Key Bindings
#+begin_src conf
exec_always --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3 exec_always --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3
#+end_src #+end_src

View File

@ -1,6 +1,6 @@
#+TITLE: Polybar Configuration #+TITLE: Polybar Configuration
:DRAWER: :DRAWER:
#+PROPERTY: header-args+ :comments both #+PROPERTY: header-args :comments no
#+PROPERTY: header-args+ :mkdirp yes #+PROPERTY: header-args+ :mkdirp yes
#+PROPERTY: header-args+ :tangle ~/.config/polybar/config #+PROPERTY: header-args+ :tangle ~/.config/polybar/config
:END: :END:
@ -48,8 +48,8 @@
* VM * VM
#+begin_src conf #+begin_src conf
[global/wm] [global/wm]
margin-top = 5 margin-top = 0
margin-bottom = 5 margin-bottom = 0
#+end_src #+end_src
* Top Bar * Top Bar
@ -81,9 +81,11 @@
font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = Weather Icons:size=10;1 font-2 = Weather Icons:size=10;1
modules-left = i3 xwindow modules-left = i3 bspwm xwindow
modules-center = modules-center =
modules-right = pulseaudio wireless-network xbacklight screenshot redshift nordvpn lockscreen dunst unread_mail cpu battery temperature date modules-right = pulseaudio xbacklightredshift nordvpn lockscreen dunst unread_mail cpu battery temperature date
wm-restack = bspwm
tray-position = right tray-position = right
tray-detached = true tray-detached = true
@ -143,6 +145,48 @@
label-urgent-padding = 1 label-urgent-padding = 1
#+END_SRC #+END_SRC
* BSPWM
#+begin_src conf
[module/bspwm]
type = internal/bspwm
pin-workspaces = true
enable-click = true
enable-scroll = false
; Use fuzzy (partial) matching on labels when assigning
; icons to workspaces
; Example: code;♚ will apply the icon to all workspaces
; containing 'code' in the label
fuzzy-match = false
ws-icon-0 = code;
ws-icon-1 = web;
ws-icon-2 = mail;
ws-icon-3 = misc;
ws-icon-4 = figs;ﬧ
ws-icon-default =
label-focused = %icon%
label-focused-foreground = ${colors.background}
label-focused-background = ${colors.turquoise}
label-focused-underline= ${colors.turquoise}
label-focused-padding = 1
label-occupied = %icon%
label-occupied-underline = ${colors.foreground}
label-occupied-padding = 1
label-urgent = %icon%
label-urgent-background = ${colors.red}
label-urgent-padding = 1
label-empty = %icon%
label-empty-foreground = ${colors.foreground}
label-empty-padding = 1
#+end_src
* Music using MPD * Music using MPD
#+BEGIN_SRC conf #+BEGIN_SRC conf
[module/mpd] [module/mpd]
@ -558,7 +602,6 @@
fi fi
#+end_src #+end_src
* Weather * Weather
https://github.com/x70b1/polybar-scripts/tree/master/polybar-scripts/openweathermap-fullfeatured https://github.com/x70b1/polybar-scripts/tree/master/polybar-scripts/openweathermap-fullfeatured

View File

@ -67,7 +67,7 @@
# File Manager # File Manager
super + o super + o
alacritty -e "ranger" urxvt -e "ranger"
# Browser # Browser
super + i super + i
@ -144,7 +144,7 @@ XF86Display
# Ranger # Ranger
super + space ; r super + space ; r
alacritty -e "ranger" urxvt -e "ranger"
# pcmanfm: GUI file manager # pcmanfm: GUI file manager
super + space ; shift + r super + space ; shift + r
@ -228,8 +228,15 @@ super + shift + d
** Set the window State ** Set the window State
#+begin_src conf #+begin_src conf
# set the window state # set the window state
super + {t,s, shift + f} super + {t, shift + f}
bspc node -t {tiled,floating,fullscreen} bspc node -t {tiled,fullscreen}
super + s
if [ -z "$(bspc query -N -n focused.floating)" ]; then \
bspc node focused -t floating; \
else \
bspc node focused -t tiled; \
fi
#+end_src #+end_src
** Sticky Window ** Sticky Window
@ -239,7 +246,7 @@ super + shift + d
bspc node -g sticky bspc node -g sticky
#+end_src #+end_src
** focus/swap ** Focus and Swap
#+begin_src conf #+begin_src conf
# Focus/swap the node in the given direction # Focus/swap the node in the given direction
super + {_,shift + }{h,j,k,l} super + {_,shift + }{h,j,k,l}
@ -248,10 +255,6 @@ super + shift + d
# focus the last Node # focus the last Node
super + Tab super + Tab
bspc node -f last bspc node -f last
# Swap to the last Desktop
super + shift + b
bspc node -s last
#+end_src #+end_src
#+begin_src conf #+begin_src conf
@ -303,6 +306,7 @@ super + ctrl + space
super + {Left,Down,Up,Right} super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0} bspc node -v {-20 0,0 20,0 -20,20 0}
#+end_src #+end_src
* I3 related * I3 related
:PROPERTIES: :PROPERTIES:
:header-args:conf+: :tangle ~/.config/sxhkd/sxhkdrc.i3 :header-args:conf+: :tangle ~/.config/sxhkd/sxhkdrc.i3
@ -325,16 +329,16 @@ super + ctrl + space
super + f super + f
i3-msg layout toggle tabbed split i3-msg layout toggle tabbed split
# focus the next/previous node in the current desktop # Change focus between tiling / floating windows
# super + c super + c
# bspc node -f next.local i3-msg focus mode_toggle
#+end_src #+end_src
** Set the window State ** Set the window State
#+begin_src conf #+begin_src conf
# set the window state # set the window state
super + {t,s, shift + f} super + {t,s, shift + f}
i3-msg {fullscreen disavle,floating toggle,fullscreen toggle} i3-msg {fullscreen disable,floating toggle,fullscreen toggle}
#+end_src #+end_src
** Sticky Window ** Sticky Window
@ -346,16 +350,14 @@ super + ctrl + space
** focus/swap ** focus/swap
#+begin_src conf #+begin_src conf
# Focus/swap the node in the given direction # Focus/swap the node in the given direction
super + {_,shift + }{h,j,k,l} super + {_,shift + }{h,Left}
i3-msg {focus,move} {left,down,up,right} i3-msg {focus,move} left
super + {_,shift + }{j,Down}
# focus the last Node i3-msg {focus,move} down
# super + Tab super + {_,shift + }{k,Up}
# bspc node -f last i3-msg {focus,move} up
super + {_,shift + }{l,Right}
# Swap to the last Desktop i3-msg {focus,move} right
# super + shift + b
# bspc node -s last
#+end_src #+end_src
#+begin_src conf #+begin_src conf
@ -376,17 +378,14 @@ super + ctrl + space
WP={1-9} && i3-msg move container to workspace $WP && i3-msg workspace $WP WP={1-9} && i3-msg move container to workspace $WP && i3-msg workspace $WP
#+end_src #+end_src
** Change focus between tiling / floating windows
#+begin_src conf
super + a
i3-msg focus mode_toggle
#+end_src
** Preselect ** Preselect
Preselect the direction Preselect the direction
#+begin_src conf #+begin_src conf
super + ctrl + {h,j,k,l} super + ctrl + {h,l,Left,Right}
i3-msg split {h,v,v,h} i3-msg split h
super + ctrl + {j,k,Up,Down}
i3-msg split v
#+end_src #+end_src
** Resize ** Resize