initial commit

This commit is contained in:
daniel fusser
2026-06-21 15:35:58 +02:00
committed by dafu
parent ce5bbf3916
commit 49462fb909
49 changed files with 2269 additions and 0 deletions
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
if [ -z $2 ]; then
c=`nmcli -t -e yes -c no -f name c show | wmenu -i -l 10`
else
c="$2"
fi
o=`nmcli c $1 "${c}"`
dunstify -a $0 "con $1 ${c}" "${o}"
killall -USR1 i3status
Executable
+57
View File
@@ -0,0 +1,57 @@
#!/bin/sh
#
# dmenu_run with custom history
#
set -e
export PATH=$PATH:~/.local/bin:~/.local/bin/sh
# . $HOME/.config/rc/config/dmenu/dmenu.rc
# . $HOME/.config/rc/sh/dmenu_path
# NB="#303446"
#NF="#838ba7"
#SF="#303446"
#SB="#ebcb8b"
NB="#090e13fa"
NF="#c6d0f5"
NF="#c6d0f54d"
SB="#303446"
SF="#babbf1"
#$nf #c6d0f5$TR
#$nb #303446$TR
#$sf #ebcb8b$TR
# NORD: NF="#4c566aEF"
# NORD: NB="#2e3440EF"
# NORD: SF="#2e3440EF"
# NORD: SB="#ebcb8bEF"
# FONT="monospace:size=11"
FONT="JetBrainsMono Nerd Font 10"
HISTORY=$HOME/.cache/dmenu_run.history
# MONITOR="$(swaymsg -t get_outputs | jq -r 'map(.focused) | index(true)')"
# MONITORNAME="$(swaymsg -t get_outputs | jq -r '.[] | select(.focused==true) | .name')"
_HIST_PREPEND() {
( printf "%s\n" 1 i "$@" . w | ex $HISTORY ) &>/dev/null
awk -i inplace '!x[$0]++' "$HISTORY"
}
# dmenu -m $MONITOR -fn ${FONT} -nb ${NB} -nf ${NF} -sb ${SB} -sf ${SF} -p "dmenu: " "$@") \
cmd=$((
cat "$HISTORY"; \
flatpak list --columns=application | awk '$0="Ƒ "$0' ; \
dmenu_path) | \
wmenu -i -f "${FONT}" -M ${NB} -m ${SB} -N ${NB} -n ${NF} -S ${SB} -s ${SF} -p "dmenu: " "$@" ) \
|| exit
_HIST_PREPEND "$cmd" &
case $cmd in
Ƒ*) flatpak run "${cmd#Ƒ }" ;;
!*) exec foot -e -T "${cmd#!}" "${cmd#!}" ;;
*) exec $cmd & ;;
esac
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
. $HOME/.config/dmenu/dmenurc && $DMENU $@
Executable
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
#
set -a; . "${HOME}/.config/secrets/hass"; set +a
# curl -s -X GET \
# -H "Authorization: Bearer ${token}" \
# -H "Content-Type: application/json" \
# https://hass.dafu.dev/api/states
#
curl -s -X POST \
-H "Authorization: Bearer ${token}" \
-H "Content-Type: application/json" \
-d '{"entity_id":"switch.'${1}'"}' \
https://hass.dafu.dev/api/services/switch/toggle || notify-send "${1} failed"
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
(nmcli con show --active | grep CR_5G)&>/dev/null || \
nmcli connection up CR_5G
Executable
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
url=$(wl-paste)
notify-send "Playing on pi: $url"
# url="https://youtu.be/LbkO84MsmyM?list=PL1Yf6ZEJhckBun3ijEL7DjtxUQ_DlFq-U"
# ssh set env
# url="https://stream.dafu.dev/Items/87d4b7901f7615ebbb270738825d640c/Download?api_key=6089eeeb929f4be98667fb4d19046041"
mpvcmd="mpv --save-position-on-quit -fs -gpu-api=opengl -hls-bitrate=3000000 --fullscreen ${url}"
ssh pi -t "WAYLAND_DISPLAY=wayland-0 dtach -n /tmp/xmpv ${mpvcmd}"
# ssh pi -t "tmux start-server \; new-session -d -A -s mpv \; new-window -d '${mpvcmd}'"
Executable
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
url=$(wl-paste)
notify-send "Playing: $url"
mpv --log-file=/tmp/mpv_output.txt "$url" || notify-send "mpv failed"
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
flatpak run org.mozilla.firefox $@
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
flatpak run org.remmina.Remmina -c \
.var/app/org.remmina.Remmina/data/remmina/group_vnc_pi_192-168-5-21.remmina
+1
View File
@@ -0,0 +1 @@
sudo screen /dev/ttyUSB0 11520,ixon
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
# https://github.com/jtheoof/swappy
grim -g "$(slurp)" - | swappy -f -
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
# https://github.com/jtheoof/swappy
grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)" - | swappy -f -
Executable
+95
View File
@@ -0,0 +1,95 @@
#!/bin/bash
# TODO
# - display both PCM & Master
# - display mute status
# case $1 in
# o) amixer sset PCM toggle > /dev/null ;;
# +) amixer set PCM 2dB+ unmute > /dev/null;;
# -) amixer set PCM 2dB- unmute > /dev/null;;
# # *) echo -n "`amixer get Master | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'`" ; echo -n " / `amixer get PCM | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'`" ; ( amixer get Master | grep Front | grep -q off ) && echo -n " [MUTE]" ; exit;;
# *) echo -n "`amixer get PCM | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'`" ; ( amixer get PCM | grep Front | grep -q off ) && echo -n " [MUTE]" ; exit;;
# esac
# VOLUME=`amixer get Master | sed -ne '/Front Left/s/.*\[\(.*\)%\].*/\1/p'`
# xsetroot -name "Vol: $VOLUME"
# `( amixer get Master | grep Front | grep -q off ) || echo \"$(~/sh/vol) •\"`
# SINK="`pactl info | grep -P '^Default Sink: ' | sed 's/[^:]\+:\s\+//'`"
. $HOME/.dmenurc
SINK="`pactl info | grep -P '^Standard-Ziel: ' | sed 's/[^:]\+:\s\+//'`"
[[ -z "$SINK" ]] && exit 1
if [[ "$SINK" =~ DragonFly ]]; then
INCR='24'
MIN_VOLUME=65050
MAX_VOLUME=65146
else
INCR='2%'
MIN_VOLUME=0
MAX_VOLUME=65536
fi
function volume() {
VOLUME="`pacmd dump | grep -P '^set-sink-volume.*\s+0x[1-9a-f][0-9a-f]*$'`"
echo "$VOLUME" | grep -qF "$SINK"
if [[ $? -eq 0 ]]; then
VOLUME="`echo "$VOLUME" | grep -oP '0x[1-9a-f][0-9a-f]*$'`"
printf "%d\n" "$VOLUME"
else
echo 0
fi
unset VOLUME
}
# volume
if [[ -z "$1" ]]; then
notify-send "Usage: $0 <up | down | mute | unmute | toggle>"
exit 1
fi
case "$1" in
"+")
pactl -- set-sink-volume "$SINK" "+$INCR"
VOLUME="`volume`"
if [[ $VOLUME -gt $MAX_VOLUME ]]; then
pactl -- set-sink-volume "$SINK" "$MAX_VOLUME"
fi
;;
"-")
pactl -- set-sink-volume "$SINK" "-$INCR"
VOLUME="`volume`"
if [[ $VOLUME -lt $MIN_VOLUME ]]; then
pactl -- set-sink-volume "$SINK" "$MIN_VOLUME"
fi
;;
mute)
pactl -- set-sink-mute "$SINK" 1
;;
unmute)
pactl -- set-sink-mute "$SINK" 0
;;
switch)
pactl list short sinks | awk 'BEGIN {FS=" "}; {print $2}' | $DMENU -p "Output: " -l 3 | xargs -r pactl set-default-sink
;;
toggle)
MUTED="`pacmd dump | grep -P '^set-sink-mute.*\s+yes$'`"
echo "$MUTED" | grep -qF "$SINK"
if [[ $? -eq 0 ]]; then
pactl -- set-sink-mute "$SINK" 0
else
pactl -- set-sink-mute "$SINK" 1
fi
;;
*)
notify-send "Unknown command: $1"
exit 1
;;
esac
# volume
Executable
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
(nmcli con show --active | grep PR_WRK) > /dev/null 2>&1 || \
nmcli connection up PR_WRK && killall -USR1 i3status
# swaymsg workspace 9:9
mmsg -s -t 9
flatpak run org.remmina.Remmina -c \
"${HOME}/.var/app/org.remmina.Remmina/data/remmina/group_rdp_wrk_10-0-10-224.remmina"