Compare commits

...

22 Commits

Author SHA1 Message Date
warthog18
783c3a20fd
Merge 72537055943cbece5626f09055bc2219b67a314a into 628ed4dc995f3c09e33c24a01c817c18b1a268af 2024-07-16 16:39:08 +03:00
Luke Smith
628ed4dc99
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2024-07-15 13:46:42 -04:00
Luke Smith
a9cde940c2
close #1292 2024-07-15 13:46:30 -04:00
fennomaani
779ef2f5fe
Update mpd to use PipeWire (#1412)
per https://wiki.archlinux.org/title/Music_Player_Daemon#Audio_configuration
2024-07-15 17:37:38 +00:00
Kipras Melnikovas
131dcce268
shortcuts: export env vars for each shortcut (#1395)
useful if want to use shortcuts w/ different progs instead of
their default behavior (cd / $EDITOR), e.g.:

```sh
cd ~/Downloads
mv foo.mp3 $music
```

Co-authored-by: Luke Smith <luke@lukesmith.xyz>
2024-07-15 17:37:04 +00:00
appeasementPolitik
368d3583a6
weath: Add option to get forecast from a different location (#1327)
* weath: Add option to get forecast from a different location

* Remove retry and make max time lower because it is interactive

* Give weath 'cp' option to copy forecast as plain text for sharing

* Make weath a separate script
2024-07-15 17:28:50 +00:00
Luke Smith
cf38cd5ba8
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2024-07-15 13:20:34 -04:00
Luke Smith
82ddcd87ec
Merge branch 'ArgusGuardian-patch-1' 2024-07-15 13:20:26 -04:00
Luke Smith
c771c66b18
filename and exec fix 2024-07-15 13:20:18 -04:00
Luke Smith
d56ca0c95b
Merge branch 'patch-1' of https://github.com/ArgusGuardian/voidrice into ArgusGuardian-patch-1 2024-07-15 13:18:44 -04:00
Emre AKYÜZ
22141ca754
[texclear] - minimize | streamline (#1390) 2024-07-15 17:18:02 +00:00
Visrut
b4b462029c
shortcuts: zathura full screen mode shortcuts should work as before (#1396)
* shortcuts work in full-screen mode

* update wal template
2024-07-15 17:15:55 +00:00
zetef
e8ba78c518
Fix sb-volume (toggle mute, scroll volume change) (#1411)
the current wpctl version does not support @DEFAULT_AUDIO_SINK@, but works with @DEFAULT_SINK@

quick fix
2024-07-15 17:14:25 +00:00
Luke Smith
dda032a37d
close #1416 2024-07-15 13:12:36 -04:00
Luke Smith
e64728177b
Merge branch 'thetubster99-tiny-fixes' 2024-07-15 13:04:52 -04:00
Luke Smith
e1bfc20f96
Merge branch 'tiny-fixes' of https://github.com/thetubster99/cookedrice into thetubster99-tiny-fixes 2024-07-15 13:04:42 -04:00
Luke Smith
6556ef5c4d
close #1423 2024-07-15 13:02:59 -04:00
thetubster99
7a9bfe6f69
Tiny fix and optimization 2024-05-23 22:23:16 +00:00
Alaa Eddine
534348e0b6 ditch brightnessctl, more minimalistic 2024-05-05 18:37:51 +01:00
Alaa Eddine
3fb60852de
Create sb-bghitness, show brightness in the bar.
script to add brightness to the dwmblocks.
2024-05-03 12:23:53 +01:00
warthog18
7253705594
Merge pull request #1 from warthog18/warthog18-bookmarkthis
Added bookmarkthis script
2022-11-11 23:53:58 +01:00
warthog18
5a3a9936b6
Added bookmarkthis script
Adding bookmarkscript by Luke Smith, shown in YT video "Bookmarking for Unix Chads..."... what do you think?
2022-11-11 23:51:00 +01:00
18 changed files with 113 additions and 34 deletions

View File

@ -172,7 +172,7 @@ map U $printf "%s" "$fx" | xclip -selection clipboard
map u $printf "%s" "$fx" | sed 's/.*\///' | xclip -selection clipboard
map . $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
map <gt> $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/piped.video\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
map T $sxiv -t "$(pwd)" # opens thumbnail mode
map T $nsxiv -t "$(pwd)" # opens thumbnail mode
map <c-l> unselect

View File

@ -19,11 +19,11 @@ image() {
case "$(file --dereference --brief --mime-type -- "$1")" in
image/avif) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
[ ! -f "$CACHE" ] && convert "$1" "$CACHE.jpg"
[ ! -f "$CACHE" ] && magick "$1" "$CACHE.jpg"
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
image/vnd.djvu)
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
[ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | convert -density 200 - "$CACHE.jpg" > /dev/null 2>&1
[ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | magick -density 200 - "$CACHE.jpg" > /dev/null 2>&1
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
image/svg+xml)
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
@ -32,7 +32,7 @@ image/svg+xml)
;;
image/x-xcf)
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')"
[ ! -f "$CACHE.jpg" ] && convert "$1[0]" "$CACHE.jpg"
[ ! -f "$CACHE.jpg" ] && magick "$1[0]" "$CACHE.jpg"
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
;;
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;

View File

@ -7,10 +7,8 @@ restore_paused "yes"
max_output_buffer_size "16384"
audio_output {
type "pulse"
name "pulse"
#type "alsa"
#name "ALSA"
type "pipewire"
name "PipeWire Sound Server"
}
audio_output {

View File

@ -14,11 +14,11 @@ do
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
;;
"r")
convert -rotate 90 "$file" "$file" ;;
magick -rotate 90 "$file" "$file" ;;
"R")
convert -rotate -90 "$file" "$file" ;;
magick -rotate -90 "$file" "$file" ;;
"f")
convert -flop "$file" "$file" ;;
magick -flop "$file" "$file" ;;
"y")
printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
notify-send "$file copied to clipboard" & ;;

View File

@ -16,7 +16,7 @@ done; unset command
se() {
choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)"
[ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice"
;}
}
# Verbosity and settings that you pretty much just always are going to want.
alias \
@ -57,5 +57,4 @@ alias \
alias \
lf="lfub" \
magit="nvim -c MagitOnly" \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"

