This commit is contained in:
tavo 2025-09-09 00:23:03 -06:00
parent d10e7d1a5a
commit d25f69e0dd
14 changed files with 197 additions and 51 deletions

View file

@ -23,7 +23,8 @@
#}
#set $opacity 0.9
# smart_gaps on
smart_gaps on
hide_edge_borders smart
set $mod Mod4
set $alt Mod1
@ -36,6 +37,7 @@ set $term alacritty
set $menu exec $(~/.config/scripts/menu/menu run "Run:")
set $menu-input ~/.config/scripts/menu/menu-input
set $menu-output ~/.config/scripts/menu/menu-output
set $menu-open-bookmark ~/.config/scripts/menu/menu-open-bookmark
set $passmgr ~/.config/scripts/dwm/dwmpass
set $passotp ~/.config/scripts/dwm/dwmotp
set $filemgr thunar
@ -56,6 +58,7 @@ bindsym $mod+Shift+p exec $passmgr
bindsym $mod+Shift+o exec $passotp
bindsym $mod+e exec $filemgr
bindsym $mod+w exec $browser
bindsym $mod+b exec $menu-open-bookmark
bindsym $mod+i exec $menu-input
bindsym $mod+o exec $menu-output
bindsym XF86AudioRaiseVolume exec volup
@ -107,6 +110,7 @@ bindsym $mod+period workspace prev_on_output
bindsym $mod+Shift+t layout toggle tabbed split
bindsym $mod+f fullscreen
bindsym $mod+Shift+f floating toggle
bindsym $mod+Shift+b bar mode toggle
# -
#bindsym $mod+Shift+c exec clipman pick -t wofi -T'--show dmenu -I'
bindsym $mod+n split horizontal; layout tabbed

View file

@ -13,3 +13,6 @@ loupe: org.gnome.Loupe
citations: org.gnome.World.Citations
libreoffice: org.libreoffice.LibreOffice
qbittorrent: org.qbittorrent.qBittorrent
prismlauncher: org.prismlauncher.PrismLauncher
obs: com.obsproject.Studio
: com.obsproject.Studio.Plugin.DroidCam

View file

@ -7,6 +7,7 @@ perl
# Shared
fonts-jetbrains-mono
ttf-mscorefonts-installer
# Window Manager
xorg

View file

@ -1,10 +1,41 @@
#!/bin/sh
# Open URLs from bookmarks file
BOOKMARKS="$HOME/Documents/bookmarks"
BOOKMARKS="$HOME/Documents/bookmarks.json"
# Print site names, then get URL based on the name. Exit if empty
name="$(sed '/^Watch\slater:\s/d;/^\s*$/d;/^#/d;s/-.*$//g' "$BOOKMARKS" | menu "Site:")"
[ -z "$name" ] && exit
_folders() {
jq -r '.children[] | select(.root == "unfiledBookmarksFolder") | .children[] | select(.type == "text/x-moz-place-container") | .title' "$BOOKMARKS"
}
grep "$name" $BOOKMARKS | sed -z 's/^.*-//g;s/\n//g' |
xsel -ib && notify-send "󰃀 Bookmarks" "'$name' copied to clipboard"
_bookmarks_in_folder() {
jq -r --arg title "$1" '
.. | select(.type? == "text/x-moz-place-container" and .title? == $title)
| .children[]?
| select(.type == "text/x-moz-place")
| .title
' "$BOOKMARKS"
}
_bookmarks() {
jq -r '
.. | select(.type? == "text/x-moz-place") | .title
' "$BOOKMARKS"
}
_uri_from_title() {
jq -r --arg title "$1" '
.. | select(.type? == "text/x-moz-place" and .title? == $title) | .uri
' "$BOOKMARKS"
}
opt="$1"
case "$opt" in
folders)
folder="$(_folders | menu "dmenu" "Folder:")"
_bookmarks_in_folder "$folder"
;;
*)
title="$(_bookmarks | menu "dmenu" "Bookmark:")"
_uri_from_title "$title"
;;
esac

View file

@ -0,0 +1,7 @@
#!/bin/sh
bm="$(menu-bookmarks)"
if [ -n "$bm" ]; then
xdg-open "$bm"
fi

View file

@ -0,0 +1,3 @@
#!/bin/sh
sudo apt install -y nvidia-cuda-toolkit

View file

