Merge branch 'retrozinndev:ryo' into ryo

This commit is contained in:
Mephisto
2025-06-17 20:22:54 +03:00
committed by GitHub
4 changed files with 18 additions and 10 deletions
+4 -2
View File
@@ -5,9 +5,11 @@ import AstalHyprland from "gi://AstalHyprland";
import { execAsync } from "astal"; import { execAsync } from "astal";
export const uwsmIsActive: boolean = await execAsync(
"uwsm check is-active hyprland-uwsm.desktop"
).then(() => true).catch(() => false);
const astalApps: AstalApps.Apps = new AstalApps.Apps(); const astalApps: AstalApps.Apps = new AstalApps.Apps();
const uwsmIsActive: boolean = await execAsync("uwsm check is-active").then((stdout) =>
/hyprland/gi.test(stdout)).catch(() => false);
let appsList: Array<AstalApps.Application> = astalApps.get_list(); let appsList: Array<AstalApps.Application> = astalApps.get_list();
export function getApps(): Array<AstalApps.Application> { export function getApps(): Array<AstalApps.Application> {
+9 -3
View File
@@ -1,11 +1,17 @@
import { monitorFile, Process } from "astal"; import { execAsync, Gio, monitorFile } from "astal";
import { App } from "astal/gtk3"; import { App } from "astal/gtk3";
import { uwsmIsActive } from "./apps";
const monitoringPaths = [ "./scripts", "./window", "./app.ts", "env.d.ts" ]; const monitoringPaths = [ "./scripts", "./window", "./app.ts", "env.d.ts" ];
export function restartInstance(instanceName?: string): void { export function restartInstance(instanceName?: string): void {
Process.exec_async(`astal -q ${ instanceName || App.instanceName || "astal" }`, () => {}); execAsync(`astal -q ${ instanceName ?? App.instanceName ?? "astal" }`);
Process.exec_async(`ags run`, () => {}); Gio.Subprocess.new(
( uwsmIsActive ?
[ "uwsm", "app", "--", "ags", "run" ]
: [ "ags", "run" ]),
Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE
);
} }
export function monitorPaths(): void { export function monitorPaths(): void {
+3 -3
View File
@@ -8,9 +8,9 @@
# From: https://github.com/retrozinndev/colorshell # From: https://github.com/retrozinndev/colorshell
if uwsm check is-active; then if uwsm check is-active "hyprland-uwsm.desktop"; then
hyprctl dispatch exec "uwsm app -- $@" > /dev/null exec uwsm app -- "$@"
exit 0 exit 0
fi fi
hyprctl dispatch exec "$@" > /dev/null exec "$@"
+2 -2
View File
@@ -14,8 +14,8 @@ exec-once = systemctl enable --user --now hyprsunset
exec-once = systemctl enable --user --now hyprpaper exec-once = systemctl enable --user --now hyprpaper
# Scripts # Scripts
exec-once = $exec sh $XDG_CONFIG_HOME/hypr/scripts/gen-pywal.sh exec-once = sh $XDG_CONFIG_HOME/hypr/scripts/gen-pywal.sh
exec-once = $exec sleep 3 && sh $XDG_CONFIG_HOME/hypr/scripts/load-hyprsunset.sh # wait some time to actually set the filters exec-once = sleep 3 && sh $XDG_CONFIG_HOME/hypr/scripts/load-hyprsunset.sh # wait some time to actually set the filters
# Shell # Shell
exec-once = $exec ags run exec-once = $exec ags run