Config Scrapyard
Muh dotfiles
dwm keybinds

Search file to edit in Neovim
Super (Windows key) + SHIFT + E opens a terminal window with a fzf menu that lets you select between files from the home directory and its subdirectories.
- You can choose a file to edit in
neovimfrom thefzfmenu, and after you quit, you'll be in the same directory as the selected file.
{ MODKEY|ShiftMask, XK_e, spawn, SHCMD("st -t \"Select file to edit in Neovim\" sh -c 'fl=$(find ~ -type f | fzf); cd \"${fl%/*}\"; nvim \"$fl\"; exec $SHELL'") },

Directory Search
Super (Windows key) + E opens a terminal window with a fzf menu for selecting between folders from the home directory and its subdirectories.
- Much like the neovim keybind but for
cd, search and enter directories instead of editing files.
{ MODKEY, XK_e, spawn, SHCMD("st -t \"Directory search\" sh -c 'cd \"$(find ~ -type d | fzf)\"; printf \"\033]0;st\007\"; exec $SHELL'") },
File Search + Multi-tool
Super (Windows key) + R does basically what the neovim keybinding does except it uses different programs for different file-types.
nsxivfor images (png, jpg/jpeg, webp), It'll also open all the images in the same directory of the selected image- The
grep -v ".cache/nsxiv"part was added to filter out nsxiv cached images mpvfor:- videos (mp4, webm, mkv, avi)
- gifs, looping them
- audios (mp3, flac, wav), looping them, with no video
zathurafor PDFs${BROWSER:-xdg-open}for HTML- Run executables (exe, sh)
Neovimfor other files- I never bothered setting
xdg-openup properly so instead I just use a bunch of variables.
{ MODKEY|ShiftMask, XK_r, spawn, SHCMD("st -t \"Multi-tool\" sh -c 'fl=$(find ~ -type f | grep -v \".cache/nsxiv\" | fzf); cd \"${fl%/*}\"; case \"$fl\" in *.png|*.jpg|*.jpeg|*.webp) nsxiv \"$fl\" \"${fl%/*}\";; *.gif) mpv --loop \"$fl\";; *.mp3|*.flac|*.ogg|*.wav) mpv --no-vid --loop \"$fl\";; *.mp4|*.webm|*.mkv|*.avi) mpv \"$fl\";; *.html) ${BROWSER:-xdg-open} \"$fl\";; *.pdf|*.epub) zathura \"$fl\";; *.exe|*.sh) \"$fl\";; *) nvim \"$fl\";; esac; exec $SHELL'") },
Image previews variant
Using ueberzogen instead of vanillafzf enables image previews with ueberzug, which look cool, as shown in the top screenshot.
{ MODKEY|ShiftMask, XK_z, spawn, SHCMD("st -t \"Multi-tool\" sh -c 'fl=$(echo ~/$(ueberzogen)); cd \"${fl%/*}\"; case \"$fl\" in *.png|*.jpg|*.jpeg|*.webp) nsxiv \"$fl\" \"${fl%/*}\";; *.gif) mpv --loop \"$fl\";; *.mp3|*.flac|*.wav) mpv --no-vid --loop \"$fl\";; *.mp4|*.webm|*.mkv|*.avi) mpv \"$fl\";; *.html) ${BROWSER:-xdg-open} \"$fl\";; *.pdf|*.epub) zathura \"$fl\";; *.exe|*.sh) \"$fl\";; *) nvim \"$fl\";; esac; exec $SHELL'") },

dmenu Emoji Keyboard
Super (Windows key) + SHIFT + D opens a dmenu menu for selecting between emojis on '~/stuff/doc/emojis.txt' to copy to clipboard, based on their names.
- To get the emojis.txt file:
curl -sSL "//unicode.org/Public/emoji/latest/emoji-test.txt" | sed -ne 's/^.*; fully-qualified.*# \(\S*\) \S* \(.*$\)/\1 \2/gp' >"emojis.txt" - You can edit the file to add more emojis or symbols, or edit the ones included.
- You'll need a emoji font (e.g. Noto Color Emoji) to properly see the emojis.
{ MODKEY|ShiftMask, XK_d, spawn, SHCMD("emoji=$(cat ~/stuff/doc/emojis.txt | dmenu -p \"Select emoji to copy:\" -i) && [ -n \"$emoji\" ] && echo \"$emoji\" | awk '{print $1}' | tr -d '/\n' | xclip -selection clipboard") },

