Skip to content

Commit beffcf5

Browse files
author
Ronan Maharaj
committedApr 27, 2023
haven't pushed in a while
1 parent 27e79aa commit beffcf5

22 files changed

+30562
-2285
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
-- Add highlight groups in any theme
2+
return {
3+
BufferLineTabClose = { fg = "#1e222a", bg = "#1e222a" },
4+
BufferLineBufferSelected = { fg = "#abb2bf", bg = "#1e222a" },
5+
NormalNC = { fg = "#abb2bf", bg = "#1e222a" },
6+
WinBar = { fg = "#5c6370", bg = "#1e222a" },
7+
WinBarNC = { fg = "#5c6370", bg = "#1e222a" },
8+
--VS code cmp
9+
CmpItemKindConstructor = { fg = "#f28b25" },
10+
CmpItemKindUnit = { fg = "#D4D4D4" },
11+
CmpItemKindProperty = { fg = "#D4D4D4" },
12+
CmpItemKindKeyword = { fg = "#D4D4D4" },
13+
CmpItemKindMethod = { fg = "#C586C0" },
14+
CmpItemKindFunction = { fg = "#C586C0" },
15+
CmpItemKindColor = { fg = "#C586C0" },
16+
CmpItemKindText = { fg = "#9CDCFE" },
17+
CmpItemKindInterface = { fg = "#9CDCFE" },
18+
CmpItemKindVariable = { fg = "#9CDCFE" },
19+
CmpItemKindField = { fg = "#9CDCFE" },
20+
CmpItemKindValue = { fg = "#9CDCFE" },
21+
CmpItemKindEnum = { fg = "#9CDCFE" },
22+
CmpItemKindEnumMember = { fg = "#9CDCFE" },
23+
CmpItemKindStruct = { fg = "#9CDCFE" },
24+
CmpItemKindReference = { fg = "#9CDCFE" },
25+
CmpItemKindTypeParameter = { fg = "#9CDCFE" },
26+
CmpItemKindSnippet = { fg = "#D4D4D4" },
27+
CmpItemKindClass = { fg = "#f28b25" },
28+
CmpItemKindModule = { fg = "#D4D4D4" },
29+
CmpItemKindOperator = { fg = "#D4D4D4" },
30+
CmpItemKindConstant = { fg = "#D4D4D4" },
31+
CmpItemKindFile = { fg = "#D4D4D4" },
32+
CmpItemKindFolder = { fg = "#D4D4D4" },
33+
CmpItemKindEvent = { fg = "#D4D4D4" },
34+
CmpItemAbbrMatch = { fg = "#18a2fe", bold = true },
35+
CmpItemAbbrMatchFuzzy = { fg = "#18a2fe", bold = true },
36+
CmpItemMenu = { fg = "#777d86" },
37+
-- VS code tree
38+
AerialArrayIcon = { fg = "" },
39+
AerialClassIcon = { fg = "#f28b25" },
40+
AerialConstantIcon = { fg = "#D4D4D4" },
41+
AerialConstructorIcon = { fg = "#f28b25" },
42+
AerialEnumIcon = { fg = "#9CDCFE" },
43+
AeiralEnumMember = { fg = "#9CDCFE" },
44+
AerialEventIcon = { fg = "#D4D4D4" },
45+
AerialFieldIcon = { fg = "#9CDCFE" },
46+
AerialFileIcon = { fg = "#D4D4D4" },
47+
AerialFunctionIcon = { fg = "#C586C0" },
48+
AerialInterfaceIcon = { fg = "#9CDCFE" },
49+
AerialKeyIcon = { fg = "#D4D4D4" },
50+
AerialMethodIcon = { fg = "#C586C0" },
51+
AerialModuleIcon = { fg = "#D4D4D4" },
52+
AerialNamespaceIcon = { fg = "#D4D4D4" },
53+
AerialNullIcon = { fg = "#D4D4D4" },
54+
AerialNumberIcon = { fg = "#D4D4D4" },
55+
AerialObjectIcon = { fg = "#f28b25" },
56+
AerialOperatorIcon = { fg = "#D4D4D4" },
57+
AerialPackageIcon = { fg = "#D4D4D4" },
58+
AerialPropertyIcon = { fg = "#D4D4D4" },
59+
AerialStringIcon = { fg = "#9CDCFE" },
60+
AerialStructIcon = { fg = "#f28b25" },
61+
AerialTypeParameter = { fg = "#9CDCFE" },
62+
AerialVariableIcon = { fg = "#9CDCFE" },
63+
-- Spell
64+
SpellBad = { sp = "#ffbba6", undercurl = true },
65+
SpellCap = { sp = "#ffbba6", undercurl = true },
66+
SpellLocal = { sp = "#ffbba6", undercurl = true },
67+
SpellRare = { sp = "#ffbba6", undercurl = true },
68+
-- Inlay hint
69+
LspInlayHint = { fg = "#777d86" },
70+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Virtualization
2+
Xv6
3+
xv6
4+
Consummatory
5+
Verilog
6+
malloc
7+
villagization
8+
Lateralization
9+
Wernicke's
10+
Broch's
11+
Spellbook
12+
Oblongata
13+
Stereotaxic
14+
stereotaxic
15+
Kayapo
16+
Belo
17+
quantifiably
18+
Automata
19+
automata
20+
predesigned
21+
Normativity
22+
Deontology
23+
hyperparameters
24+
hyperparameter
428 Bytes
Binary file not shown.
584 KB
Binary file not shown.

‎dot_config/nvim/lua/user/spell/mthesaur.txt

+30,260
Large diffs are not rendered by default.

‎dot_config/wlogout/layout

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"label" : "lock",
3+
"action" : "~/.local/bin/lock",
4+
"text" : "Lock",
5+
"keybind" : "l"
6+
}
7+
{
8+
"label" : "shutdown",
9+
"action" : "sudo poweroff",
10+
"text" : "Shutdown",
11+
"keybind" : "s"
12+
}
13+
{
14+
"label" : "reboot",
15+
"action" : "sudo reboot",
16+
"text" : "Reboot",
17+
"keybind" : "r"
18+
}

