added remmina, changes in niri

This commit is contained in:
2025-11-20 22:00:39 +03:00
parent 1cc41d3fff
commit 63a24620d8
10 changed files with 261 additions and 68 deletions

View File

@ -4,7 +4,7 @@
cmd="fuzzel --minimal-lines --dmenu --hide-prompt "
action=$(printf "Sleep\0icon\x1fsystem-suspend\nReboot\0icon\x1fsystem-reboot\nShutdown\0icon\x1fsystem-shutdown\nExit Niri\0icon\x1fsystem-log-out\nCancel" | $cmd --index)
action=$(printf "Sleep\0icon\x1fnfrc-suspend\nReboot\0icon\x1fnfrc-reboot\nShutdown\0icon\x1fnfrc-poweroff\nExit Niri\0icon\x1fnfrc-logout\nCancel" | $cmd --index)
command=""

41
bin/fuzzel-remmina Executable file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env bash
read -r -d '' awkscript <<- 'EOF'
{
if ($1 == "name") {
print FILENAME":"$2;
}
if ($1 == "protocol") {
print "("$2")";
}
}
EOF
getentry() {
awk -F'=' "$awkscript" "$1" | paste -sd' '
}
export awkscript
export -f getentry
groups=$(ls -1 ~/.local/share/remmina/ | cut -d_ -f1 | uniq)
groupcnt=$(wc -l <<<$groups)
while true; do
if [ "$groupcnt" -eq 1 ]; then
group=$groups
else
group=$(echo -e "$groups" | fuzzel --dmenu)
fi
[ -z "$group" ] && exit
entries=$(find ~/.local/share/remmina/ -name "$group*" -type f -exec bash -c "getentry {}" \; )
#echo -e "$entries"
fuzcmd="fuzzel --dmenu --terminal='' --with-nth=2 --accept-nth=1 --nth-delimiter=: --hide-prompt"
selected=$(echo -e "$entries" | $fuzcmd 2>/dev/null | tail -n1)
[[ $selected =~ delim ]] && [ "$groupcnt" -gt 1 ] && continue
break
done
remmina -c "$selected"

View File

@ -14,9 +14,11 @@ action=1
case "$action" in
0)
echo '{"text": "connecting...", "class":"action"}'
endpoint=$(tailscale status | grep "exit node" | awk '{print $2}' | $cmd)
items=$(tailscale status | grep "exit node" | grep -v "offline" | awk '{print $2 " (" $1 ")"}')
endpoint=$(echo -e "$items" | $cmd)
[ -z "$endpoint" ] && exit
tailscale set --exit-node="$endpoint"
tailscale set --exit-node="${endpoint% *}"
tailscale up
;;
1)