History Search
Super (Windows key) + SHIFT + Return (Enter) opens a terminal window with a fzf menu, allowing you to select a command from '~/.cache/zsh/history' to run.
- ⚠️ WARNING ⚠️: This uses
xclipto copy the selected command. Although it preserves the previous clipboard in a variable and restores it after pasting, the clipboard data is lost once the window is closed.
zshby default stores history at~/.zsh_history, but you can change that in the.zshrcusing:HISTFILE="/home/$USER/.cache/zsh/history".- This isn't a replacement for
zsh vimode history search '(ESC + /)', or the shell's!<command>, but this is more convenient in some cases.
{ MODKEY|ShiftMask, XK_Return, spawn, SHCMD("st -t \"History search\" sh -c 'setxkbmap br; clip=\"$(xclip -selection clipboard -o 2>/dev/null)\"; tac ~/.cache/zsh/history | fzf --no-sort -e | tr -d \"\n\" | xclip -selection clipboard; xdotool key ALT+V; clear; printf \"%s\" \"$clip\" | xclip -selection clipboard; printf \"\033]0;st\007\"; exec $SHELL'") },
Older version
- The command
setxkbmap brensures that the keybind enables typing of Brazilian special characters. - ⚠️ WARNING ⚠️: This uses
xdotoolto type, so pressing other keys while the command is being typed is ill-advised: - Pressing
Superwhile the command is being written could trigger other keybindings,SHIFTwill modify the input as expected. - If the focus is moved to another window, the command will be typed there instead of the expected terminal window.
{ MODKEY|ShiftMask, XK_Return, spawn, SHCMD("st -t st sh -c 'setxkbmap br & xdotool type \"$(tac ~/.cache/zsh/history | fzf --no-sort -e)\"; clear; exec $SHELL'") },

Consooming Media
Super (Windows key) + C opens a terminal window with a fzf menu for selecting between media stored at '~/stuff/media/tv'. It simply lists what's in the directory and lets you select what to play on mpv from the fzf menu.
- Works with folders for shows and standalone movies in video formats, or movies inside folders.
- Automatically saves the progress once you quit mpv and ensures playback resumes where it left off.
- Full-screen.
{ MODKEY, XK_c, spawn, SHCMD("st -t \"Select media to play\" sh -c 'cd ~/stuff/media/tv; mpv --fs --save-position-on-quit --no-pause \"$(ls | fzf)\"'") },

Reading Books
Super (Windows key) + SHIFT + C does about the same as the media keybinding but with zathura for files at '~/stuff/media/pdf'.
{ MODKEY|ShiftMask, XK_c, spawn, SHCMD("st -t \"Select book to read\" sh -c 'cd ~/stuff/media/predf; zathura \"$(ls | fzf)\"'") },
Clear Screen
Super (Windows key) + Esc turns off the display (monitor or screen) until you move the mouse or press a key. Occasionally my monitor screen turns white depending on the angle at which I tilt it, so I need this to fix it.
{ MODKEY, XK_Escape, spawn, SHCMD("xset dpms force off") },
Reset Screen
Super (Windows key) + SHIFT + Esc turns the screen back to the normal defaults in case something messed it up.
{ MODKEY|ShiftMask, XK_Escape, spawn, SHCMD("xrandr --output LVDS-1 --mode 1366x768 --brightness 1.0 --gamma 1:1:1") },

Power Menu
Super (Windows key) + F1 runs Luke Smith's sysact dmenu script wich opens a menu with various options like closing dwm, rebooting, shutting down, and turning off the display like my "Clear Screen" kyebinding does.
{ MODKEY, XK_F1, spawn, SHCMD("sysact") },
Older version
Opens a dmenu menu with two options "Shutdown" for turning off the computer and "Restart" for rebooting.
{ MODKEY, XK_F1, spawn, SHCMD("printf \"Shutdown\nRestart\" | dmenu | xargs -r sh -c 'case \"$1\" in Shutdown) sudo poweroff ;; Restart) sudo reboot ;; esac' _") },

dmenu USB Mounting
Super (Windows key) + SHIFT + Backslash opens a dmenu menu listing available USB devices to mount, it assumes all devices starting with /dev/sd that has a '1' and doesn't have sda on it are USBs, which is true in my case.
- Requires
udisks2 - I'll eventually rewrite it and add support to encrypted devices, but it works for now
{ MODKEY|ShiftMask, XK_backslash, spawn, SHCMD("ls /dev/sd* | grep -v sda | grep 1 && dev=$(ls /dev/sd* | grep -v sda | grep 1 | dmenu -p \"Select device to mount:\") && notify-send \"USB Mount successful.\" \"$(udisksctl mount -b $dev)\" && st -t \"USB Storage Device\" sh -c 'cd $(cd /run/media/$USER && realpath $(ls -t | head -n 1)) && exec $SHELL' && notify-send \"USB Unmount successful.\" \"$(udisksctl unmount -b $dev)\" || notify-send 'USB Mount unsuccessful.' 'Error looking up object for device.'") },