View File

@ -13,6 +13,16 @@ map J zoom out
map i recolor
map p print
map g goto top
map [fullscreen] u scroll half-up
map [fullscreen] d scroll half-down
map [fullscreen] D toggle_page_mode
map [fullscreen] r reload
map [fullscreen] R rotate
map [fullscreen] K zoom in
map [fullscreen] J zoom out
map [fullscreen] i recolor
map [fullscreen] p print
map [fullscreen] g goto top
set default-bg "{background}"
set default-fg "{foreground}"

View File

@ -13,3 +13,13 @@ map J zoom out
map i recolor
map p print
map g goto top
map [fullscreen] u scroll half-up
map [fullscreen] d scroll half-down
map [fullscreen] D toggle_page_mode
map [fullscreen] r reload
map [fullscreen] R rotate
map [fullscreen] K zoom in
map [fullscreen] J zoom out
map [fullscreen] i recolor
map [fullscreen] p print
map [fullscreen] g goto top

View File

@ -15,6 +15,7 @@ setopt inc_append_history
# Load aliases and shortcuts if existent.
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"

11
.local/bin/bookmarkthis Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
bookmark="$(xclip -o)"
file="$HOME/.local/share/larbs/snippets"
if grep "^$bookmark$" "$file"; then
notify-send "Oops." "Already bookmarked!"
else
notify-send "Bookmark added!" "$bookmark is now saved to the file."
echo "$bookmark" >> "$file"
fi

View File

@ -9,12 +9,12 @@ output="$(date '+%y%m%d-%H%M-%S').png"
xclip_cmd="xclip -sel clip -t image/png"
ocr_cmd="xclip -sel clip"
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\nOCR a selected area (copy)" | dmenu -l 7 -i -p "Screenshot which area?")" in
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\ncopy selected image to text" | dmenu -l 7 -i -p "Screenshot which area?")" in
"a selected area") maim -u -s pic-selected-"${output}" ;;
"current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;;
"full screen") maim -q -d 0.2 pic-full-"${output}" ;;
"a selected area (copy)") maim -u -s | ${xclip_cmd} ;;
"current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
"full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;;
"a selected area (OCR)") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;;
"copy selected image to text") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;;
esac

View File

@ -79,8 +79,13 @@ case "$chosen" in
💾*)
chosen="${chosen%% *}"
chosen="${chosen:1}" # This is a bashism.
parttype="$(echo "$lsblkoutput" | grep "$chosen")"
attemptmount || getmount
sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)"
case "${parttype##* }" in
vfat) sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000 ;;
btrfs) sudo -A mount "$chosen" "$mp" ;;
*) sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" ;;
esac
notify-send "💾Drive Mounted." "$chosen mounted to $mp."
;;

View File

