aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.config/bspwm/bspwmrc21
-rw-r--r--.config/nvim/init.lua7
-rw-r--r--.config/sxhkd/sxhkdrc100
-rwxr-xr-x.local/bin/dwm_status.sh11
-rwxr-xr-x.local/bin/tsarbar_status.sh48
-rw-r--r--.xinitrc10
-rw-r--r--.zshrc2
-rw-r--r--src/dwm/config.h130
-rwxr-xr-x[-rw-r--r--]update.sh8
9 files changed, 185 insertions, 152 deletions
diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc
new file mode 100755
index 0000000..de10ea0
--- /dev/null
+++ b/.config/bspwm/bspwmrc
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+pgrep -x sxhkd > /dev/null || sxhkd &
+xbanish &
+thunderbird &
+dunst &
+tsarbar &
+tsarbar_status.sh &
+
+bspc monitor -d WWW DEV GAME MISC
+
+bspc config border_width 1
+bspc config window_gap 0
+bspc config top_padding 17
+
+bspc config split_ratio 0.5
+bspc config borderless_monocle true
+bspc config gapless_monocle true
+
+bspc config normal_active_color "#202020"
+bspc config focused_border_color "#FFFFFF"
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index 286740d..58f4f76 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -12,11 +12,15 @@ vim.o.tabstop = 2
vim.o.shiftwidth = 0
vim.o.expandtab = true
vim.o.undofile = true
-vim.o.scrolloff = 3
+vim.o.scrolloff = 10
vim.o.winborder = "single"
vim.o.mouse = ""
vim.o.completeopt = "menu,menuone,noselect"
+vim.o.backup = false
+vim.o.writebackup = false
+vim.o.swapfile = false
+
vim.g.mapleader = " "
vim.pack.add({
@@ -55,6 +59,7 @@ vim.api.nvim_create_autocmd("FileType", {
vim.keymap.set("t", "<esc><esc>", "<C-\\><C-n>")
vim.keymap.set("n", "<leader>t", ":hori term<CR>:resize 20<CR>")
vim.keymap.set("n", "<leader>f", ":Pick files tool='rg'<CR>")
+vim.keymap.set("v", "p", '"_dP', opts)
-- Switch between semantically related files easily :)
local exts = {{"c", "h"}, {"cc", "hh"}, {"cpp", "hpp"}, {"frag", "vert"}}
diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc
new file mode 100644
index 0000000..abc9895
--- /dev/null
+++ b/.config/sxhkd/sxhkdrc
@@ -0,0 +1,100 @@
+#
+# wm independent hotkeys
+#
+
+# terminal emulator
+super + Return
+ st
+
+# program launcher
+super + d
+ dmenu_run
+
+super + shift + s
+ screenshot
+
+XF86Audio{Prev,Next,Play}
+ playerctl {previous,next,play-pause}
+
+XF86Audio{Lower,Raise}Volume
+ pactl set-sink-volume @DEFAULT_SINK@ {-,+}5%
+
+# 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 + g
+ bspc desktop -l next
+
+# swap the current node and the biggest window
+super + a
+ bspc node -s biggest.window
+
+# set the window state
+super + {t,shift + t,s,y}
+ bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
+
+# focus/swap the node in the given direction
+super + {_,shift + }{h,j,k,l}
+ bspc node -{f,s} {west,south,north,east}
+
+# focus the next/previous window in the current desktop
+super + {_,shift + }f
+ bspc node -f {next,prev}.local.!hidden.window
+
+# 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}'
+
+super + {x,c,v,b}
+ bspc desktop -f '^{1,2,3,4}'
+
+super + shift + {x,c,v,b}
+ bspc node -d '^{1,2,3,4}'
+
+# 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 query -N -d | xargs -I id -n 1 bspc node id -p cancel
+
+# 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}
diff --git a/.local/bin/dwm_status.sh b/.local/bin/dwm_status.sh
deleted file mode 100755
index b2faf84..0000000
--- a/.local/bin/dwm_status.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-while true; do
- ram=`free -m | awk 'NR==2{printf "RAM %.2f%%", $3*100/$2}'`
- cpu=`top -bn1 | grep load | awk '{printf "CPU %.2f", $(NF-2)}'`
- clock=`date +"%a %b %d, %r"`
- pkg=`xbps-query -l | wc -l`
- vol=`pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "VOL %s", $5}'`
- xprop -root -set WM_NAME " PKG $pkg $vol $ram $cpu $clock "
- sleep 1
-done &
diff --git a/.local/bin/tsarbar_status.sh b/.local/bin/tsarbar_status.sh
new file mode 100755
index 0000000..dce159f
--- /dev/null
+++ b/.local/bin/tsarbar_status.sh
@@ -0,0 +1,48 @@
+#! /bin/bash
+
+tsarc config -font "CommitMono:pixelsize=15"
+tsarc config -height 17
+tsarc config -bg "#000000"
+tsarc config -gap 10
+
+tsarc set ~ -text "|"
+tsarc set window -bg "#202020"
+tsarc set window -margin 25
+
+tsarc layout -left workspace -center window -right ram ~ vol ~ clock
+
+trap "pkill -P $$" INT
+
+workspace() {
+ focused_ws=`bspc query -D --names -d focused`
+ ws=`bspc query -D --names | tr '\n' ' ' | sed s/$focused_ws/$focused_ws\*/`
+ tsarc set workspace -text " $ws"
+}
+
+window_name() {
+ win_id=$(bspc query -N -n focused)
+ if [[ -n "$win_id" ]]; then
+ title=$(xtitle $win_id)
+ tsarc set window -text "$title"
+ else
+ tsarc set window -text "[...]"
+ fi
+}
+
+bspc subscribe \
+ desktop_focus desktop_add desktop_remove \
+ node_focus node_add node_remove node_transfer \
+| while read -r _; do
+ workspace
+ window_name
+done &
+
+while true; do
+ tsarc set vol -text "VOL `pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "%s", $5}'`"
+done &
+
+while true; do
+ tsarc set clock -text "`date +"%a %b %d, %r"` "
+ tsarc set ram -text "RAM `free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2}'`"
+ sleep 1
+done
diff --git a/.xinitrc b/.xinitrc
index ae0f97b..b6c4ec5 100644
--- a/.xinitrc
+++ b/.xinitrc
@@ -3,11 +3,9 @@ export XDG_SESSION_TYPE="x11"
setxkbmap -layout eu -option grp:caps_toggle
xrandr --output HDMI-A-1 --mode 1920x1080 --rate 240 --primary
-xbanish &
-thunderbird &
+# dwm_status.sh &
+
pipewire &
-dwm_status.sh &
-dunst &
devmon --exec-on-drive "notify-send 'Mounted %f to %d'" &
-xsetroot -solid #FFAACC &
-exec dwm
+sxhkd &
+exec bspwm
diff --git a/.zshrc b/.zshrc
index bde898c..684cf24 100644
--- a/.zshrc
+++ b/.zshrc
@@ -22,5 +22,5 @@ zstyle ":completion:*" menu select
zstyle ":completion:*:*:*:*:descriptions" format "%B%F{green}%d%f"
zstyle ":completion:*" group-name ""
-source .zshextra
+source ~/.zshextra
source `xbps-query -f zsh-syntax-highlighting | grep "zsh-syntax-highlighting.zsh$"`
diff --git a/src/dwm/config.h b/src/dwm/config.h
deleted file mode 100644
index fb9fcb1..0000000
--- a/src/dwm/config.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#include <X11/XF86keysym.h>
-
-/* appearance */
-static const unsigned int borderpx = 2; /* border pixel of windows */
-static const unsigned int snap = 32; /* snap pixel */
-static const int showbar = 1; /* 0 means no bar */
-static const int topbar = 1; /* 0 means bottom bar */
-// static const char *fonts[] = {"Fixed:style=Regular:pixelsize=14:antialias=false"};
-// static const char dmenufont[] = "Fixed:style=Regular:pixelsize=14:antialias=false";
-static const char *fonts[] = {"CommitMono:style=Regular:pixelsize=16:antialias=true"};
-static const char dmenufont[] = "CommitMono:style=Regular:pixelsize=16:antialias=true";
-
-static const char col_bg_active[] = "#202020";
-static const char col_fg_active[] = "#ffffff";
-static const char col_bg_inactive[] = "#000000";
-static const char col_fg_inactive[] = "#ffffff";
-
-static const char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = {col_fg_inactive, col_bg_inactive, col_bg_inactive},
- [SchemeSel] = {col_fg_active, col_bg_active, col_bg_active},
-};
-
-/* tagging */
-static const char *tags[] = {"WWW", "DEV", "GAME", "MISC"};
-#define T(x) (1 << x)
-
-static const Rule rules[] = {
- /* xprop(1):
- * WM_CLASS(STRING) = instance, class
- * WM_NAME(STRING) = title
- */
- /* class instance title tags mask iscentered isfloating monitor */
- {"librewolf", NULL, NULL, T(0), 0, 0, -1},
-};
-
-/* layout(s) */
-static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
-static const int nmaster = 1; /* number of clients in master area */
-static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
-static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
-
-static const Layout layouts[] = {
- /* symbol arrange function */
- {"[M]", monocle},
- {"[]=", tile}, /* first entry is default */
- {"><>", NULL}, /* no layout function means floating behavior */
-};
-
-/* key definitions */
-#define MODKEY Mod4Mask
-#define TAGKEYS(KEY,TAG) \
- {MODKEY, KEY, view, {.ui = 1 << TAG}}, \
- {MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \
- {MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \
- {MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG}},
-
-/* helper for spawning shell commands in the pre dwm-5.0 fashion */
-#define SHCMD(cmd) {.v = (const char*[]){"/bin/sh", "-c", cmd, NULL}}
-
-/* commands */
-static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
-static const char *dmenucmd[] = {"dmenu_run", NULL};
-static const char *termcmd[] = {"st", NULL};
-static const char *sscmd[] = {"screenshot", NULL};
-static const char *pausecmd[] = {"playerctl", "play-pause", NULL};
-static const char *nextcmd[] = {"playerctl", "next", NULL};
-static const char *prevcmd[] = {"playerctl", "previous", NULL};
-static const char *volupcmd[] = {"pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL};
-static const char *vollowcmd[] = {"pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL};
-static const char *volmutecmd[] = {"pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL};
-
-static const Key keys[] = {
- /* modifier key function argument */
- {MODKEY, XK_d, spawn, {.v = dmenucmd}},
- {MODKEY, XK_Return, spawn, {.v = termcmd}},
- {MODKEY|ShiftMask, XK_s, spawn, {.v = sscmd}},
- {MODKEY, XK_j, focusstack, {.i = +1}},
- {MODKEY, XK_k, focusstack, {.i = -1}},
- {MODKEY, XK_i, incnmaster, {.i = +1}},
- {MODKEY, XK_u, incnmaster, {.i = -1}},
- {MODKEY, XK_h, setmfact, {.f = -0.025}},
- {MODKEY, XK_l, setmfact, {.f = +0.025}},
- {0, XF86XK_AudioPrev, spawn, {.v = prevcmd}},
- {0, XF86XK_AudioNext, spawn, {.v = nextcmd}},
- {0, XF86XK_AudioPlay, spawn, {.v = pausecmd}},
- {0, XF86XK_AudioLowerVolume, spawn, {.v = vollowcmd}},
- {0, XF86XK_AudioRaiseVolume, spawn, {.v = volupcmd}},
- {0, XF86XK_AudioMute, spawn, {.v = volmutecmd}},
- {MODKEY, XK_s, zoom, {0}},
- {MODKEY, XK_Tab, view, {0}},
- {MODKEY|ShiftMask, XK_q, killclient, {0}},
- {MODKEY, XK_g, setlayout, {.v = &layouts[0]}},
- {MODKEY, XK_y, setlayout, {.v = &layouts[1]}},
- {MODKEY, XK_f, setlayout, {.v = &layouts[2]}},
- {MODKEY, XK_space, setlayout, {0}},
- {MODKEY, XK_q, togglebar, {0}},
- {MODKEY|ShiftMask, XK_space, togglefloating, {0}},
- {MODKEY, XK_0, view, {.ui = ~0}},
- {MODKEY|ShiftMask, XK_0, tag, {.ui = ~0}},
- {MODKEY, XK_comma, focusmon, {.i = -1}},
- {MODKEY, XK_period, focusmon, {.i = +1}},
- {MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1}},
- {MODKEY|ShiftMask, XK_period, tagmon, {.i = +1}},
- TAGKEYS( XK_c, 0)
- TAGKEYS( XK_v, 1)
- TAGKEYS( XK_b, 2)
- TAGKEYS( XK_x, 3)
- {MODKEY|ShiftMask, XK_e, quit, {0}},
-};
-
-/* button definitions */
-/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
-static const Button buttons[] = {
- /* click event mask button function argument */
- {ClkLtSymbol, 0, Button1, setlayout, {0}},
- // {ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]}},
- // {ClkWinTitle, 0, Button2, zoom, {0}},
- // {ClkStatusText, 0, Button2, spawn, {.v = termcmd}},
- {ClkClientWin, MODKEY, Button1, movemouse, {0}},
- {ClkClientWin, MODKEY, Button2, togglefloating, {0}},
- {ClkClientWin, MODKEY, Button3, resizemouse, {0}},
- // {ClkTagBar, 0, Button1, view, {0}},
- // {ClkTagBar, 0, Button3, toggleview, {0}},
- // {ClkTagBar, MODKEY, Button1, tag, {0}},
- // {ClkTagBar, MODKEY, Button3, toggletag, {0}},
-};
-
diff --git a/update.sh b/update.sh
index 436e8f1..1f7c5d2 100644..100755
--- a/update.sh
+++ b/update.sh
@@ -5,7 +5,6 @@ rm -rf src/
mkdir .config/
mkdir -p .local/bin
mkdir -p src/st
-mkdir -p src/dwm
mkdir -p src/dmenu
cp ~/.xinitrc .
@@ -14,17 +13,20 @@ cp ~/.zlogin .
# Suckless
cp ~/git/st/config.h ./src/st
-cp ~/git/dwm/config.h ./src/dwm
cp ~/git/dmenu/config.h ./src/dmenu
# Neovim
cp -r ~/.config/nvim .config
rm -rf .config/nvim/nvim-pack-lock.json
+# bspwm
+cp -r ~/.config/bspwm .config
+cp -r ~/.config/sxhkd .config
+
# Dunst
cp -r ~/.config/dunst .config
# Terminal Util
cp ~/.local/bin/screenshot ./.local/bin
cp ~/.local/bin/screenrecord ./.local/bin
-cp ~/.local/bin/dwm_status.sh ./.local/bin
+cp ~/.local/bin/tsarbar_status.sh ./.local/bin