diff options
Diffstat (limited to 'dotfiles/dwm')
22 files changed, 287 insertions, 0 deletions
diff --git a/dotfiles/dwm/.gnupg/gpg-agent.conf b/dotfiles/dwm/.gnupg/gpg-agent.conf new file mode 100644 index 0000000..6448665 --- /dev/null +++ b/dotfiles/dwm/.gnupg/gpg-agent.conf @@ -0,0 +1,18 @@ +# Pinentry configuration +pinentry-program /usr/bin/pinentry-dmenu +pinentry-timeout 10 +allow-loopback-pinentry + +# Cache passphrases for entire login session (400 days) +default-cache-ttl 34560000 +max-cache-ttl 34560000 + +# Enable SSH support (use gpg-agent for SSH keys too) +enable-ssh-support + +# Prevent external programs from clearing cache +no-allow-external-cache + +# Keep running even when no connections +keep-display +keep-tty diff --git a/dotfiles/dwm/.gnupg/pinentry-dmenu.conf b/dotfiles/dwm/.gnupg/pinentry-dmenu.conf new file mode 100644 index 0000000..ccd4d55 --- /dev/null +++ b/dotfiles/dwm/.gnupg/pinentry-dmenu.conf @@ -0,0 +1,10 @@ +asterisk= "* "; +prompt = "$"; +font = "BerkeleyMono Nerd Font:size=12"; +prompt_fg = "#eeeeee"; +prompt_bg = "#d9904a"; +normal_fg = "#ffffff"; +normal_bg = "#000000"; +select_fg = "#eeeeee"; +select_bg = "#d9904a"; +desc_fg = "#eeeeee"; diff --git a/dotfiles/dwm/.local/bin/airplanemodetoggle b/dotfiles/dwm/.local/bin/airplanemodetoggle new file mode 100755 index 0000000..038a0d6 --- /dev/null +++ b/dotfiles/dwm/.local/bin/airplanemodetoggle @@ -0,0 +1,33 @@ +#!/bin/bash + +if [ "$(printf "On\\nOff" | dmenu -i -p "Set airplane mode:")" = "On" ] +then + notify-send "Airplane Mode" "Turning on airplane mode...." + sudo systemctl stop bluetooth.service + sudo systemctl stop expressvpn.service + sudo systemctl stop sshd.service + systemctl --user stop syncthing.service + sudo systemctl stop avahi-daemon.service + sudo systemctl stop cronie.service + sudo systemctl stop cups.service + sudo ip link set wlp170s0 down + sudo systemctl stop wpa_supplicant.service + sudo systemctl stop NetworkManager.service + sudo nmcli radio all off + sudo powertop --auto-tune + notify-send "Airplane Mode" "Airplane mode is now on." +else + notify-send "Airplane Mode" "Turning off airplane mode....." + sudo nmcli radio wifi on + sudo systemctl start NetworkManager.service + sudo systemctl start wpa_supplicant.service + sudo ip link set wlp170s0 up + sudo systemctl start bluetooth.service + sudo systemctl start expressvpn.service + sudo systemctl start sshd.service + systemctl --user start syncthing.service + sudo systemctl start avahi-daemon.service + sudo systemctl start cronie.service + sudo systemctl start cups.service + notify-send "Airplane Mode" "Airplane mode is now off." +fi diff --git a/dotfiles/dwm/.local/bin/brightness b/dotfiles/dwm/.local/bin/brightness new file mode 100755 index 0000000..9142f33 --- /dev/null +++ b/dotfiles/dwm/.local/bin/brightness @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Craig Jennings <c@cjennings.net> +# DWM convenience script for changing backlight +# depends on xbacklight + +increment=10 + +case $1 in + "max") + sudo xbacklight -set 100%; + ;; + "min") + sudo xbacklight -set 5%; + ;; + "up") + # get current setting as an int + current=$( printf "%.0f" "$(xbacklight -get)" ) + + # add the increment + newvalue=$(("$current" + "$increment")) + + # don't let the brightness go above 100 + [ "$newvalue" -ge 100 ] && newvalue=100; + + # set the value + xbacklight -set "$newvalue"; + ;; + "down") + current=$( printf "%.0f" "$(xbacklight -get)" ) + newvalue=$(("$current" - "$increment")) + [ "$newvalue" -le 5 ] && newvalue=5; + xbacklight -set "$newvalue"; + ;; +esac +newvalue=$( printf "%.0f" "$(xbacklight -get)") +notify-send "backlight" "backlight now set to $newvalue" diff --git a/dotfiles/dwm/.local/bin/colorpick b/dotfiles/dwm/.local/bin/colorpick new file mode 100755 index 0000000..b5e1aff --- /dev/null +++ b/dotfiles/dwm/.local/bin/colorpick @@ -0,0 +1,6 @@ +#!/bin/sh +# displays colorpicker app +# turns cursor into crosshairs, adds preview at bottom left +# selected color is added to the clipboard + +colorpicker --short --one-shot --preview | xsel -b diff --git a/dotfiles/dwm/.local/bin/dmenuexitmenu b/dotfiles/dwm/.local/bin/dmenuexitmenu new file mode 100755 index 0000000..5570364 --- /dev/null +++ b/dotfiles/dwm/.local/bin/dmenuexitmenu @@ -0,0 +1,12 @@ +#!/bin/sh + +menuitems=("Lock \nSuspend \nLogout \nReboot \nShutdown \nCancel ") +choice=$(echo -e $menuitems | dmenu -nb "#DAA520" -nf "#2E3440" -sb "#2E3440" -sf "#DAA520") + +case "$choice" in + "Logout ") loginctl terminate-user $(whoami) ;; + "Lock ") slock ;; + "Suspend ") systemctl suspend;; + "Shutdown ") systemctl poweroff;; + "Reboot ") systemctl reboot ;; +esac diff --git a/dotfiles/dwm/.local/bin/dmenuunicode b/dotfiles/dwm/.local/bin/dmenuunicode new file mode 100755 index 0000000..b25876f --- /dev/null +++ b/dotfiles/dwm/.local/bin/dmenuunicode @@ -0,0 +1,18 @@ +#!/bin/sh + +# The famous "get a menu of emojis to copy" script. + +# Get user selection via dmenu from emoji file. +chosen=$(cut -d ';' -f1 ~/.local/share/emoji | dmenu -i -l 30 | sed "s/ .*//") + +# Exit if none chosen. +[ -z "$chosen" ] && exit + +# If you run this command with an argument, it will automatically insert the +# character. Otherwise, show a message that the emoji has been copied. +if [ -n "$1" ]; then + xdotool type "$chosen" +else + printf "$chosen" | xclip -selection clipboard + notify-send "'$chosen' copied to clipboard." & +fi diff --git a/dotfiles/dwm/.local/bin/screenshotmenu b/dotfiles/dwm/.local/bin/screenshotmenu new file mode 100755 index 0000000..c899dfc --- /dev/null +++ b/dotfiles/dwm/.local/bin/screenshotmenu @@ -0,0 +1,13 @@ +#!/bin/sh +# Requires maim, xdotool, and dmenu +# Uses dmenu to choose the type of screenshot to take, + +case "$(printf "full screen\\nselected area\\ncurrent window\\nselected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in + "full screen") file="$(date +%Y.%m.%d-%M%S).png" && maim ~/pictures/screenshots/$file && notify-send "Image selection saved to ~/pictures/screenshots/$file" ;; + "full screen (5 sec delay)") file="$(date +%Y.%m.%d-%M%S).png" && sleep 5 && maim ~/pictures/screenshots/$file && notify-send "Image selection saved to ~/pictures/screenshots/$file" ;; + "selected area") file="$(date +%Y.%m.%d-%M%S).png" && maim -s ~/pictures/screenshots/$file && notify-send "Image selection saved to ~/pictures/screenshots/$file" ;; + "current window") maim -i "$(xdotool getactivewindow)" '~/pictures/screenshots/$(date +%Y.%m.%d-%M%S).png' && notify-send "Image selection saved to ~/pictures/screenshots/" ;; + "selected area (copy)") maim -s | xclip -selection clipboard -t image/png && notify-send "Image selection copied to clipboard." ;; + "current window (copy)") maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png && notify-send "Image selection copied to clipboard." ;; + "full screen (copy)") maim | xclip -selection clipboard -t image/png && notify-send "Image copied to clipboard." ;; +esac diff --git a/dotfiles/dwm/.local/bin/toggle-touchpad b/dotfiles/dwm/.local/bin/toggle-touchpad new file mode 100755 index 0000000..9dde99b --- /dev/null +++ b/dotfiles/dwm/.local/bin/toggle-touchpad @@ -0,0 +1,16 @@ +#!/bin/sh +# Toggle touchpad status +# Using libinput and xinput + +# Use xinput list and do a search for touchpads. Then get the first one and get its name. +device="$(xinput list | grep -P '(?<= )[\w\s:]*(?i)(touchpad|synaptics)(?-i).*?(?=\s*id)' -o | head -n1)" + +# If it was activated disable it and if it wasn't disable it +if [[ "$(xinput list-props "$device" | grep -P ".*Device Enabled.*\K.(?=$)" -o)" == "1" ]] +then + xinput disable "$device" + notify-send "Touchpad" "Touchpad disabled" +else + xinput enable "$device" + notify-send "Touchpad" "Touchpad enabled" +fi diff --git a/dotfiles/dwm/.local/bin/wallsearch b/dotfiles/dwm/.local/bin/wallsearch new file mode 100755 index 0000000..f71d150 --- /dev/null +++ b/dotfiles/dwm/.local/bin/wallsearch @@ -0,0 +1,43 @@ +#!/bin/bash + +walldir="$HOME/Pictures/wallpaper/incoming" +tmpdir="$HOME/.wallsearch" +maxpage=5 +tagoptions="CANCEL\n#minimalism\n#digital art\n#4K\n#nature\n#abstract\n#landscape\n#cityscape\n#surf\n#technology" +sortoptions="CANCEL\ndate_added\nrelevance\nrandom\nfavorites\ntoplist" + +if [ -d $tmpdir ]; then + rm -rf $tmpdir +fi +mkdir -p $tmpdir + +if [ -z $1 ]; then + query=$(echo -e $tagoptions | dmenu -p "Search Wallhaven: " -i) +else + query=$1 +fi + +[ $query == "CANCEL" ] && notify-send "Cancelled wallpaper search." && exit 0; + +sorting=$(echo -e $sortoptions | dmenu -p "Sort Order: " -i) + +[ $sorting == "CANCEL" ] && notify-send "Cancelled wallpaper search." && exit 0; + +query="$(sed 's/#//g' <<<$query)" +query="$(sed 's/ /+/g' <<<$query)" +echo #query + +notify-send "wallsearch" "Searching wallpapers..." + +for i in $(seq 1 10); +do + curl -s https://wallhaven.cc/api/v1/search\?atleast\=1920x1080\&sorting\=$sorting\&q\=$query\&purity=111\&page\=$i > tmp.txt + page=$(cat tmp.txt | jq '.' | grep -Eoh "https:\/\/w\.wallhaven.cc\/full\/.*(jpg|png)\b") + wget -nc -P $tmpdir $page + notify-send "wallsearch" "Searching wallpapers..." +done + +rm tmp.txt +notify-send "wallsearch" "Done searching wallpaper." +sxiv -to $tmpdir/* | xargs -I % mv % $walldir +#rm -rf $tmpdir diff --git a/dotfiles/dwm/.local/share/applications/dwm.desktop b/dotfiles/dwm/.local/share/applications/dwm.desktop new file mode 100644 index 0000000..ba3bd00 --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/dwm.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=dwm +Comment=It's fucking DWM, asshole. +Exec=startdwm +Icon=dwm +Type=XSession
\ No newline at end of file diff --git a/dotfiles/dwm/.local/share/applications/emacsclient-mail.desktop b/dotfiles/dwm/.local/share/applications/emacsclient-mail.desktop new file mode 100644 index 0000000..6efcf61 --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/emacsclient-mail.desktop @@ -0,0 +1,20 @@ +[Desktop Entry] +Categories=Network;Email; +Comment=Emacs is my mail client +Exec=sh -c "exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\\\(message-mailto\\\\ \\\\\\"%u\\\\\\"\\\\)" +Icon=emacs +Name=Emacs (Mail, Client) +MimeType=x-scheme-handler/mailto; +NoDisplay=true +Terminal=false +Type=Application +Keywords=emacsclient; +Actions=new-window;new-instance; + +[Desktop Action new-window] +Name=New Window +Exec=/usr/bin/emacsclient --alternate-editor= --create-frame --eval "(message-mailto \\"%u\\")" + +[Desktop Action new-instance] +Name=New Instance +Exec=emacs -f message-mailto %u diff --git a/dotfiles/dwm/.local/share/applications/file.desktop b/dotfiles/dwm/.local/share/applications/file.desktop new file mode 100644 index 0000000..5df1633 --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/file.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=File Manager +Exec=/usr/local/bin/st -e lfub %u diff --git a/dotfiles/dwm/.local/share/applications/img.desktop b/dotfiles/dwm/.local/share/applications/img.desktop new file mode 100644 index 0000000..42aa81e --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/img.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Image viewer +Exec=/usr/bin/sxiv -a %f diff --git a/dotfiles/dwm/.local/share/applications/lock-screen.desktop b/dotfiles/dwm/.local/share/applications/lock-screen.desktop new file mode 100644 index 0000000..2bd7afa --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/lock-screen.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Lock Screen +Comment=Lock the screen +Exec=slock +Icon=system-lock-screen +Type=Application +Categories=System; diff --git a/dotfiles/dwm/.local/share/applications/logout.desktop b/dotfiles/dwm/.local/share/applications/logout.desktop new file mode 100644 index 0000000..8c3bc3a --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/logout.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Logout +Comment=End the current session +Exec=sh -c 'loginctl terminate-session "$XDG_SESSION_ID"' +Icon=system-log-out +Type=Application +Categories=System; diff --git a/dotfiles/dwm/.local/share/applications/mail.desktop b/dotfiles/dwm/.local/share/applications/mail.desktop new file mode 100644 index 0000000..d24aea2 --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/mail.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Mail +Exec=/usr/local/bin/st -e neomutt %u diff --git a/dotfiles/dwm/.local/share/applications/pdf.desktop b/dotfiles/dwm/.local/share/applications/pdf.desktop new file mode 100644 index 0000000..8c38677 --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/pdf.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=PDF reader +Exec=/usr/bin/zathura %u diff --git a/dotfiles/dwm/.local/share/applications/reboot.desktop b/dotfiles/dwm/.local/share/applications/reboot.desktop new file mode 100644 index 0000000..ae2c76e --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/reboot.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Reboot +Comment=Restart the system +Exec=systemctl reboot +Icon=system-reboot +Type=Application +Categories=System; diff --git a/dotfiles/dwm/.local/share/applications/shutdown.desktop b/dotfiles/dwm/.local/share/applications/shutdown.desktop new file mode 100644 index 0000000..2d93aa0 --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/shutdown.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Shutdown +Comment=Power off the system +Exec=systemctl poweroff +Icon=system-shutdown +Type=Application +Categories=System; diff --git a/dotfiles/dwm/.local/share/applications/suspend.desktop b/dotfiles/dwm/.local/share/applications/suspend.desktop new file mode 100644 index 0000000..ab8addf --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/suspend.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Suspend +Comment=Suspend the system to RAM +Exec=systemctl suspend +Icon=system-suspend +Type=Application +Categories=System; diff --git a/dotfiles/dwm/.local/share/applications/text.desktop b/dotfiles/dwm/.local/share/applications/text.desktop new file mode 100644 index 0000000..41ee05f --- /dev/null +++ b/dotfiles/dwm/.local/share/applications/text.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Text editor +Exec=/usr/local/bin/st -e nvim %u |
