diff --git a/private_dot_local/bin/executable_dnd b/private_dot_local/bin/executable_dnd deleted file mode 100644 index eaeb087..0000000 --- a/private_dot_local/bin/executable_dnd +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# ----------------------------- -# simple_mako_toggle.sh -# Toggle Mako notification modes -# ----------------------------- - -# Colors -GREEN="\033[1;32m" -YELLOW="\033[1;33m" -BLUE="\033[1;34m" -RESET="\033[0m" - -# Default mapping for "dnd" -DEFAULT_FLAG="do-not-disturb" - -# Get the flag to toggle -FLAG="${1:-dnd}" -if [[ "$FLAG" == "dnd" ]]; then - FLAG="$DEFAULT_FLAG" -fi - -# Function to check if a flag is active -is_active() { - local f="$1" - makoctl mode | grep -qw "$f" -} - -# Function to toggle a flag -toggle_flag() { - local f="$1" - if is_active "$f"; then - makoctl mode -r "$f" >/dev/null 2>&1 - echo -e "${YELLOW}[Mako] Removed mode: $f${RESET}" - else - makoctl mode -a "$f" >/dev/null 2>&1 - echo -e "${GREEN}[Mako] Activated mode: $f${RESET}" - fi -} - -# Function to list other active modes (excluding default and the toggled flag) -list_other_modes() { - local exclude="$1" - other_modes=$(makoctl mode | grep -vwE "$exclude|default") - if [[ -n "$other_modes" ]]; then - echo -e "${BLUE}[Mako] Other active modes: $other_modes${RESET}" - fi -} - -# Main execution -echo -e "${BLUE}[Mako] Updating Mako notification modes...${RESET}" - -# Toggle the requested flag -toggle_flag "$FLAG" - -# List other active modes -list_other_modes "$FLAG" diff --git a/private_dot_local/bin/executable_fishify-envs b/private_dot_local/bin/executable_fishify-envs deleted file mode 100644 index 0d52a68..0000000 --- a/private_dot_local/bin/executable_fishify-envs +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -in="$1" - -if [[ -z "$in" ]]; then - echo "usage: $0 input_file" - exit 1 -fi - -while IFS= read -r line; do - [[ -z "$line" || "$line" =~ ^# ]] && continue - if [[ "$line" =~ ^([A-Za-z_][A-Za-z0-9_]*)=(.*)$ ]]; then - var="${BASH_REMATCH[1]}" - val="${BASH_REMATCH[2]}" - val="${val%\"}" - val="${val#\"}" - echo "set -Ux $var \"$val\"" - fi -done < "$in" - diff --git a/private_dot_local/bin/executable_fishify_envs b/private_dot_local/bin/executable_fishify_envs deleted file mode 100644 index 0d52a68..0000000 --- a/private_dot_local/bin/executable_fishify_envs +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -in="$1" - -if [[ -z "$in" ]]; then - echo "usage: $0 input_file" - exit 1 -fi - -while IFS= read -r line; do - [[ -z "$line" || "$line" =~ ^# ]] && continue - if [[ "$line" =~ ^([A-Za-z_][A-Za-z0-9_]*)=(.*)$ ]]; then - var="${BASH_REMATCH[1]}" - val="${BASH_REMATCH[2]}" - val="${val%\"}" - val="${val#\"}" - echo "set -Ux $var \"$val\"" - fi -done < "$in" - diff --git a/private_dot_local/bin/executable_fix-loopback b/private_dot_local/bin/executable_fix-loopback deleted file mode 100644 index 2cef216..0000000 --- a/private_dot_local/bin/executable_fix-loopback +++ /dev/null @@ -1,3 +0,0 @@ -sudo modprobe v4l2loopback devices=1 video_nr=2 card_label="OBS Virtual Camera" exclusive_caps=1 -sudo chmod 666 /dev/video* -sudo usermod -aG video $USER diff --git a/private_dot_local/bin/executable_hyprtoggle b/private_dot_local/bin/executable_hyprtoggle deleted file mode 100644 index 193e025..0000000 --- a/private_dot_local/bin/executable_hyprtoggle +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Toggle a specific optional Hyprland config in ~/.config/hypr/hyprland.conf - -RESET="\033[0m" -RED="\033[1m\033[031m" -GREEN="\033[1m\033[032m" - -CONFIG="$HOME/.config/hypr/hyprland.conf" - -hyprtoggle_list() { - grep -E "^[[:space:]#]*source = .*opts/.*\.conf" "$CONFIG" | while read -r line; do - name=$(basename "$(echo "$line" | grep -oE "[^/]+\.conf$")" .conf) - if [[ "$line" =~ ^# ]]; then - echo -e " ${RED}✗${RESET} $name" - else - echo -e " ${GREEN}✓${RESET} $name" - fi - done -} - -if [ ! -f "$CONFIG" ]; then - echo -e "${RED}✗${RESET}config not found at $CONFIG" - exit 1 -fi - -if [ -z "$1" ]; then - echo "usage: hyprtoggle " - hyprtoggle_list - exit 1 -fi - -OPT="$1" - -# Check if the line is currently active or commented -if grep -qE "^[[:space:]]*source = .*${OPT}\.conf" "$CONFIG"; then - echo -e "${RED}disabling${RESET} $OPT..." - sed -i "s|^[[:space:]]*source = \(.*${OPT}\.conf\)|# source = \1|" "$CONFIG" -elif grep -qE "^#\s*source = .*${OPT}\.conf" "$CONFIG"; then - echo -e "${GREEN}enabling${RESET} $OPT..." - sed -i "s|^#\s*source = \(.*${OPT}\.conf\)|source = \1|" "$CONFIG" -else - echo -e "${RED}✗ no matching source${RESET} for '$OPT'" - exit 1 -fi - -hyprtoggle_list diff --git a/private_dot_local/bin/executable_localhost b/private_dot_local/bin/executable_localhost deleted file mode 100644 index 85302c0..0000000 --- a/private_dot_local/bin/executable_localhost +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -PORT=8000 - -IP=$(ip route get 1.1.1.1 2>/dev/null | awk '{print $7; exit}') -IP=${IP:-127.0.0.1} - -if [[ -t 1 ]]; then - YELLOW=$(tput setaf 3) - BLUE=$(tput setaf 4) - BOLD=$(tput bold) - RESET=$(tput sgr0) -else - YELLOW= BLUE= BOLD= RESET= -fi - -echo "Serving ${YELLOW}${BOLD}$(pwd)${RESET} at ${BLUE}${BOLD}http://${IP}:${PORT}${RESET}" - -exec python3 -m http.server "$PORT" diff --git a/private_dot_local/bin/executable_low-battery-warn b/private_dot_local/bin/executable_low-battery-warn deleted file mode 100644 index 2b35e23..0000000 --- a/private_dot_local/bin/executable_low-battery-warn +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -THRESHOLD=15 - -# Find the battery device (first one found) -BATTERY=$(upower -e | grep battery | head -n1) - -# If no battery found, exit -if [ -z "$BATTERY" ]; then - echo "$(date '+%Y-%m-%d %H:%M:%S') No battery found. Exiting." - exit 0 -fi - -echo "$(date '+%Y-%m-%d %H:%M:%S') Battery device: $BATTERY" - -# Get battery state and percentage -STATE=$(upower -i "$BATTERY" | awk '/state:/ {print $2}') -PERCENT=$(upower -i "$BATTERY" | awk -F'[:%]' '/percentage:/ {gsub(/ /,"",$2); print $2}') - -echo "$(date '+%Y-%m-%d %H:%M:%S') Battery state: $STATE, percentage: $PERCENT" - -# Only notify if discharging and below threshold -if [ "$STATE" = "discharging" ] && [ "$PERCENT" -lt "$THRESHOLD" ]; then - notify-send "Battery low" "Battery at ${PERCENT}% and discharging." - echo "$(date '+%Y-%m-%d %H:%M:%S') Notification sent: Battery at ${PERCENT}% and discharging." -fi diff --git a/private_dot_local/bin/executable_make-pwa b/private_dot_local/bin/executable_make-pwa deleted file mode 100644 index 39fadaf..0000000 --- a/private_dot_local/bin/executable_make-pwa +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env bash -# -# make-pwa -# makes a chromium PWA desktop entry for the given url - -set -e - -usage() { - echo "Usage:" - echo " $0 create " - echo " $0 delete " - exit 1 -} - -if [ "$#" -lt 2 ]; then - usage -fi - -ACTION="$1" -NAME="$2" -DESKTOP_DIR="$HOME/.local/share/applications" -DESKTOP_FILE="$DESKTOP_DIR/pwa-${NAME}.desktop" -ICON_DIR="$HOME/.local/share/icons" -ICON_FILE="$ICON_DIR/pwa-${NAME}.ico" -PNG_ICON_FILE="$ICON_DIR/pwa-${NAME}.png" - -fetch_favicon() { - URL="$1" - mkdir -p "$ICON_DIR" - FAVICON_URL="${URL}/favicon.ico" - if curl -fsSL -A "Mozilla/5.0" "$FAVICON_URL" -o "$ICON_FILE"; then - if command -v convert >/dev/null 2>&1; then - if magick "$ICON_FILE[-1]" "$PNG_ICON_FILE"; then - echo "$PNG_ICON_FILE" - else - echo "" - fi - else - echo "$ICON_FILE" - fi - else - echo "" - fi -} - -case "$ACTION" in - create) - if [ "$#" -lt 3 ]; then - usage - fi - URL="$3" - if [ "$#" -ge 4 ]; then - ICON_PATH="$4" - else - ICON_PATH=$(fetch_favicon "$URL") - if [ -z "$ICON_PATH" ]; then - ICON_BASENAME="web-browser" - else - ICON_BASENAME="$ICON_PATH" - fi - fi - mkdir -p "$DESKTOP_DIR" - cat > "$DESKTOP_FILE" </dev/null - done -} - -if [[ $# -eq 1 ]]; then - selected=$1 -else - if command -v fd >/dev/null 2>&1; then - mapfile -t CANDIDATES < <(collect | sort -u) - selected=$(printf '%s\n' "${CANDIDATES[@]}" | fzf) - else - selected=$(collect | sort -u | fzf) - fi -fi - -[[ -z ${selected:-} ]] && exit 0 - -selected_name=$(basename "$selected" | tr -c '[:alnum:]' '_' | sed 's/^_*$/'"sess_$(date +%s)"'/' | sed 's/_$//') -tmux_running=$(pgrep tmux || true) - -if [[ -z ${TMUX:-} ]] && [[ -z $tmux_running ]]; then - exec tmux new-session -s "$selected_name" -c "$selected" -fi - -if ! tmux has-session -t="$selected_name" 2>/dev/null; then - tmux new-session -ds "$selected_name" -c "$selected" - tmux rename-window -t "$selected_name:" "shell" - tmux new-window -t "$selected_name:" -c "$selected" -n "neovim" - tmux send-keys -t "$selected_name:neovim" "nvim" Enter - if [[ -d "$selected/.git" ]]; then - tmux new-window -t "$selected_name:" -c "$selected" -n "git" - tmux send-keys -t "$selected_name:git" "lazygit" Enter - fi - tmux select-window -t "$selected_name:neovim" -fi - -if [[ -z ${TMUX:-} ]]; then - tmux attach -t "$selected_name" -else - tmux switch-client -t "$selected_name" -fi -i diff --git a/private_dot_local/bin/executable_update_lsps b/private_dot_local/bin/executable_update_lsps deleted file mode 100644 index eb7b443..0000000 --- a/private_dot_local/bin/executable_update_lsps +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo "Installing/updating LSPS." -echo - -declare -A LSPS=( - ["astro"]="sudo npm i -g @astrojs/language-server" - ["bash"]="sudo npm i -g bash-language-server" - ["css,html,json"]="sudo npm i -g vscode-langservers-extracted" - ["markdown"]="yay -S marksman-bin" - ["rust"]="rustup component add rust-analyzer" - ["tailwindcss"]="sudo npm i -g @tailwindcss/language-server" - ["toml"]="cargo install taplo-cli --locked --features lsp" - ["typescript"]="sudo npm install -g typescript typescript-language-server" - ["yaml"]="sudo npm i -g yaml-language-server@next" -) - -for lsp in "${!LSPS[@]}"; do - echo -n "install/update ${lsp}? (y/n): " - read -r ans - if [[ "$ans" =~ ^[Yy]$ ]]; then - echo "-> updating ${lsp}..." - eval "${LSPS[$lsp]}" - echo "-> ${lsp} done" - else - echo "-> skipping ${lsp}" - fi - echo -done - -echo "done" diff --git a/private_dot_local/bin/hooks/executable_generic b/private_dot_local/bin/hooks/executable_generic deleted file mode 100644 index 0a687e2..0000000 --- a/private_dot_local/bin/hooks/executable_generic +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -HOOK_NAME="$1" -HOOK_VALUE="$2" - -notify-send "$HOOK_NAME" "$HOOK_VALUE"