From 1cb621232785a78b1ad8fa93e96aae3327efbaba Mon Sep 17 00:00:00 2001 From: "stephan.raabe" Date: Wed, 25 Jan 2023 20:14:03 +0100 Subject: [PATCH] Add bspwm --- alacritty/alacritty.yml | 2 +- bspwm/bspwmrc | 20 ++++ picom/picom.conf | 16 +-- qtile/__pycache__/config.cpython-310.pyc | Bin 4188 -> 4223 bytes qtile/autostart.sh | 1 + qtile/config.py | 11 ++- rofi/config.rasi | 80 ++++++++++++++- sxhkd/sxhkdrc | 121 +++++++++++++++++++++++ 8 files changed, 238 insertions(+), 13 deletions(-) create mode 100755 bspwm/bspwmrc create mode 100755 sxhkd/sxhkdrc diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml index a018a91..3b00045 100644 --- a/alacritty/alacritty.yml +++ b/alacritty/alacritty.yml @@ -119,7 +119,7 @@ font: # - (macOS) Menlo # - (Linux/BSD) monospace # - (Windows) Consolas - family: FiraCode + family: FiraCode Nerd Font # The `style` can be specified to pick a specific face. #style: Regular diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc new file mode 100755 index 0000000..cbe6690 --- /dev/null +++ b/bspwm/bspwmrc @@ -0,0 +1,20 @@ +#! /bin/sh + +sxhkd -c ~/.config/sxhkd/sxhkdrc & + +pgrep -x sxhkd > /dev/null || sxhkd & + +bspc monitor -d I II III IV V VI VII VIII IX X + +bspc config border_width 2 +bspc config window_gap 12 + +bspc config split_ratio 0.52 +bspc config borderless_monocle true +bspc config gapless_monocle true + +bspc rule -a Gimp desktop='^8' state=floating follow=on +bspc rule -a Chromium desktop='^2' +bspc rule -a mplayer2 state=floating +bspc rule -a Kupfer.py focus=on +bspc rule -a Screenkey manage=off diff --git a/picom/picom.conf b/picom/picom.conf index 84256b3..6bd2961 100644 --- a/picom/picom.conf +++ b/picom/picom.conf @@ -133,17 +133,21 @@ focus-exclude = [ "class_g = 'Cairo-clock'" ]; # example: # opacity-rule = [ "80:class_g = 'URxvt'" ]; # -# opacity-rule = [] +opacity-rule = [ + "90:class_g = 'Alacritty'" +] ################################# # Corners # ################################# +detect-rounded-corners = true; + # Sets the radius of rounded window corners. When > 0, the compositor will # round the corners of windows. Does not interact well with # `transparent-clipping`. -corner-radius = 5 +corner-radius = 20; # Exclude conditions for rounded corners. rounded-corners-exclude = [ @@ -158,12 +162,12 @@ rounded-corners-exclude = [ # Parameters for background blurring, see the *BLUR* section for more information. -# blur-method = +blur-method = "dual_kawase"; # blur-size = 12 # # blur-deviation = false # -# blur-strength = 5 +blur-strength = 2; # Blur background of semi-transparent / ARGB windows. # Bad in performance, with driver-dependent behavior. @@ -212,8 +216,8 @@ blur-background-exclude = [ # Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. # `xrender` is the default one. # -# backend = "glx" -backend = "xrender"; +backend = "glx" +# backend = "xrender"; # Enable/disable VSync. # vsync = false diff --git a/qtile/__pycache__/config.cpython-310.pyc b/qtile/__pycache__/config.cpython-310.pyc index 7087217cdc50c11bb67b1868ff97b17cbee1117e..78adcdb2b572221a13e999b145f5ba35b5581968 100644 GIT binary patch delta 1449 zcmZ9M&vVm86vuZJ#XoQyr{p&TaERkz>_7|#6G|bFU;GFG5)y(SZ56+*VohSvwOtAq zAK=o1J5U{Z=|N_CX%D@me@JI~>3G^+dhD^&Lr?A7mF$tLnO(j8yzjoRc30A`@qgoK zD;hmS@KSq!D(p=V@`o7suQ43VVJm<3Hf_})qz$kLJ8V!0vzVzmgAD?QAW~O7+9T-@ z(x{L2N;-@*=A(U*jv#%{M-NLninPB)VZczNUrlw6U}CT%;aVO=KGeZo(=p`39o)4& zhJ2*WM?C}8Igb2D2Y2hAKz_8=k#G&-m>BEeuE99+V=a#RbzH9NB+?TtD%Ta4d;$nESngZ;B{isak>%kEd;nMBntiz|RhxtBMG7}y9v^g}uCQ)ru0dG0c^wvE zsZKGv0n2a`Zi$>Z54YitqzhPKrB017+=W$xz`b`A?$=d#fQ)L3EG$2SHM!GESW%qA zGA?i(KLzcJ?f}(R45HnIoVE&^+C6Odac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nRRLF&XCx8DOr33UGe diff --git a/qtile/autostart.sh b/qtile/autostart.sh index 57eb721..fc6f00a 100755 --- a/qtile/autostart.sh +++ b/qtile/autostart.sh @@ -3,4 +3,5 @@ picom -b & xfce4-power-manager & nitrogen --restore & +dunst & diff --git a/qtile/config.py b/qtile/config.py index 9084a7a..55bddbb 100644 --- a/qtile/config.py +++ b/qtile/config.py @@ -33,7 +33,8 @@ from libqtile.lazy import lazy from libqtile.utils import guess_terminal mod = "mod4" -terminal = guess_terminal("Alacritty") +terminal = guess_terminal("alacritty") +browser = "chromium" keys = [ # A list of available commands that can be bound to keys can be found @@ -74,7 +75,8 @@ keys = [ Key([mod], "f", lazy.window.toggle_fullscreen()), Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"), Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), - Key([mod], "r", lazy.spawn("rofi -show run"), desc="Launch Rofi"), + Key([mod], "r", lazy.spawn("rofi -show drun"), desc="Launch Rofi"), + Key([mod], "b", lazy.spawn(browser), desc="Launch Chromium"), # Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), ] @@ -124,7 +126,7 @@ layouts = [ # layout.TreeTab(), # layout.VerticalTile(), # layout.Zoomy(), - layout.Floating(**layout_theme) + # layout.Floating(**layout_theme) ] widget_defaults = dict( @@ -154,7 +156,7 @@ screens = [ # widget.StatusNotifier(), widget.Systray(), widget.Volume(fmt='Vol: {}'), - widget.Clipboard(), + # widget.Clipboard(), widget.CheckUpdates(distro="Arch_yay",no_update_string="No updates"), widget.Clock(format="%Y-%m-%d %a %I:%M %p"), widget.QuickExit(countdown_start=3), @@ -217,3 +219,4 @@ wmname = "LG3D" def autostart(): home = os.path.expanduser('~/.config/qtile/autostart.sh') subprocess.Popen([home]) + diff --git a/rofi/config.rasi b/rofi/config.rasi index fdd5ad7..e910b9a 100644 --- a/rofi/config.rasi +++ b/rofi/config.rasi @@ -1,2 +1,78 @@ -//@theme "/usr/share/rofi/themes/DarkBlue.rasi" -@theme "/usr/share/rofi/themes/DarkBlue.rasi" +configuration { + display-drun: "Applications:"; + display-window: "Windows:"; + drun-display-format: "{name}"; + font: "JetBrainsMono Nerd Font Medium 10"; + modi: "window,run,drun"; +} + +@theme "/dev/null" + +* { + bg: #11121D33; + bg-alt: #444b6a; + + fg: #FFFFFF; + fg-alt: #787c99; + + background-color: @bg; + + border: 0; + margin: 0; + padding: 0; + spacing: 0; +} + +window { + width: 30%; +} + +element { + padding: 8 0; + text-color: @fg-alt; +} + +element selected { + text-color: @fg; +} + +element-text { + text-color: inherit; + vertical-align: 0.5; +} + +element-icon { + size: 14; + padding: 0 10 0 0; +} + +entry { + background-color: @bg-alt; + padding: 12; + text-color: @fg; +} + +inputbar { + children: [prompt, entry]; +} + +listview { + padding: 8 12; + background-color: @bg; + columns: 1; + lines: 8; +} + +mainbox { + background-color: @bg; + children: [inputbar, listview]; +} + +prompt { + background-color: @bg-alt; + enabled: true; + padding: 12 0 0 12; + text-color: @fg; +} + +/* vim: ft=sass diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc new file mode 100755 index 0000000..4c75295 --- /dev/null +++ b/sxhkd/sxhkdrc @@ -0,0 +1,121 @@ +# +# wm independent hotkeys +# + +# terminal emulator +super + Return + alacritty + +# program launcher +super + @space + rofi -show drun + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd + +# +# bspwm hotkeys +# + +# quit/restart bspwm +super + alt + {q,r} + bspc {quit,wm -r} + +# close and kill +super + {_,shift + }w + bspc node -{c,k} + +# 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}