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.

{ 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.

{ 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.

{ 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 vanilla fzf 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.

{ 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.

{ 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 br ensures that the keybind enables typing of Brazilian special characters.
  • ⚠️ WARNING ⚠️: This uses xdotool to type, so pressing other keys while the command is being typed is ill-advised:
    • Pressing Super while the command is being written could trigger other keybindings, SHIFT will 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.

{ 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.

{ 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.

{ 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.

{ 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"

{ 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:

{ 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 --tile
The Crypt - World Playground Deceit - More wallpapers


Mobile Wallpapers