‎dot_config/zsh/dot_zcompdump

-2,033
This file was deleted.

‎dot_config/zsh/dot_zshrc

+7-2
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,17 @@ bindkey -M visual '^[[P' vi-delete
7373

7474

7575
eval "$(zoxide init zsh)"
76-
eval "$(starship init zsh)"
76+
# Pure
77+
PURE_PROMPT_SYMBOL="󰘧"
78+
fpath+=($ZDOTDIR/plugins/pure)
79+
autoload -U promptinit; promptinit
80+
prompt pure
7781

7882
# Load syntax highlighting; should be last.
7983
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
8084
source $ZDOTDIR/plugins/* 2>/dev/null
8185

8286
if [ "$(tty)" = "/dev/tty1" ]; then
83-
~/.local/bin/swaylaunch
87+
startx "$XINITRC"
88+
# ~/.local/bin/swaylaunch
8489
fi

‎private_dot_local/bin/executable_booksplit

+3-6
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@ escbook="$(echo "$booktitle" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:pun
2222
total="$(wc -l < "$2")"
2323

2424
cmd="ffmpeg -i \"$inputaudio\" -nostdin -y"
25-
posthook=""
2625

2726
while read -r x;
2827
do
29-
end="$(echo "$x" | cut -d' ' -f1)"
28+
end="$(echo "$x" | cut -d' ' -f1)"
3029
file="$escbook/$(printf "%.2d" "$track")-$esctitle.$ext"
3130
if [ -n "$start" ]; then
32-
[ "$ext" == "opus" ] && posthook="$posthook opustags -s title=\"$title\" -i $file ;"
33-
cmd="$cmd -metadata artist=\"$author\" -metadata title=\"$title\" -metadata album=\"$booktitle\" -metadata year=\"$year\" -metadata track=\"$track\" -metadata total=\"$total\" -ss \"$start\" -to \"$end\" -vn -c:a copy \"$file\" "
31+
cmd="$cmd -metadata artist=\"$author\" -metadata title=\"$title\" -metadata album=\"$booktitle\" -metadata year=\"$year\" -metadata track=\"$track\" -metadata total=\"$total\" -ss \"$start\" -to \"$end\" -vn -c:a copy \"$file\" "
3432
fi
35-
title="$(echo "$x" | cut -d' ' -f2-)"
33+
title="$(echo "$x" | cut -d' ' -f2-)"
3634
esctitle="$(echo "$title" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
3735
track="$((track+1))"
3836
start="$end"
@@ -43,4 +41,3 @@ file="$escbook/$(printf "%.2d" "$track")-$esctitle.$ext"
4341
cmd="$cmd -metadata artist=\"$author\" -metadata title=\"$title\" -metadata album=\"$booktitle\" -metadata year=\"$year\" -metadata track=\"$track\" -ss \"$start\" -vn -c copy \"$file\""
4442

4543
eval "$cmd"
46-
eval "$posthook"

‎private_dot_local/bin/executable_compiler

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ case "$ext" in
3939
java) javac -d classes "$file" && java -cp classes "${1%.*}" ;;
4040
m) octave "$file" ;;
4141
md) if [ -x "$(command -v lowdown)" ]; then
42-
lowdown --parse-no-intraemph "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf
42+
lowdown --parse-no-intraemph "$file" -Tms | groff -mpdfmark -ms -kept -T pdf > "$base".pdf
4343
elif [ -x "$(command -v groffdown)" ]; then
44-
groffdown -i "$file" | groff > "$base.pdf"
44+
groffdown -i "$file" | groff -T pdf > "$base".pdf
4545
else
4646
pandoc -t ms --highlight-style=kate -s -o "$base".pdf "$file"
4747
fi ; ;;
@@ -51,7 +51,7 @@ case "$ext" in
5151
py) python "$file" ;;
5252
[rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;;
5353
rs) cargo build ;;
54-
sass) sassc -a "$file" "$base.css" ;;
54+
sass) sassc -a "$file" "$base".css ;;
5555
scad) openscad -o "$base".stl "$file" ;;
5656
sent) setsid -f sent "$file" 2>/dev/null ;;
5757
tex) textype "$file" ;;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/bin/sh
2+
3+
# A UI for detecting and selecting all displays. Probes xrandr for connected
4+
# displays and lets user select one to use. User may also select "manual
5+
# selection" which opens arandr.
6+
7+
twoscreen() { # If multi-monitor is selected and there are two screens.
8+
9+
mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?")
10+
# Mirror displays using native resolution of external display and a scaled
11+
# version for the internal display
12+
if [ "$mirror" = "yes" ]; then
13+
external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:")
14+
internal=$(echo "$screens" | grep -v "$external")
15+
16+
res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \
17+
tail -n 1 | awk '{print $1}')
18+
res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \
19+
tail -n 1 | awk '{print $1}')
20+
21+
res_ext_x=$(echo "$res_external" | sed 's/x.*//')
22+
res_ext_y=$(echo "$res_external" | sed 's/.*x//')
23+
res_int_x=$(echo "$res_internal" | sed 's/x.*//')
24+
res_int_y=$(echo "$res_internal" | sed 's/.*x//')
25+
26+
scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l)
27+
scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l)
28+
29+
xrandr --output "$external" --auto --scale 1.0x1.0 \
30+
--output "$internal" --auto --same-as "$external" \
31+
--scale "$scale_x"x"$scale_y"
32+
else
33+
34+
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
35+
secondary=$(echo "$screens" | grep -v "$primary")
36+
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
37+
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0
38+
fi
39+
}
40+
41+
morescreen() { # If multi-monitor is selected and there are more than two screens.
42+
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
43+
secondary=$(echo "$screens" | grep -v "$primary" | dmenu -i -p "Select secondary display:")
44+
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
45+
tertiary=$(echo "$screens" | grep -v "$primary" | grep -v "$secondary" | dmenu -i -p "Select third display:")
46+
xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto
47+
}
48+
49+
multimon() { # Multi-monitor handler.
50+
case "$(echo "$screens" | wc -l)" in
51+
2) twoscreen ;;
52+
*) morescreen ;;
53+
esac ;}
54+
55+
onescreen() { # If only one output available or chosen.
56+
xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "\b$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -)
57+
}
58+
59+
postrun() { # Stuff to run to clean up.
60+
setbg # Fix background if screen size/arangement has changed.
61+
{ killall dunst ; setsid -f dunst ;} >/dev/null 2>&1 # Restart dunst to ensure proper location on screen
62+
}
63+
64+
# Get all possible displays
65+
allposs=$(xrandr -q | grep "connected")
66+
67+
# Get all connected screens.
68+
screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
69+
70+
# If there's only one screen
71+
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
72+
{ onescreen "$screens"; postrun; notify-send "💻 Only one screen detected." "Using it in its optimal settings..."; exit ;}
73+
74+
# Get user choice including multi-monitor and manual selection:
75+
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&
76+
case "$chosen" in
77+
"manual selection") arandr ; exit ;;
78+
"multi-monitor") multimon ;;
79+
*) onescreen "$chosen" ;;
80+
esac
81+
82+
postrun

