mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2026-09-05 10:49:17 +00:00
fix(hypr): restore brave session on startup
This commit is contained in:
@@ -18,6 +18,27 @@ function enable_session_restore {
|
||||
}
|
||||
|
||||
enable_session_restore
|
||||
|
||||
if [ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
|
||||
brave-browser --restore-last-session &
|
||||
|
||||
# Signal starts after Brave and can steal focus while its window is mapping.
|
||||
# Wait for both startup windows, then make Brave the final focused window.
|
||||
for _ in {1..80}; do
|
||||
sleep 0.25
|
||||
if hyprctl clients -j | jq -e '
|
||||
any(.[]; .class == "brave-browser") and
|
||||
any(.[]; .class == "org.signal.Signal")
|
||||
' > /dev/null; then
|
||||
sleep 0.5
|
||||
break
|
||||
fi
|
||||
done
|
||||
hyprctl eval \
|
||||
'hl.dispatch(hl.dsp.focus({ workspace = "1" }))' > /dev/null
|
||||
exit 0
|
||||
fi
|
||||
|
||||
i3-msg 'workspace 9; append_layout ~/.config/i3/brave-workspace-9.json; workspace 5'
|
||||
brave-browser --restore-last-session &
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
local programs = require("env")
|
||||
|
||||
hl.on("hyprland.start", function()
|
||||
hl.exec_cmd(programs.browser, { workspace = "1 silent" })
|
||||
hl.exec_cmd("~/bin/start-brave.sh", { workspace = "1 silent" })
|
||||
hl.exec_cmd(programs.terminal, { workspace = "2 silent" })
|
||||
hl.exec_cmd("flatpak run org.signal.Signal", { workspace = "10 silent" })
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user