From d3d4381b296912577550ae1d0310dbc35f7f98cd Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sat, 13 Jan 2024 17:33:24 -0500 Subject: sxhkd housekeeping and debloat --- .config/screenlayout/quick-presentation | 20 +++++++ .config/screenlayout/workstation-dualmon | 3 + .config/screenlayout/workstation-singlemon | 3 + .config/startup/battlestation | 2 +- .config/sxhkd/sxhkdrc | 88 ++++++++---------------------- .local/bin/camtoggle | 5 -- .local/bin/displayselect | 7 +++ .local/bin/ducksearch | 11 ++++ .local/bin/websearch | 31 ----------- .screenlayout/quick-presentation.sh | 20 ------- 10 files changed, 68 insertions(+), 122 deletions(-) create mode 100755 .config/screenlayout/quick-presentation create mode 100755 .config/screenlayout/workstation-dualmon create mode 100755 .config/screenlayout/workstation-singlemon delete mode 100755 .local/bin/camtoggle create mode 100755 .local/bin/displayselect create mode 100755 .local/bin/ducksearch delete mode 100755 .local/bin/websearch delete mode 100755 .screenlayout/quick-presentation.sh diff --git a/.config/screenlayout/quick-presentation b/.config/screenlayout/quick-presentation new file mode 100755 index 0000000..8a8123b --- /dev/null +++ b/.config/screenlayout/quick-presentation @@ -0,0 +1,20 @@ +#!/bin/sh + +mainmon="eDP" + +# List monitors with xrandr +# Keep all linues that contain " connected" +# Remove the main monitor from the list +# Remove all disconnected monitors +# Delete empty lines +# Get the first non-main monitor +# Sanitize the output (keep only the monitor name) +othermon="$(xrandr | grep " connected" | + sed "s/.*$mainmon\s.*//g; + /^$/d; + s/\([A-Z0-9]\+\) .*/\1/g" | + head -n 1)" + +xrandr --output "$mainmon" --auto --output "$othermon" --auto --above "$mainmon" + +makewall diff --git a/.config/screenlayout/workstation-dualmon b/.config/screenlayout/workstation-dualmon new file mode 100755 index 0000000..08c080f --- /dev/null +++ b/.config/screenlayout/workstation-dualmon @@ -0,0 +1,3 @@ +#!/bin/sh +xrandr --output eDP --primary --mode 2256x1504 --pos 2560x0 --rotate normal --output DisplayPort-0 --off --output DisplayPort-1 --off --output DisplayPort-2 --mode 2560x1080 --pos 0x0 --rotate inverted --output DisplayPort-3 --off --output DisplayPort-4 --off --output DisplayPort-5 --off --output DisplayPort-6 --off --output DisplayPort-7 --off +makewall diff --git a/.config/screenlayout/workstation-singlemon b/.config/screenlayout/workstation-singlemon new file mode 100755 index 0000000..e75dd9a --- /dev/null +++ b/.config/screenlayout/workstation-singlemon @@ -0,0 +1,3 @@ +#!/bin/sh +xrandr --output eDP --primary --mode 2256x1504 --pos 0x0 --rotate normal --output DisplayPort-0 --off --output DisplayPort-1 --off --output DisplayPort-2 --off --output DisplayPort-3 --off --output DisplayPort-4 --off --output DisplayPort-5 --off --output DisplayPort-6 --off --output DisplayPort-7 --off +makewall diff --git a/.config/startup/battlestation b/.config/startup/battlestation index ed7355f..c3c5ea2 100644 --- a/.config/startup/battlestation +++ b/.config/startup/battlestation @@ -7,4 +7,4 @@ gentoo-pipewire-launcher & nvidia-settings --load-config-only & # Load stacked dual monitor configuration -$XDG_CONFIG_HOME ~/.screenlayout/battlestation-dualmon.sh & +$XDG_CONFIG_HOME/screenlayout/battlestation-dualmon.sh & diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 5e76133..ad116de 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -25,6 +25,9 @@ ## Quit dwm super + shift + q dwmc quit +## Quit Current/focused App +super + q + kill -15 `xdotool getwindowfocus getwindowpid` ## Toggle the dwm bar super + b dwmc togglebar @@ -108,19 +111,13 @@ super + q ## Change Keyboard Layout alt + Return layouttoggle -## Find your cursor -super + BackSpace - find-cursor -l 4 -c "#66aabb" -s 150 ## Toggle Compositor super + c killall picom || setsid picom -## Toggle Screenkey -super + Insert - killall screenkey || screenkey --bg-color "#222d32" -s small -f "Apercu Mono" -t 1 --font-color "#BABABA" --mods-mode tux ## Open this manual super + alt + shift + h manualgen -## Start colorpicker +## Start colorpicker (Jack12816/colorpicker) super + shift + c colorhandler @@ -131,23 +128,20 @@ super + Return ## Default Browser super + w $BROWSER +## Quickly Search DuckDuckGo +super + shift + w + websearch ## TUI Email Client (neomutt) super + e kill -46 $(pidof dwmblocks) && killall neomutt || $TERMINAL -e neomutt && kill -46 $(pidof dwmblocks) -## TUI calendar (calendar.vim) -super + shift + e - $TERMINAL -t calendar -e nvim -c ":Calendar -view=week -first_day=monday" -## TUI RSS Reader (newsboat) -super + n - killall newsboat || $TERMINAL -e newsboat ; kill -37 $(pidof dwmblocks) #-# Floating Apps/Utilities #-# ## Network Manager XF86WLAN killall nmtui || dropdowntoggle network nmtui -## TUI Audio Mixer (alsamixer) +## TUI Audio Mixer (pulsemixer) super + p - flameshot gui + killall pulsemixer || dropdowntoggle bluetooth pulsemixer ## TODOs (orgmode-nvim) super + space dropdowntoggle orgmode nvim +"Neorg index" @@ -157,32 +151,14 @@ super + a ## Terminal Shell super + shift + a dropdowntoggle shell tmux-shell -## TUI Youtube (youtube-viewer) -super + v - cat ~/.cache/yt-sub | dmenu -p "Query: " | ytfzf -D - -## TUI Hacker News -super + shift + v - killall hacker-news || dropdowntoggle hacker-news tmux-hn -## Webcam -super + shift + w - camtoggle -## Force Start VLC Podcast -super + shift + p - dropdowntoggle Podcast pod-dl #-# Prompts (dmenu) #-# ## Application Launcher -alt + d +super + d j4-dmenu-desktop -## Power Utility -alt + q - sysact -## Quickly Search Google -alt + shift + d - websearch -## Open a bookmark in surf -alt + shift + o - surfmenu +## Display Layout Selector +super + shift + d + displayselect ## Emoji & Font-Awesome Selector alt + grave emoji-copy @@ -192,9 +168,6 @@ alt + {_,shift} + m ## Recording Utility alt + r recordmenu kill || recordmenu -## Preview Fonts -alt + f - fontpreview ## Start SSH session alt + s pickssh @@ -203,17 +176,23 @@ alt + Escape theme="$(ls $HOME/.config/Xresources/ | dmenu)" && cat "$HOME/.config/Xresources/$theme" | xrdb -load #-# PrintScreen Utilities #-# -## Entire Screen +## All displays Print - flamehsot gui + scrot && notify-send -a " Screenshot" "Stitched screenshot completed" ## Current window alt + Print - scrot -q 100 -u -z && notify-send -i "$HOME/.fonts/svg/image.svg" -a Screenshot "Window screenshot completed" + scrot -q 100 -u -z && notify-send -i "$HOME/.fonts/svg/image.svg" -a " Screenshot" "Window screenshot completed" ## Cursor Selection super + Print - scrot -q 100 -s -z && notify-send -i "$HOME/.fonts/svg/image.svg" -a Screenshot "Selection screenshot completed" + scrot -q 100 -s -z && notify-send -i "$HOME/.fonts/svg/image.svg" -a " Screenshot" "Selection screenshot completed" #-# Special Keys #-# +## Control Network Manager +XF86AudioMedia + killall nmtui || dropdowntoggle network nmtui +## Control Bluetooth +shift + XF86AudioMedia + killall bluetuith || dropdowntoggle bluetooth bluetuith ## Increase/decrease Volume {XF86AudioRaiseVolume, XF86AudioLowerVolume} volumectl 1 {+,-} @@ -226,9 +205,6 @@ shift + XF86AudioLowerVolume ## Mute Audio XF86AudioMute volumectl mute -## Quit Current App -super + q - kill -15 `xdotool getwindowfocus getwindowpid` ## Increase/decrease Brightness {XF86MonBrightnessUp, XF86MonBrightnessDown} backlightctl -{i,d} 5 @@ -238,21 +214,6 @@ shift + XF86MonBrightnessUp ## Set Brightness to 5 percent shift + XF86MonBrightnessDown backlightctl -s 0 -## Display Setup Utility (mirror or extend displays) -XF86Display - arandr -## Disable Trackpad -XF86Favorites - trackpadtoggle 0 -## Enable Trackpad -shift + XF86Favorites - trackpadtoggle 1 -## Unmount Devices -shift + XF86Tools - umountmenu -## Mount Devices -XF86Tools - mountmenu #-# Music Controls (using `playerctl`) #-# ## Next/Previous Song (using playerctl) @@ -264,6 +225,3 @@ super + shift + {bracketright, bracketleft} ## Toggle music playback super + backslash playerctl play-pause -# ## Network Manager -# super + shift + n -# killall nmtui || dropdowntoggle network nmtui diff --git a/.local/bin/camtoggle b/.local/bin/camtoggle deleted file mode 100755 index 07cfa2c..0000000 --- a/.local/bin/camtoggle +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -[ "$1" == "" ] && \ -mpv --no-cache --no-osc --no-input-default-bindings --input-conf=/dev/null --title=webcam $(ls /dev/video[0,4,6,8] | tail -n 1) || \ -mpv --no-keepaspect-window --no-cache --no-osc --no-input-default-bindings --input-conf=/dev/null --title=webcam $(ls /dev/video$1 | tail -n 1) -# mpv --no-cache --no-osc --no-input-default-bindings --input-conf=/dev/null --title=webcam $(ls /dev/video[0,2,4,6,8] | tail -n 1) diff --git a/.local/bin/displayselect b/.local/bin/displayselect new file mode 100755 index 0000000..2b87894 --- /dev/null +++ b/.local/bin/displayselect @@ -0,0 +1,7 @@ +#!/bin/sh + +layoutdir="$XDG_CONFIG_HOME/screenlayout" + +layout="$(ls "$layoutdir" | dmenu -p "󰍺 Select layout: ")" + +[ -z "$layout" ] || sh "$layoutdir/$layout" diff --git a/.local/bin/ducksearch b/.local/bin/ducksearch new file mode 100755 index 0000000..d766623 --- /dev/null +++ b/.local/bin/ducksearch @@ -0,0 +1,11 @@ +#!/bin/sh +# Gives a dmenu prompt to search Google. +# Without input, will open Google.com. +# URLs will be directly handed to the browser. +# Anything else, it search it. + +query=$(printf " " | dmenu -i -p " Search DuckDuckGo") + +echo "$query" | head -c 1 + +$BROWSER "https://duckduckgo.com/?q=$query&t=ffab&atb=v1-1" diff --git a/.local/bin/websearch b/.local/bin/websearch deleted file mode 100755 index 2de2c75..0000000 --- a/.local/bin/websearch +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# Gives a dmenu prompt to search Google. -# Without input, will open Google.com. -# URLs will be directly handed to the browser. -# Anything else, it search it. - -query=$(printf " " | dmenu -i -p " Search Google") - -echo "$query" | head -c 1 - -if [ $(echo "$query" | head -c 1) == "\!" ]; then - $BROWSER "https://duckduckgo.com/?q=$query&t=ffab&atb=v1-1" -else - $BROWSER "https://google.com/?q=$query&t=ffab&atb=v1-1" -fi - - -# # pgrep -x dmenu && exit -# # pgrep -x dmenu - -# choice=$(echo "" | dmenu -i -p " Search DuckDuckGo") || exit 1 - -# if [ "$choice" = "" ]; then -# firefox "https://duckduckgo.com" -# else -# if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then -# firefox "$choice" -# else -# firefox "https://duckduckgo.com/?q=$choice&t=ffab&atb=v1-1" -# fi -# fi diff --git a/.screenlayout/quick-presentation.sh b/.screenlayout/quick-presentation.sh deleted file mode 100755 index 8a8123b..0000000 --- a/.screenlayout/quick-presentation.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -mainmon="eDP" - -# List monitors with xrandr -# Keep all linues that contain " connected" -# Remove the main monitor from the list -# Remove all disconnected monitors -# Delete empty lines -# Get the first non-main monitor -# Sanitize the output (keep only the monitor name) -othermon="$(xrandr | grep " connected" | - sed "s/.*$mainmon\s.*//g; - /^$/d; - s/\([A-Z0-9]\+\) .*/\1/g" | - head -n 1)" - -xrandr --output "$mainmon" --auto --output "$othermon" --auto --above "$mainmon" - -makewall -- cgit v1.2.3