‎private_dot_local/bin/executable_dl.bak

-146
This file was deleted.

‎private_dot_local/bin/executable_khutil

-35
This file was deleted.

‎private_dot_local/bin/executable_maimpick

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66

77
# variables
88
output="$(date '+%y%m%d-%H%M-%S').png"
9-
command -v xdg-user-dir && output="$(xdg-user-dir SCREENSHOTS)/$output"
109
xclip_cmd="xclip -sel clip -t image/png"
1110

1211
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
13-
"a selected area") maim -s "$output" ;;
14-
"current window") maim -q -d 0.2 -i "$(xdotool getactivewindow)" "${output}" ;;
15-
"full screen") maim -q -d 0.2 "${output}" ;;
16-
"a selected area (copy)") maim -s | ${xclip_cmd} ;;
12+
"a selected area") maim -u -s pic-selected-"${output}" ;;
13+
"current window") maim -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;;
14+
"full screen") maim -q -d 0.2 pic-full-"${output}" ;;
15+
"a selected area (copy)") maim -u -s | ${xclip_cmd} ;;
1716
"current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
1817
"full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;;
1918
esac

‎private_dot_local/bin/executable_newsup

-15
This file was deleted.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# opout: "open output": A general handler for opening a file's intended output,
4+
# usually the pdf of a compiled document. I find this useful especially
5+
# running from vim.
6+
7+
basename="${1%.*}"
8+
9+
case "${*}" in
10+
*.tex|*.sil|*.m[dse]|*.[rR]md|*.mom|*.[0-9]) target="$(getcomproot "$1" || echo "$1")" ; setsid -f xdg-open "${target%.*}".pdf >/dev/null 2>&1 ;;
11+
*.html) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;;
12+
*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;;
13+
esac

