summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-05 00:00:01 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-05 11:41:20 +1100
commit47db9a5280e7f158e4c71aa1773036dfeb50a38f (patch)
tree957d0a60e190394b71a04547ae42c415db77b686
parentlauncher: fix random wallpaper + add random scheme (diff)
downloadcaelestia-shell-47db9a5280e7f158e4c71aa1773036dfeb50a38f.tar.gz
caelestia-shell-47db9a5280e7f158e4c71aa1773036dfeb50a38f.tar.bz2
caelestia-shell-47db9a5280e7f158e4c71aa1773036dfeb50a38f.zip
launcher: add power actions
-rw-r--r--src/modules/launcher/actions.tsx54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/modules/launcher/actions.tsx b/src/modules/launcher/actions.tsx
index f1e66d4..5a0596a 100644
--- a/src/modules/launcher/actions.tsx
+++ b/src/modules/launcher/actions.tsx
@@ -167,6 +167,60 @@ const actions = (mode: Variable<Mode>, entry: Widget.Entry): ActionMap => ({
entry.set_text("");
},
},
+ lock: {
+ icon: "lock",
+ name: "Lock",
+ description: "Lock the current session.",
+ action: () => {
+ execAsync("loginctl lock-session").catch(console.error);
+ close();
+ },
+ },
+ logout: {
+ icon: "logout",
+ name: "Logout",
+ description: "End the current session.",
+ action: () => {
+ execAsync("uwsm stop").catch(console.error);
+ close();
+ },
+ },
+ sleep: {
+ icon: "bedtime",
+ name: "Sleep",
+ description: "Suspend then hibernate.",
+ action: () => {
+ execAsync("systemctl suspend-then-hibernate").catch(console.error);
+ close();
+ },
+ },
+ reboot: {
+ icon: "cached",
+ name: "Reboot",
+ description: "Restart the machine.",
+ action: () => {
+ execAsync("systemctl reboot").catch(console.error);
+ close();
+ },
+ },
+ hibernate: {
+ icon: "downloading",
+ name: "Hibernate",
+ description: "Suspend to RAM.",
+ action: () => {
+ execAsync("systemctl hibernate").catch(console.error);
+ close();
+ },
+ },
+ shutdown: {
+ icon: "power_settings_new",
+ name: "Shutdown",
+ description: "Suspend to disk.",
+ action: () => {
+ execAsync("systemctl poweroff").catch(console.error);
+ close();
+ },
+ },
});
const Action = ({ args, icon, name, description, action }: IAction & { args: string[] }) => (