@ -5,6 +5,7 @@ bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
# Output locations. Unactivated progs should go to /dev/null.
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
shell_env_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim"
@ -16,12 +17,14 @@ vifm_shortcuts="/dev/null"
rm -f "$lf_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
printf "# vim: filetype=sh\\n" > "$shell_env_shortcuts"
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs.
eval "echo \"$(cat "$bmdirs")\"" | \
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ;
printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ;
@ -33,6 +36,7 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
eval "echo \"$(cat "$bmfiles")\"" | \
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ;
printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ;

View File

@ -67,7 +67,6 @@ if [ -n "${audio+x}" ]; then
*) echo "That doesn't look like an audio file."; exit 1 ;;
esac
totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))"
endtime="$((totseconds-seconds))"
fi
prepdir="${prepdir:-$cache/$file}"
@ -95,10 +94,10 @@ do
# If images have already been made in a previous run, do not recreate
# them unless -r was given.
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base"
magick -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base"
else
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base"
magick -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base"
fi
# If the first line, do not write yet.
@ -111,6 +110,7 @@ duration $duration"
prevseconds="$(date '+%s' -d "$prevtime")"
done < "$file"
# Do last file which must be given twice as follows
endtime="$((totseconds-seconds))"
echo "file '$base'
duration ${endtime:-5}
file '$base'"

View File

@ -0,0 +1,23 @@
#!/bin/sh
# current brightness
curr_brightness=$(cat /sys/class/backlight/*/brightness)
# max_brightness
max_brightness=$(cat /sys/class/backlight/*/max_brightness)
# brightness percentage
brightness_per=$((100 * curr_brightness / max_brightness))
case $BLOCK_BUTTON in
1)
;;
3)
notify-send "💡 Brightness module" "\- Shows current brightness level ☀️."
;;
6)
setsid -f "$TERMINAL" -e "$EDITOR" "$0"
;;
esac
echo "💡 ${brightness_per}%"

View File

@ -19,7 +19,7 @@ case "$clock" in
esac
case $BLOCK_BUTTON in
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|sed 's/ //g')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|tr -d ' ')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
2) setsid -f "$TERMINAL" -e calcurse ;;
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
- Middle click opens calcurse if installed" ;;

View File

@ -4,9 +4,9 @@
case $BLOCK_BUTTON in
1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;;
2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;
2) wpctl set-mute @DEFAULT_SINK@ toggle ;;
4) wpctl set-volume @DEFAULT_SINK@ 1%+ ;;
5) wpctl set-volume @DEFAULT_SINK@ 1%- ;;
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute.
- Scroll to change." ;;

View File

@ -3,14 +3,7 @@
# Clears the build files of a LaTeX/XeLaTeX build.
# I have vim run this file whenever I exit a .tex file.
case "$1" in
*.tex)
file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyg|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete
rm -rdf "$dir/_minted-$(basename -- "$base")"
;;
*) printf "Give .tex file as argument.\\n" ;;
esac
[ "${1##*.}" = "tex" ] && {
find "$(dirname "${1}")" -regex '.*\(_minted.*\|.*\.\(4tc\|xref\|tmp\|pyc\|pyg\|pyo\|fls\|vrb\|fdb_latexmk\|bak\|swp\|aux\|log\|synctex\(busy\)\|lof\|lot\|maf\|idx\|mtc\|mtc0\|nav\|out\|snm\|toc\|bcf\|run\.xml\|synctex\.gz\|blg\|bbl\)\)' -delete
} || printf "Provide a .tex file.\n"

25
.local/bin/weath Normal file
View File

@ -0,0 +1,25 @@
#!/bin/sh
#
# Get the weather on the terminal. You can pass an alternative location as a parameter,
# and/or use the 'cp' option to copy the forecast as plaintext to the clipboard.
report="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
if [ "$1" = 'cp' ]; then
# shellcheck disable=SC2015
[ -z "$2" ] && sed 's/\x1b\[[^m]*m//g' "$report" | xclip -selection clipboard &&
notify-send "Weather forecast for '${LOCATION:-$(head -n 1 "$report" | cut -d' ' -f3-)}' copied to clipboard." ||
{ data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$2?T")" &&
notify-send "Weather forecast for '$2' copied to clipboard." &&
echo "$data" | xclip -selection clipboard ||
notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.'; }
else
[ -n "$2" ] &&
notify-send "Invalid option '$1'! The only valid option is 'cp'." &&
exit 1
# shellcheck disable=SC2015
[ -z "$1" ] && less -S "$report" ||
data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$1")" && echo "$data" | less -S ||
notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.'
fi