‎private_dot_local/bin/executable_remaps

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# Decrease key repeat delay to 300ms and increase key repeat rate to 50 per second.
55
xset r rate 300 50
66
# Map the caps lock key to super, and map the menu key to right super.
7-
setxkbmap -option caps:escape,altwin:menu_win
7+
setxkbmap -option caps:super,altwin:menu_win
88
# When caps lock is pressed only once, treat it as escape.
99
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
1010
# Turn off caps lock if on since there is no longer a key for it.
11-
xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock
11+
xset -q | grep -q "Caps Lock:\s*on" && xdotool key Caps_Lock
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
if echo "$1" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" ; then
4+
url="$1"
5+
else
6+
url="$(grep -Eom1 '<[^>]+(rel="self"|application/[a-z]+\+xml)[^>]+>' "$1" |
7+
grep -o "https?://[^\" ]")"
8+
9+
echo "$url" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" ||
10+
notify-send "That doesn't look like a full URL." && exit 1
11+
fi
12+
13+
RSSFILE="${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls"
14+
if awk '{print $1}' "$RSSFILE" | grep "^$url$" >/dev/null; then
15+
notify-send "You already have this RSS feed."
16+
else
17+
echo "$url" >> "$RSSFILE" && notify-send "RSS feed added."
18+
fi

‎private_dot_local/bin/executable_sd

+16-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22

33
# Open a terminal window in the same directory as the currently active window.
44

5-
PID=$(xprop -id "$(xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p")
6-
PID=$(pstree -lpATna "$PID" | grep -v '\-\(lf,[0-9]\+ -server\|(st-urlhandler,[0-9]\+)\|xclip,[0-9]\+\)' | sed '$s/.*,\([0-9]\+\).*/\1/;t;d')
7-
cwd=$(readlink /proc/"$PID"/cwd)
5+
windowPID=$(xprop -id "$(xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p")
6+
PIDlist=$(pstree -lpATna "$windowPID" | sed -En 's/.*,([0-9]+).*/\1/p' | tac)
7+
for PID in $PIDlist; do
8+
cmdline=$(ps -o args= -p "$PID")
9+
process_group_leader=$(ps -o comm= -p "$(ps -o pgid= -p "$PID" | tr -d ' ')")
10+
cwd=$(readlink /proc/"$PID"/cwd)
11+
# zsh and lf won't be ignored even if it shows ~ or /
12+
case "$cmdline" in
13+
'lf -server') continue ;;
14+
"${SHELL##*/}"|'lf'|'lf '*) break ;;
15+
esac
16+
# git (and its sub-processes) will show the root of a repository instead of the actual cwd, so they're ignored
17+
[ "$process_group_leader" = 'git' ] || [ ! -d "$cwd" ] && continue
18+
# This is to ignore programs that show ~ or / instead of the actual working directory
19+
[ "$cwd" != "$HOME" ] && [ "$cwd" != '/' ] && break
20+
done
821
[ "$PWD" != "$cwd" ] && [ -d "$cwd" ] && { cd "$cwd" || exit 1; }
922
"$TERMINAL"
10-
+18-24
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
11
#!/bin/sh
2+
23
# This script does the following:
34
# Run by itself, set the wallpaper (at X start).
45
# If given a file, set that as the new wallpaper.
56
# If given a directory, choose random file in it.
7+
# If wal is installed, also generates a colorscheme.
68

