From c4d0e3de7ad04114797abb14368e4a6f8da04a60 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 8 May 2026 23:55:30 +0200 Subject: Updates from alpine --- scripts/old/brightness | 16 -------- scripts/old/dmenu-filepicker-old | 31 --------------- scripts/old/dunst-toggle | 14 ------- scripts/old/gfmt | 9 ----- scripts/old/mail-checknow | 18 --------- scripts/old/mblaze-extras | 61 ----------------------------- scripts/old/notify-battery | 10 ----- scripts/old/notify-status | 7 ---- scripts/old/notify-time | 15 ------- scripts/old/sfeed-browser | 80 -------------------------------------- scripts/old/theme | 23 ----------- scripts/old/togglemute | 18 --------- scripts/old/volume | 13 ------- scripts/old/xkboptions | 6 --- scripts/old/xprop-active-window-id | 6 --- 15 files changed, 327 deletions(-) delete mode 100755 scripts/old/brightness delete mode 100755 scripts/old/dmenu-filepicker-old delete mode 100755 scripts/old/dunst-toggle delete mode 100755 scripts/old/gfmt delete mode 100755 scripts/old/mail-checknow delete mode 100755 scripts/old/mblaze-extras delete mode 100755 scripts/old/notify-battery delete mode 100755 scripts/old/notify-status delete mode 100755 scripts/old/notify-time delete mode 100755 scripts/old/sfeed-browser delete mode 100755 scripts/old/theme delete mode 100755 scripts/old/togglemute delete mode 100755 scripts/old/volume delete mode 100755 scripts/old/xkboptions delete mode 100755 scripts/old/xprop-active-window-id (limited to 'scripts/old') diff --git a/scripts/old/brightness b/scripts/old/brightness deleted file mode 100755 index a7294fb..0000000 --- a/scripts/old/brightness +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# Increase / decrease brightness, and pops up a notification -# Requires: xbacklight, a notification program such as herbe or notify-send -# Usage: brightness {inc|dec} n - -# ksh completion -# set -A complete_brightness_1 inc dec -# set -A complete_brightness_2 5 - -#notify="notify-send" -notify="herbe" - -pkill herbe # comment this too if not using herbe - -xbacklight -$1 $2 && $notify "Brightness: $(xbacklight | sed 's/\..*$//')%" diff --git a/scripts/old/dmenu-filepicker-old b/scripts/old/dmenu-filepicker-old deleted file mode 100755 index 532fb82..0000000 --- a/scripts/old/dmenu-filepicker-old +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -# A dmenu-based file picker (prints selected file to stdout) -# Requires: dmenu (or similar) -# Usage: dmenu-filepicker [path] - -menu=${MENU:-dmenu} -menuopts="-i -l 15" - -basedir="$(pwd)" - -next="${@:-$(pwd)}" - -while true; do - if [ -z "$next" ]; then - break - elif [ "$next" = "." ]; then - pwd - break - elif [ -d "$next" ]; then - cd "$next" - next=$(ls -a | $menu $menuopts) - else - echo "$next" | while read line; do - echo "$(pwd)/$line" - done - break - fi -done - -cd "$basedir" diff --git a/scripts/old/dunst-toggle b/scripts/old/dunst-toggle deleted file mode 100755 index 2de2343..0000000 --- a/scripts/old/dunst-toggle +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Toggle "do not disturbe" mode with dunst -# Requires: dunst, notify-send - -if [ "$(dunstctl is-paused)" = "false" ]; then - notify-send -t 3000 "Notifications: OFF" "Notifications will be hidden" - sleep 3 - dunstctl set-paused true -else - dunstctl set-paused false - notify-send -t 3000 "Notifications: ON" "Notifications reactivated" -fi - diff --git a/scripts/old/gfmt b/scripts/old/gfmt deleted file mode 100755 index d38351f..0000000 --- a/scripts/old/gfmt +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# Format text from gemtext format to short lines with double \n - -# TODO: remove double spacing from within ``` - -sed 's/ //' | \ -sed 'a\\' | \ -fold -sw 80 diff --git a/scripts/old/mail-checknow b/scripts/old/mail-checknow deleted file mode 100755 index 188042b..0000000 --- a/scripts/old/mail-checknow +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check for new email, save result to file. -# Requires: mpop, notify-send or similar - -file="$XDG_DATA_HOME/newmail" -#notify="notify-send" -notify=herbe - -l=$(cat "$file") -n=$(mpop -s | awk '/new*./{print $2}') - -if [ -n "$n" ]; then - echo "$n" > "$file" - if [ "$n" != "no" ] && [ "$l" != "$n" ]; then - $notify "New email ($n)" - fi -fi diff --git a/scripts/old/mblaze-extras b/scripts/old/mblaze-extras deleted file mode 100755 index 7a4fe8a..0000000 --- a/scripts/old/mblaze-extras +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -# Useful extra commands for mblaze - -# Requires: mblaze, mpop - -# Usage: mblaze-extras command -# List of commands: -# get [filter] -# pick [field] -# save -# scan [folder] - -menu=${MENU:-dmenu} -mdir=$HOME/mail -mpopdir=$HOME/.config/mpop - -mbextra_scan() { - folder=${1:-inbox} - mlist -t $mdir/$folder | mthread | mseq -S - mscan -} - -mbextra_get() { - mpop --filter=$mpopdir/filter-$1.sh - minc -q $mdir/inbox - mbextra_scan inbox -} - -mbextra_pick() { - field=$1 - shift - mpick -t "$field =~~ \"$@\"" -} - -mbextra_save() { - dir=$2 - [ -z "$dir" ] && dir=$(dmenu-filepicker) - mkdir -p "$dir" - - if [ ! -d "$dir" ]; then - echo "No directory selected, skipping." - else - cd "$dir" - mshow -x $1 - fi -} - -if [ -z "$1" ]; then - echo "Usage: mblaze-extras COMMAND" -elif [ "$1" = "scan" ]; then - mbextra_scan $2 -elif [ "$1" = "get" ]; then - mbextra_get $2 -elif [ "$1" = "save" ]; then - shift - mbextra_save $@ -elif [ "$1" = "pick" ]; then - shift - mbextra_pick $@ -fi diff --git a/scripts/old/notify-battery b/scripts/old/notify-battery deleted file mode 100755 index 0294b70..0000000 --- a/scripts/old/notify-battery +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Popup battery notification, based on the script battery-status - -# Requires: notify-send or similar - -#notify=notify-send -notify=herbe - -$notify "Battery" "$(battery-status)" diff --git a/scripts/old/notify-status b/scripts/old/notify-status deleted file mode 100755 index 73a9435..0000000 --- a/scripts/old/notify-status +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Simple script to send a notification displaying the output of status - -# Requires: status, herbe (or similar, e.g. notify-send) - -herbe "$(status '\n\n')" diff --git a/scripts/old/notify-time b/scripts/old/notify-time deleted file mode 100755 index 4b77c74..0000000 --- a/scripts/old/notify-time +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Little notification to show time and date - -# Requires: notify-send or similar - -# TODO: check if it still works with notify-send - -#notify=notify-send -notify=herbe - -t=$(date +"%H:%M:%S") -d=$(date +"%d %B %Y, %A") - -$notify "$t" "$d" diff --git a/scripts/old/sfeed-browser b/scripts/old/sfeed-browser deleted file mode 100755 index 774c808..0000000 --- a/scripts/old/sfeed-browser +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh - -# This script is based on sfeed (https://codemadness.org/sfeed.html), but -# it allows you organize your feeds in directories and subdirectories. -# In your $sfd directory (see below) you should have two folders: -# urls: it can contain more subfolders and files. Each file should contain -# only one line with the url to the feed. The name of the file is the -# name of the feed (it can contains spaces and such). -# files: this one can be empty, it will be filled with the feed files -# An older version of this script also marked viewed items and removed -# them before displaying the choice of feeds. Contact me if you are interested -# in using it. - -# Requires: sfeed, dmenu-file-picker (or similar), open-url (or similar) - -# Usage: sfeed-browser [-m menu] - -filepicker="dmenu-filepicker" # Try "nnn -p -" -menu="dmenu -l 35 -i" -urlopener=open-url -sfd="$HOME/box/sfeed" -showlast=10 - -usage() { - echo "sfeed-browser [-m MENU]" -} - -while getopts "m:" opt; do - case "$opt" in - m) - menu="$OPTARG" - ;; - *) - usage - exit 1 - ;; - esac -done - -# Might add more stuff later -fixurl() { - sed 's/old\.reddit\.com/reddit\.com/' -} - -dirtofeedpaths() { - while read -r line; do - find "$line" | while read -r fname; do - [ -f "$fname" ] && echo "$fname" - done - done -} - -pathstosfeedrc() { - printf 'sfeedpath="%s"\n\nfeeds() {\n' "$sfd/files" - while read -r line; do - feedname=$(echo "$line" | sed 's/.*\///') - read -r feedurl <"$line" - printf '\tfeed "%s" "%s"\n' "$feedname" "$feedurl" - done - printf "}\n" -} - -feedmenu() { - while read -r line; do - feedname=$(echo "$line" | sed 's/.*\///') - sfeed_plain "$sfd/files/$feedname" | head -$showlast - done | $menu -} - -openfeeds() { - while read -r line; do - url=$(echo "$line" | sed 's/.*[\t ]//' | fixurl) - [ -n "$url" ] && echo "$url" - done | xargs $urlopener -} - -$filepicker "$@" "$sfd/urls" | dirtofeedpaths > "$sfd/last" -pathstosfeedrc < "$sfd/last" > "$sfd/sfeedrc" -sfeed_update "$sfd/sfeedrc" -feedmenu < "$sfd/last" | openfeeds diff --git a/scripts/old/theme b/scripts/old/theme deleted file mode 100755 index 7e0107a..0000000 --- a/scripts/old/theme +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# This script is a shortcut to change between a dark and a light theme -# for my terminal emulator (st). - -# Usage: theme (dark|light) - -src=$HOME/.local/src - -case "$@" in - dark) - cd $src/st-darkbg - ;; - light) - cd $src/st-lightbg - ;; - *) - echo "usage: theme (dark|light)" - exit 1 - ;; -esac - -make && sudo make install diff --git a/scripts/old/togglemute b/scripts/old/togglemute deleted file mode 100755 index b799b02..0000000 --- a/scripts/old/togglemute +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Toggle mute state and notify -# Requires: pulsemixer, notify-send or similar - -#notify=notify-send -notify=herbe - -ismute=$(pulsemixer --toggle-mute --get-mute) - -if [ "$ismute" = "1" ]; then - m="muted" -else - m="unmuted" -fi - -pkill herbe # comment this line too if not using herbe -$notify "Audio $m" diff --git a/scripts/old/volume b/scripts/old/volume deleted file mode 100755 index 8dcd36a..0000000 --- a/scripts/old/volume +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# Change volume and notify -# Usage: volume {+n|-n} -# Requires: pulsemixer, notify-send or similar - -#notify=notify-send -notify=herbe - -newvol=$(pulsemixer --change-volume "$1" --get-volume | awk '{print $1}') - -pkill herbe # comment this line too if not using herbe -$notify "Volume" "$newvol%" diff --git a/scripts/old/xkboptions b/scripts/old/xkboptions deleted file mode 100755 index e63456d..0000000 --- a/scripts/old/xkboptions +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Loads my xkboptions - -setxkbmap -option compose:ralt -setxkbmap -option caps:swapescape diff --git a/scripts/old/xprop-active-window-id b/scripts/old/xprop-active-window-id deleted file mode 100755 index 97cf60f..0000000 --- a/scripts/old/xprop-active-window-id +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Get the ID of the current active window (hexadecimal) -# Requires: xprop - -xprop -root | grep _NET_ACTIVE_WINDOW | head -1 | sed 's/.* //' -- cgit v1.3