@ -0,0 +1,20 @@
#!/bin/sh
systemversion=
nvidia-smi --version | while read line; do
case "$line" in
DRIVER*)
FOUND_NV_DRIVER=1
systemversion="${line#*: }" systemversion="${systemversion%% *}" # 550.163.01
firstnumber="${systemversion%%.*}"
secondnumber="${systemversion#*.}" secondnumber="${secondnumber%.*}"
thirdnumber="${systemversion##*.}"
systemversion="$firstnumber-$secondnumber-$thirdnumber" # 550-163-01
flatpak install "org.freedesktop.Platform.GL.nvidia-$systemversion"
break
;;
*) ;;
esac
done

View file

@ -11,7 +11,11 @@ while read line; do
bin="${line%%:*}"
app="${line##*:}"
app="${app##* }"
ln -sf "$FLATPAK_BIN_PREFIX"/"$app" "$EXPORTS_BIN_PREFIX"/"$bin"
if [ "$bin" != "" ]; then
ln -sf "$FLATPAK_BIN_PREFIX"/"$app" "$EXPORTS_BIN_PREFIX"/"$bin"
fi
app_list="$app_list $app"
done <"$FLATPAK_LIST"

View file

@ -0,0 +1,25 @@
#!/bin/sh
LATEST_API_URL="https://api.github.com/repos/Diolinux/PhotoGIMP/releases/latest"
DOWNLOAD_URL=
curl -sL "$LATEST_API_URL" | while read line; do
case "$line" in
*browser*PhotoGIMP-linux*)
DOWNLOAD_URL=${line%\"*}
DOWNLOAD_URL=${DOWNLOAD_URL##*\"}
DOWNLOAD_FILE="${DOWNLOAD_URL##*/}"
;;
*) ;;
esac
if [ -n "$DOWNLOAD_URL" ]; then
tempdir="$(mktemp -d XXX-photogimp)"
curl -sL "$DOWNLOAD_URL" -o "$tempdir"/"$DOWNLOAD_FILE"
(cd "$tempdir" && unzip "$DOWNLOAD_FILE")
cp -ru "$tempdir"/"${DOWNLOAD_FILE%.*}"/.config/GIMP ~/.config/
cp -ru "$tempdir"/"${DOWNLOAD_FILE%.*}"/.local/share/* ~/.local/share/
rm -rf "$tempdir"
break
fi
done

View file

@ -0,0 +1,9 @@
#!/bin/sh
_config_file="$XDG_CONFIG_HOME"/systemd/system/getty@tty1.service.d
if [ -d "$_config_file" ]; then
sudo cp -rf "$_config_file" /etc/systemd/system/
else
echo 'Error "$XDG_CONFIG_HOME" not defined'
fi

View file

@ -1,4 +1,25 @@
#!/bin/sh
# s-x11-screen-standby - set x11 screen standby time
#
# *SYNOPSIS*
# ```sh
# s-x11-screen-standby [seconds]
# ```
#
# *DESCRIPTION*
# Screen shuts off after specified time in seconds.
#
# *EXAMPLES*
# ```sh
# s-x11-screen-standby 3600 # 1h time-out to standby
# ```
# ```sh
# s-x11-screen-standby # No argument, brings up menu
# ```
if [ -n "$1" ]; then
xset dpms "$1"
fi
opts="0=none 900=15min 1800=30min 3600=1h 7200=2h 14400=4h 28800=8h 43200=12h 86400=24h"

View file

@ -1,54 +1,54 @@
#!/bin/sh
if ! command -v sudo >/dev/null 2>&1 ; then
alias sudo="doas"
complete -cf doas
if ! command -v sudo >/dev/null 2>&1; then
alias sudo="doas"
complete -cf doas
fi
alias \
src="cd $HOME/.local/src/ && ls" \
cfg="cd $HOME/.config/ && ls" \
tmp="cd $HOME/Desktop/temp/ && ls" \
dsk="cd $HOME/Desktop/ && ls" \
prj="cd $HOME/Projects && ls" \
doc="cd $HOME/Documents/ && ls" \
dow="cd $HOME/Downloads/ && ls" \
mus="cd $HOME/Music/ && ls" \
prt="cd $HOME/Pictures/Screenshots/ && ls" \
bkg="cd $HOME/Pictures/Backgrounds/ && ls" \
img="cd $HOME/Pictures/ && ls" \
vid="cd $HOME/Videos/ && ls" \
src="cd $HOME/.local/src/ && ls" \
cfg="cd $HOME/.config/ && ls" \
tmp="cd $HOME/Desktop/temp/ && ls" \
dsk="cd $HOME/Desktop/ && ls" \
prj="cd $HOME/Projects && ls" \
doc="cd $HOME/Documents/ && ls" \
dow="cd $HOME/Downloads/ && ls" \
mus="cd $HOME/Music/ && ls" \
prt="cd $HOME/Pictures/Screenshots/ && ls" \
bkg="cd $HOME/Pictures/Backgrounds/ && ls" \
img="cd $HOME/Pictures/ && ls" \
vid="cd $HOME/Videos/ && ls"
EZA_OPTS="--git --group-directories-first --icons --time-style=long-iso"
command -v exa >/dev/null 2>&1 &&
alias la="exa $EZA_OPTS -alghUum" &&
alias lt="exa $EZA_OPTS -T -L 2" &&
alias ll="exa $EZA_OPTS -alg" &&
alias ls="exa $EZA_OPTS -1"
alias la="exa $EZA_OPTS -alghUum" &&
alias lt="exa $EZA_OPTS -T -L 2" &&
alias ll="exa $EZA_OPTS -alg" &&
alias ls="exa $EZA_OPTS -1"
command -v eza >/dev/null 2>&1 &&
alias la="eza $EZA_OPTS -alghUum" &&
alias lt="eza $EZA_OPTS -T -L 2" &&
alias ll="eza $EZA_OPTS -alg" &&
alias ls="eza $EZA_OPTS -1"
alias la="eza $EZA_OPTS -alghUum" &&
alias lt="eza $EZA_OPTS -T -L 2" &&
alias ll="eza $EZA_OPTS -alg" &&
alias ls="eza $EZA_OPTS -1"
command -v trash >/dev/null 2>&1 && alias rm="trash"
alias \
cal="calcurse" \
fzf="fzf --cycle --reverse" \
diff="diff --color=auto" \
grep="grep --color=auto" \
calc="bc -l" \
cp="cp -iv" \
mv="mv -iv" \
df-short="df -h | grep -v '\s/dev.*$\|\s/run.*$\|\s/boot.*$'" \
qr-png="qrencode -s 16 -o qr.png" \
qr="qrencode -t ansiutf8" \
clip="xsel -ib" \
wget="wget --hsts-file=$XDG_DATA_HOME/wget/wget-hsts" \
ssh="ssh ${SSH_CONFIG}" \
scp="scp ${SSH_CONFIG}" \
rsync="rsync --rsh \"ssh ${SSH_CONFIG}\"" \
lg="lazygit" \
lvim="VIMINIT= nvim" \
cal="calcurse" \
fzf="fzf --cycle --reverse" \
diff="diff --color=auto" \
grep="grep --color=auto" \
calc="bc -l" \
cp="cp -iv" \
mv="mv -iv" \
df-short="df -h | grep -v '\s/dev.*$\|\s/run.*$\|\s/boot.*$'" \
qr-png="qrencode -s 16 -o qr.png" \
qr="qrencode -t ansiutf8" \
clip="xsel -ib" \
wget="wget --hsts-file=$XDG_DATA_HOME/wget/wget-hsts" \
ssh="ssh ${SSH_CONFIG}" \
scp="scp ${SSH_CONFIG}" \
rsync="rsync --rsh \"ssh ${SSH_CONFIG}\"" \
lg="lazygit" \
lvim="VIMINIT= nvim"

View file

@ -2,6 +2,6 @@
export \
TERM="xterm-256color" \
BROWSER="firefox-hardened" \
EDITOR="cvim" \
VISUAL="cvim"
BROWSER="firefox" \
EDITOR="lvim" \
VISUAL="lvim"

View file

@ -0,0 +1,18 @@
#!/bin/sh
f_print_front_matter() {
file="$1"
if [ -z "$file" ] || ! [ -f "$file" ]; then
echo "File '$file' not found"
return 1
fi
if command -v batcat >/dev/null 2>&1; then
PAGER="batcat -p -l sh"
else
PAGER=less
fi
awk '$0 ~ /#!/ {next} $0 !~ /#/ {exit} {line = $0; sub(/^#[[:space:]]*/, "", line); print line}' "$file" | $PAGER
}