This is a terminal-based power menu built with the Bubble Tea Go package. It provides a simple interface to sleep, lock, power off, and reboot your system directly from a terminal.
- Lock: Locks the screen using
swaylock
. - Power Off: Shuts down the system.
- Reboot: Reboots the system.
- Go: Make sure you have Go installed to build the project.
- Sway: This menu is designed to work in the Sway window manager.
- Swaylock: For locking the screen.
systemctl
: Used for power off, reboot, and suspend operations.
-
Clone the repository (if applicable) or create the Go program:
git clone https://github.com/yourusername/power-menu.git cd power-menu
-
Build the project:
go build -o power-menu
-
Move the binary to a directory in your
$PATH
:sudo mv power-menu /usr/local/bin/
Once the program is compiled and moved to your $PATH
, you can launch it using a terminal emulator like st
, alacritty
, or kitty
.
To launch the power menu from your Sway configuration:
-
Open your Sway configuration file:
nano ~/.config/sway/config
-
Add the following keybinding to run the power menu with
Mod+P
:bindsym $mod+p exec alacritty -e power-menu
Replace
alacritty
with the terminal of your choice, such asst
,kitty
, etc. -
Reload the Sway configuration:
swaymsg reload
Now, when you press Mod+P
, your power menu will appear in a terminal.
- Lock: Locks the screen using
swaylock
with your specified wallpaper. - Power Off: Shuts down the system.
- Reboot: Reboots the system.
- You can customize the lock screen wallpaper by modifying the
swaylock
command in thepower-menu
code:Replacecmd = exec.Command("swaylock", "-f", "-i", "/path/to/your/wallpaper.png")
/path/to/your/wallpaper.png
with your desired wallpaper.
MIT License - See LICENSE for more details.