diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-05 00:08:29 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-05 11:41:20 +1100 |
| commit | 999f295a78beda2cc6d815c5f2ca2703b658916c (patch) | |
| tree | 4f514580b0d19c65e5bfea17ea9736ad6b138489 /src | |
| parent | launcher: add power actions (diff) | |
| download | caelestia-shell-999f295a78beda2cc6d815c5f2ca2703b658916c.tar.gz caelestia-shell-999f295a78beda2cc6d815c5f2ca2703b658916c.tar.bz2 caelestia-shell-999f295a78beda2cc6d815c5f2ca2703b658916c.zip | |
launcher: allow disabling actions
Disable actions in session screen by default
Also remove periods from power action descriptions
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/launcher/actions.tsx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/launcher/actions.tsx b/src/modules/launcher/actions.tsx index 5a0596a..0ded45f 100644 --- a/src/modules/launcher/actions.tsx +++ b/src/modules/launcher/actions.tsx @@ -170,7 +170,7 @@ const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({ lock: { icon: "lock", name: "Lock", - description: "Lock the current session.", + description: "Lock the current session", action: () => { execAsync("loginctl lock-session").catch(console.error); close(); @@ -179,7 +179,7 @@ const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({ logout: { icon: "logout", name: "Logout", - description: "End the current session.", + description: "End the current session", action: () => { execAsync("uwsm stop").catch(console.error); close(); @@ -188,7 +188,7 @@ const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({ sleep: { icon: "bedtime", name: "Sleep", - description: "Suspend then hibernate.", + description: "Suspend then hibernate", action: () => { execAsync("systemctl suspend-then-hibernate").catch(console.error); close(); @@ -197,7 +197,7 @@ const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({ reboot: { icon: "cached", name: "Reboot", - description: "Restart the machine.", + description: "Restart the machine", action: () => { execAsync("systemctl reboot").catch(console.error); close(); @@ -206,7 +206,7 @@ const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({ hibernate: { icon: "downloading", name: "Hibernate", - description: "Suspend to RAM.", + description: "Suspend to RAM", action: () => { execAsync("systemctl hibernate").catch(console.error); close(); @@ -215,7 +215,7 @@ const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({ shutdown: { icon: "power_settings_new", name: "Shutdown", - description: "Suspend to disk.", + description: "Suspend to disk", action: () => { execAsync("systemctl poweroff").catch(console.error); close(); @@ -341,7 +341,9 @@ export default class Actions extends Widget.Box implements LauncherContent { for (const { obj } of fuzzysort.go(wallpaper, Wallpapers.get_default().list, { all: true, key: "path" })) this.#content.add(<Wallpaper {...obj} />); } else { - const list = this.#list.filter(a => this.#map[a].available?.() ?? true); + const list = this.#list.filter( + a => this.#map[a].available?.() ?? !config.disabledActions.get().includes(a) + ); for (const { target } of fuzzysort.go(action, list, { all: true })) this.#content.add(<Action {...this.#map[target]} args={args.slice(1)} />); } |