7-
walls="$HOME/images/walls"
9+
# Location of link to wallpaper link.
810
bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
9-
# if the size of the image is smaller than this, tile the wallpaper
10-
tilesize=300
11+
12+
# Configuration files of applications that have their themes changed by pywal.
13+
dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
14+
zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
1115

1216
trueloc="$(readlink -f "$1")" &&
1317
case "$(file --mime-type -b "$trueloc")" in
14-
image/* )
15-
ln -sf "$(readlink -f "$1")" "$bgloc"
16-
notify-send -t 1000 -i "$bgloc" "Changing wallpaper..."
17-
;;
18-
inode/directory )
19-
ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc";
20-
notify-send -t 1000 -i "$bgloc" "Random Wallpaper chosen."
21-
;;
22-
*) notify-send "Error" "Not a valid image." ; exit 1;;
18+
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
19+
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
20+
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
2321
esac
2422

25-
23+
# If pywal is installed, use it.
2624
if command -v wal >/dev/null 2>&1 ; then
2725
wal -n -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1
28-
fi
29-
30-
if [ -z "$WAYLAND_DISPLAY" ]; then
31-
mode='zoom'
32-
read w h <<< `identify -format '%w %h' "$bgloc"`
33-
[ "$w" -lt "$tilesize" ] && [ "$h" -lt "$tilesize" ] && mode='tile'
34-
xwallpaper --$mode "$bgloc"
26+
# If pywal is removed, return config files to normal.
3527
else
36-
pidof -s sway >/dev/null 2>&1 && {
37-
pidof -s swaybg && pkill swaybg
38-
swaybg -m fill -i "$bgloc"
39-
} >/dev/null 2>&1
28+
[ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf"
29+
[ -f "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf"
4030
fi
31+
32+
xwallpaper --zoom "$bgloc"
33+
# If running, dwm hit the key to refresh the color scheme.
34+
pidof dwm >/dev/null && xdotool key super+F5

‎private_dot_local/bin/executable_sysact

+12-10
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ case "$(readlink -f /sbin/init)" in
88
esac
99

1010
wmpid(){ # This function is needed if there are multiple instances of the window manager.
11-
pidof "$WM"
11+
tree="$(pstree -ps $$)"
12+
tree="${tree#*$WM(}"
13+
echo "${tree%%)*}"
1214
}
1315

14-
case "$(printf " lock\n󰠛 leave $WM\n renew $WM\n󰿑 hibernate\n reboot\n poweroff\n󰒲 sleep\n󰛧 display off" | rofi -dmenu -i -p 'Action: ')" in
15-
' lock') slock ;;
16-
"󰠛 leave $WM") kill -TERM "$(wmpid)" ;;
17-
" renew $WM") kill -HUP "$(wmpid)" ;;
18-
'󰿑 hibernate') slock $ctl hibernate -i ;;
19-
'󰒲 sleep') slock $ctl suspend -i ;;
20-
' reboot') $ctl reboot -i ;;
21-
' poweroff') $ctl poweroff -i ;;
22-
'󰛧 display off') xset dpms force off ;;
16+
case "$(printf "🔒 lock\n🚪 leave $WM\n♻️ renew $WM\n🐻 hibernate\n🔃 reboot\n🖥️shutdown\n💤 sleep\n📺 display off" | dmenu -i -p 'Action: ')" in
17+
'🔒 lock') slock ;;
18+
"🚪 leave $WM") kill -TERM "$(wmpid)" ;;
19+
"♻️ renew $WM") kill -HUP "$(wmpid)" ;;
20+
'🐻 hibernate') slock $ctl hibernate -i ;;
21+
'💤 sleep') slock $ctl suspend -i ;;
22+
'🔃 reboot') $ctl reboot -i ;;
23+
'🖥️shutdown') $ctl poweroff -i ;;
24+
'📺 display off') xset dpms force off ;;
2325
*) exit 1 ;;
2426
esac
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# If transmission-daemon is running, will ask to kill, else will ask to start.
4+
5+
if pidof transmission-daemon >/dev/null ;
6+
then
7+
[ "$(printf "No\\nYes" | dmenu -i -p "Turn off transmission-daemon?")" = "Yes" ] && killall transmission-daemon && notify-send "transmission-daemon disabled."
8+
else
9+
ifinstalled transmission-cli || exit
10+
[ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "transmission-daemon enabled."
11+
fi
12+
sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}"

0 commit comments

Comments
 (0)
Please sign in to comment.