Skip to content

Commit 9d6f9ef

Browse files
committed
tolaria => [hyprland.conf][auto-start-steam.spell][setup-remote-steam.spell]
1 parent 0bb787e commit 9d6f9ef

4 files changed

Lines changed: 38 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- [add_rune](./spells/add_rune.spell) - Add a new [rune](runes-static-configuration-files) to the dotfiles, supports some customization options
88
- [allgst](./spells/allgst.spell) - Performs `git status` on every folder in the `cwd`.
9+
- [auto-start-steam](./spells/auto-start-steam.spell) - Auto starts steam if home assistant booted up the pc
910
- [battery_check](./spells/battery_check.spell) - Checks battery life and suspends if it's too low.
1011
- [bt-connect](./spells/bt-connect.spell)
1112
- [bulkrename](./spells/bulkrename.spell) - Bulk rename every file in the current directory using your default editor (Editor defined by $EDITOR or $VISUAL)
@@ -28,6 +29,7 @@
2829
- [print](./spells/print.spell)
2930
- [projects](./spells/projects.spell) - Open dmenu, show me my projects, open a terminal in the selected one
3031
- [refresh_firefox](./spells/refresh_firefox.spell) - Refreshes firefox
32+
- [setup-remote-steam](./spells/setup-remote-steam.spell) - Starts steam and changes to a 16:9 resolution
3133
- [share](./spells/share.spell)
3234
- [ssh-menu](./spells/ssh-menu.spell) - A menu to quickly open ssh connections
3335
- [steamos](./spells/steamos.spell)

runes/hypr/hyprland.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ exec-once = until pgrep -x swww-daemon; do :; done; sleep 5m; changeMeWallCicle
3535
%% switch on hostname
3636
%% tolaria {
3737
exec-once=/usr/bin/shyprctl daemon
38+
exec-once=~/.local/bin/auto-start-steam
3839
%% }
3940
%% default {
4041
%% }

spells/auto-start-steam.spell

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# Auto starts steam if home assistant booted up the pc
3+
4+
set -euo pipefail
5+
6+
until ping -c 1 pendrellvale.home; do
7+
sleep 1;
8+
done
9+
10+
HA_BEARER_TOKEN=$(cat ~/.config/hass-bearer-token)
11+
12+
entity_id=input_boolean.tolaria_steam_intent
13+
14+
STATE=$(curl -s -H "Authorization: Bearer ${HA_BEARER_TOKEN}" \
15+
-H "Content-Type: application/json" \
16+
http://homeassistant.pendrellvale.home/api/states/$entity_id | jq -r '.state')
17+
18+
if [ "$STATE" == "on" ]; then
19+
echo "Woke by HA intent. Starting Steam..."
20+
21+
# 2. Reset the toggle so it doesn't trigger on a manual power-button boot later
22+
curl -X POST -H "Authorization: Bearer ${HA_BEARER_TOKEN}" \
23+
-H "Content-Type: application/json" \
24+
-d "{\"entity_id\": \"$entity_id\"}" \
25+
http://homeassistant.pendrellvale.home/api/services/input_boolean/turn_off
26+
27+
exec ~/.local/bin/setup-remote-steam
28+
fi

spells/setup-remote-steam.spell

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# Starts steam and changes to a 16:9 resolution
3+
4+
set -euo pipefail
5+
6+
~/.local/bin/toggle-resolution 16:9
7+
exec steam

0 commit comments

Comments
 (0)