forked from Shinonome/dots-hyprland
add systemctl fallbacks for non-systemd systems
This commit is contained in:
@@ -57,13 +57,13 @@ export function launchCustomCommand(command) {
|
||||
Todo.add(args.slice(1).join(' '));
|
||||
}
|
||||
else if (args[0] == '>shutdown') { // Shut down
|
||||
execAsync([`bash`, `-c`, `systemctl poweroff`]).catch(print);
|
||||
execAsync([`bash`, `-c`, `systemctl poweroff || loginctl poweroff`]).catch(print);
|
||||
}
|
||||
else if (args[0] == '>reboot') { // Reboot
|
||||
execAsync([`bash`, `-c`, `systemctl reboot`]).catch(print);
|
||||
execAsync([`bash`, `-c`, `systemctl reboot || loginctl reboot`]).catch(print);
|
||||
}
|
||||
else if (args[0] == '>sleep') { // Sleep
|
||||
execAsync([`bash`, `-c`, `systemctl suspend`]).catch(print);
|
||||
execAsync([`bash`, `-c`, `systemctl suspend || loginctl suspend`]).catch(print);
|
||||
}
|
||||
else if (args[0] == '>logout') { // Log out
|
||||
execAsync([`bash`, `-c`, `pkill Hyprland || pkill sway`]).catch(print);
|
||||
|
||||
Reference in New Issue
Block a user