Image Selector
Super (Windows key) + Backslash opens a dmenu menu listing all the images on my image directory and the one selected is copied to the clipboard.
- I decided to hide the base image directory
/home/sor/stuff/imgwithsedso only the relevant stuff would show up
{ MODKEY, XK_backslash, spawn, SHCMD("xclip -selection clipboard -t image/preng -i \"$(find ~/stuff/img -type f | grep -v webm | sed 's|/home/sor/stuff/img||g' | dmenu -p \"Select image to copy to clipboard:\" -i -l 5 | sed 's|^|/home/sor/stuff/img/|')\" && notify-send \"Image succesfully copied to clipboard.\"") },

dmenu Music Player
Super (Windows key) + R opens a dmenu menu listing files available on '~/stuff/media/mu', it'll loop the selected file with mpv until you select another song.
- I decided to hide the base music directory
/home/sor/stuff/media/muwith sed so only the relevant stuff would show up - Once a song is selected, it checks for and kills any running
mpvinstances to stop the previous song, so avoid using it while usingmpvfor other purposes. - There's no 'pause', use
killall mpvfor that. - It's just an experiment and I always just use cmus instead. I only made this so I could switch between music to loop while playing vidya, as leaving the fullscreen window would disrupt some games (like Deus Ex and CoD 2) and using
dmenuavoids the need to exit full-screen.
{ MODKEY, XK_r, spawn, SHCMD("song=\"$(find ~/stuff/media/mu -type f | sed 's|/home/sor/stuff/media/mu||g' | dmenu -p \"Select song to loop:\" -i -l 5 | sed 's|^|/home/sor/stuff/media/mu/|')\" && pgrep -x mpv && killall mpv; mpv --loop --no-video \"$song\"") },
Full config.h
Some things need dwm patches to work.
dwm/config.h

slstatus config
Cmus music status
Displays the current song playing on cmus (if running) in the format: "Artist - Song Title ▶️ 0:00-0:00"
- It displays a "▶️" if the song is playing and a "II" if it's paused.
- It also works with untagged music, but the file must be named accordingly, such as
'Lebanon Hanover - Gallowdance.flac' - Set
static const char unknown_str[] = "";inconfig.hto remove slstatus' 'n/a' thing, so that nothing is displayed if cmus isn't running
{ run_command, "%4s ", "pgrep -x cmus > /dev/null && (cmus-remote -C status | grep -q 'tag artist' && echo \"$(cmus-remote -C status | grep -oP '(?<=tag artist ).*') - $(cmus-remote -C status | grep -oP '(?<=tag title ).*') $(cmus-remote -Q | grep 'status ' | awk '{print $2}' | grep -q 'paused' && echo \"II \" || echo \"▶️\") $(cmus-remote -Q | awk '/preosition/ {pos=$2} /duration/ {dur=$2} END {printf \"%d:%02d-%d:%02d\\n\", pos/60, pos%60, dur/60, dur%60}')\" || echo \"$(cmus-remote -C status | grep -oP '(?<=file ).*' | sed 's|.*/||; s|\\.[^.]*$||') $(cmus-remote -Q | grep 'status ' | awk '{print $2}' | grep -q 'paused' && echo \"II \" || echo \"▶️\") $(cmus-remote -Q | awk '/preosition/ {pos=$2} /duration/ {dur=$2} END {printf \"%d:%02d-%d:%02d\\n\", pos/60, pos%60, dur/60, dur%60}')\")" }
Older version
Uses a seperator instead of the playback status and time, as shown in this page's screenshots.
{ run_command, "%4s ", "pgrep -x cmus > /dev/null && (cmus-remote -C status | grep -q 'tag artist' && echo \"$(cmus-remote -C status | grep -oP '(?<=tag artist ).*') - $(cmus-remote -C status | grep -oP '(?<=tag title ).*') |\" || echo \"$(cmus-remote -C status | grep -oP '(?<=file ).*' | sed 's|.*/||; s|\\.[^.]*$||') |\")" },
Network status from Network Manager
Displays network status as:
- "Online" if connected.
- "..." if connecting.
- "Offline" if disconnected.
{ run_command, "%4s ", "nmcli general status | grep -q -w \"connected\" && echo Online || (nmcli general status | grep -q \"connecting\" && echo ... || echo Offline)" },
Sound volume with Amixer
Gets volume percentage from amixer
{ run_command, "Vol: %4s ", "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" },
Pacman package count
Gets package count from pacman
{ run_command, "Pkg:%4s " , "pacman -Qq | wc -l"},
Full config.h
Default commented-out reference examples redacted.
slstatus/config.h
Wallpapers
I've set a randomizer on /etc/xprofile so that when I boot up Xorg, I get a randomly selected wallpaper out of this bunch. Images are hotlinked to avoid DMCA gentoomen.
tile-anon's tiles - Comfy tiling wallpapers. They can be applied using
xwallpaper --tileThe Crypt - World Playground Deceit - More wallpapers











