From d25f69e0ddd8efc92d99f7a4bc877424a5baebff Mon Sep 17 00:00:00 2001 From: tavo Date: Tue, 9 Sep 2025 00:23:03 -0600 Subject: [PATCH] updates --- i3/config | 6 +- packages/flatpak/list.yml | 3 + packages/system/apt/list | 1 + scripts/menu/menu-bookmarks | 43 ++++++++++++-- scripts/menu/menu-open-bookmark | 7 +++ scripts/setup/setup-debian-nvidia-cuda | 3 + scripts/setup/setup-flatpak-nvidia | 20 +++++++ scripts/setup/setup-flatpak-packages | 6 +- scripts/setup/setup-flatpak-photogimp | 25 ++++++++ scripts/setup/setup-systemd-autologin | 9 +++ scripts/x11/s-x11-screen-standby | 21 +++++++ shell/aliases.sh | 80 +++++++++++++------------- shell/profile.d/defaults.sh | 6 +- shell/profile.d/print-front-matter.sh | 18 ++++++ 14 files changed, 197 insertions(+), 51 deletions(-) create mode 100755 scripts/menu/menu-open-bookmark create mode 100755 scripts/setup/setup-debian-nvidia-cuda create mode 100755 scripts/setup/setup-flatpak-nvidia create mode 100755 scripts/setup/setup-flatpak-photogimp create mode 100755 scripts/setup/setup-systemd-autologin create mode 100644 shell/profile.d/print-front-matter.sh diff --git a/i3/config b/i3/config index 490c144..0814036 100644 --- a/i3/config +++ b/i3/config @@ -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 diff --git a/packages/flatpak/list.yml b/packages/flatpak/list.yml index 2c91991..fa18740 100644 --- a/packages/flatpak/list.yml +++ b/packages/flatpak/list.yml @@ -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 diff --git a/packages/system/apt/list b/packages/system/apt/list index a1fb505..f16475c 100644 --- a/packages/system/apt/list +++ b/packages/system/apt/list @@ -7,6 +7,7 @@ perl # Shared fonts-jetbrains-mono +ttf-mscorefonts-installer # Window Manager xorg diff --git a/scripts/menu/menu-bookmarks b/scripts/menu/menu-bookmarks index e3c3dd0..1dae867 100755 --- a/scripts/menu/menu-bookmarks +++ b/scripts/menu/menu-bookmarks @@ -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 diff --git a/scripts/menu/menu-open-bookmark b/scripts/menu/menu-open-bookmark new file mode 100755 index 0000000..f9e2934 --- /dev/null +++ b/scripts/menu/menu-open-bookmark @@ -0,0 +1,7 @@ +#!/bin/sh + +bm="$(menu-bookmarks)" + +if [ -n "$bm" ]; then + xdg-open "$bm" +fi diff --git a/scripts/setup/setup-debian-nvidia-cuda b/scripts/setup/setup-debian-nvidia-cuda new file mode 100755 index 0000000..06add63 --- /dev/null +++ b/scripts/setup/setup-debian-nvidia-cuda @@ -0,0 +1,3 @@ +#!/bin/sh + +sudo apt install -y nvidia-cuda-toolkit diff --git a/scripts/setup/setup-flatpak-nvidia b/scripts/setup/setup-flatpak-nvidia new file mode 100755 index 0000000..148e8c5 --- /dev/null +++ b/scripts/setup/setup-flatpak-nvidia @@ -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 diff --git a/scripts/setup/setup-flatpak-packages b/scripts/setup/setup-flatpak-packages index a90f15d..9413d04 100755 --- a/scripts/setup/setup-flatpak-packages +++ b/scripts/setup/setup-flatpak-packages @@ -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" diff --git a/scripts/setup/setup-flatpak-photogimp b/scripts/setup/setup-flatpak-photogimp new file mode 100755 index 0000000..fee7a2e --- /dev/null +++ b/scripts/setup/setup-flatpak-photogimp @@ -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 diff --git a/scripts/setup/setup-systemd-autologin b/scripts/setup/setup-systemd-autologin new file mode 100755 index 0000000..9c03f07 --- /dev/null +++ b/scripts/setup/setup-systemd-autologin @@ -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 diff --git a/scripts/x11/s-x11-screen-standby b/scripts/x11/s-x11-screen-standby index 9ed911f..1e84617 100755 --- a/scripts/x11/s-x11-screen-standby +++ b/scripts/x11/s-x11-screen-standby @@ -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" diff --git a/shell/aliases.sh b/shell/aliases.sh index 35ef93b..990dbf8 100644 --- a/shell/aliases.sh +++ b/shell/aliases.sh @@ -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" diff --git a/shell/profile.d/defaults.sh b/shell/profile.d/defaults.sh index ef822fe..641109d 100644 --- a/shell/profile.d/defaults.sh +++ b/shell/profile.d/defaults.sh @@ -2,6 +2,6 @@ export \ TERM="xterm-256color" \ - BROWSER="firefox-hardened" \ - EDITOR="cvim" \ - VISUAL="cvim" + BROWSER="firefox" \ + EDITOR="lvim" \ + VISUAL="lvim" diff --git a/shell/profile.d/print-front-matter.sh b/shell/profile.d/print-front-matter.sh new file mode 100644 index 0000000..adcdc45 --- /dev/null +++ b/shell/profile.d/print-front-matter.sh @@ -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 +}