5/24/2023 0 Comments I3 desktop managerOs.system("dbus-send -system -print-reply -dest=\"\" /org/freedesktop/ConsoleKit/Manager .Stop") Os.system("dbus-send -system -print-reply -dest=\"\" /org/freedesktop/ConsoleKit/Manager .Restart") Os.system("dbus-send -system -print-reply -dest=\"\" /org/freedesktop/UPower ") _label("Exiting Openbox, please standby.") Community wiki for if someone makes it better suited for i3 ) #!/usr/bin/env python This is the current version of cb-exit at crunchbang linux, could not find a quick link. Posting an answer, as a comment cannot be that long. Just add the script to your path and then create a keybind to call it, such as: bindsym Mod4 x exec i3-exitĪlso, be aware that I prefer to lock my screen when I suspend my computer, so in the suspend function I have a call to i3-lock, which is just a wrapper I created to call my locker of choice.Īs far as locking your screen just create a keybind for your favorite locker (e.g., i3lock), like so: bindsym Mod4 l exec i3lockĪnyone with karma >100 is welcome to improve it. I have aptly renamed it to i3-exit and you can download it here. Just be aware it does require Python, but that is just for creating the dialog window, you can just rip out the dbus commands and use them any way you want. The problem is it is designed around Openbox, so I tweaked it to work with i3 (admittedly I didn't need to do much). One of those scripts is called cb-exit and it provides a nice dialog window to handle logout, suspend, reboot, and shutdown. My current favorite distro is CrunchBang, and the developer has created some cool scripts that come along with it. The i3exit is a simple script like that (for a distro with systemd): #!/bin/shĮcho "Usage: $0 " set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift s) shutdownīindsym l exec -no-startup-id i3exit lock, mode "default"īindsym e exec -no-startup-id i3exit logout, mode "default"īindsym s exec -no-startup-id i3exit suspend, mode "default"īindsym h exec -no-startup-id i3exit hibernate, mode "default"īindsym r exec -no-startup-id i3exit reboot, mode "default"īindsym Shift s exec -no-startup-id i3exit shutdown, mode "default" The shortcuts are written in the mode name as a reminder. I personally use a i3 "mode" to handle system shutdown, reboot, etc.
0 Comments
Leave a Reply. |