summaryrefslogtreecommitdiff
path: root/bin/menuscripts
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-11-29 19:17:54 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-11-29 19:17:54 +0100
commit0a8efa37e85ad3fc0b633d5e92198b09cd7fd555 (patch)
tree30001a3c2a2444f204b7f80e36fd93cc0b9c7ff8 /bin/menuscripts
parent3d6ee0856e4477378e8237f11f6f74eec9754488 (diff)
parent1c632029d7a02742b0cc740b6984ce139429b88b (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/menuscripts')
-rwxr-xr-xbin/menuscripts/mdbsrv17
-rwxr-xr-xbin/menuscripts/mgame20
2 files changed, 37 insertions, 0 deletions
diff --git a/bin/menuscripts/mdbsrv b/bin/menuscripts/mdbsrv
new file mode 100755
index 0000000..81b5109
--- /dev/null
+++ b/bin/menuscripts/mdbsrv
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+services() {
+ cat <<-EOF
+ 5030 slsksd
+ 9091 transmission
+ 8096 jellyfin
+ 80 ntfy
+ 24961 miniflux
+ 24880 pihole
+ 8384 syncthing
+EOF
+}
+
+service="$(services | column -t -l 2 | dmenu -c -x)"
+[ "$service" ] || exit 1
+$BROWSER "http://192.168.178.79:${service%% *}"
diff --git a/bin/menuscripts/mgame b/bin/menuscripts/mgame
new file mode 100755
index 0000000..7c90a2b
--- /dev/null
+++ b/bin/menuscripts/mgame
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+steam_games()
+{
+ # List every manifest file and get the id of the games from the file names and the name of the
+ # game from the file.
+ find $HOME/.local/share/Steam/steamapps \
+ -maxdepth 1 -type f -iname 'appmanifest_*.acf' |
+ while read -r File; do
+ Name="$(grep '"name"' "$File" | cut -f 4 -d '"')"
+ FileBaseName="${File%.acf}"
+ SteamID="${FileBaseName##*appmanifest_}"
+ printf '%s %s\n' "$SteamID" "$Name"
+ done
+}
+
+Choice="$(steam_games | cut -f 2- -d' ' | dmenu -c -i -x)"
+ID="$(steam_games | grep "[0-9]\+ $Choice" | cut -f 1 -d ' ')"
+
+setsid steam steam://rungameid/"$ID"