2020-12-19 03:10:29 +01:00
# Logout Popup Widget
2020-09-02 04:19:52 +02:00
2021-12-13 10:36:10 +01:00
Widget which allows performing lock, reboot, log out, power off and sleep actions. It can be called either by a shortcut, or by clicking on a widget in wibar.
2020-09-03 03:49:20 +02:00
2020-09-07 19:27:15 +02:00
< p align = "center" >
2021-06-04 04:17:13 +02:00
< img src = "https://github.com/streetturtle/awesome-wm-widgets/raw/master/logout-popup-widget/screenshot.gif" alt = "screenshot" >
2020-09-07 19:27:15 +02:00
< / p >
2020-09-03 03:49:20 +02:00
2020-09-30 04:23:02 +02:00
When the widget is shown, following shortcuts can be used:
- < kbd > Escape</ kbd > - hide widget
- < kbd > s</ kbd > - shutdown
- < kbd > r</ kbd > - reboot
- < kbd > u</ kbd > - suspend
- < kbd > k</ kbd > - lock
- < kbd > l</ kbd > - log out
2020-09-02 04:19:52 +02:00
# Installation
2020-09-07 03:47:07 +02:00
Clone this (if not cloned yet) and the [awesome-buttons ](https://github.com/streetturtle/awesome-buttons ) repos under ** ./.config/awesome/**
2020-09-03 21:35:55 +02:00
```bash
cd ./.config/awesome/
git clone https://github.com/streetturtle/awesome-wm-widgets
git clone https://github.com/streetturtle/awesome-buttons
```
Then
2020-09-02 04:19:52 +02:00
2020-09-07 03:47:07 +02:00
- to show by a shortcut - define a shortcut in `globalkeys` :
2020-09-03 03:30:00 +02:00
```lua
2020-12-28 16:19:25 +01:00
local logout_popup = require("awesome-wm-widgets.logout-popup-widget.logout-popup")
2020-09-03 04:02:58 +02:00
...
globalkeys = gears.table.join(
...
2020-12-28 16:19:25 +01:00
awful.key({ modkey }, "l", function() logout_popup.launch() end, {description = "Show logout screen", group = "custom"}),
2020-09-03 03:30:00 +02:00
```
2020-09-07 03:47:07 +02:00
- to show by clicking on a widget in wibar - add widget to the wibar:
2020-09-03 03:30:00 +02:00
```lua
2020-12-19 03:10:29 +01:00
local logout_popup = require("awesome-wm-widgets.logout-popup-widget.logout-popup")
2020-09-03 03:30:00 +02:00
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
2020-12-19 03:10:29 +01:00
logout_popup.widget{},
2020-09-03 03:30:00 +02:00
...
```
2020-09-02 04:19:52 +02:00
# Customisation
2020-09-03 17:11:51 +02:00
| Name | Default | Description |
|---|---|---|
2020-09-07 03:47:07 +02:00
| `icon` | `power.svg` | If used as widget - the path to the widget's icon |
2023-09-21 00:01:55 +02:00
| `icon_size` | 40 | Size of the icon |
| `icon_margin` | 16 | Margin around the icon |
2020-09-03 17:13:55 +02:00
| `bg_color` | `beautiful.bg_normal` | The color the background of the |
2020-09-07 03:47:07 +02:00
| `accent_color` | `beautiful.bg_focus` | The color of the buttons |
| `text_color` | `beautiful.fg_normal` | The color of text |
2021-05-21 19:27:45 +02:00
| `label_color` | `beautiful.fg_normal` | The color of the button's label |
2023-09-21 00:01:55 +02:00
| `phrases` | `{ 'Goodbye!' }` | The table with phrase(s) to show, if more than one provided, the phrase is chosen randomly. Leave empty (`{}`) to hide the phrase |
2023-04-27 09:51:33 +02:00
| `hide_on_leave` | `false` | If the popup should be hidden when the mouse leaves it |
2020-09-03 17:14:31 +02:00
| `onlogout` | `function() awesome.quit() end` | Function which is called when the logout button is pressed |
2020-09-07 20:20:13 +02:00
| `onlock` | `function() awful.spawn.with_shell("systemctl suspend") end` | Function which is called when the lock button is pressed |
2020-09-07 03:47:07 +02:00
| `onreboot` | `function() awful.spawn.with_shell("reboot") end` | Function which is called when the reboot button is pressed |
2020-09-03 17:14:31 +02:00
| `onsuspend` | `function() awful.spawn.with_shell("systemctl suspend") end` | Function which is called when the suspend button is pressed |
| `onpoweroff` | `function() awful.spawn.with_shell("shutdown now") end` | Function which is called when the poweroff button is pressed |
2024-05-17 16:48:25 +02:00
| `onlogout_key` | < kbd > l</ kbd > | Keybinding to execute the logout function |
| `onlock_key` | < kbd > k</ kbd > | Keybinding to execute the lock function |
| `onreboot_key` | < kbd > r</ kbd > | Keybinding to execute the reboot function |
| `onsuspend_key` | < kbd > u</ kbd > | Keybinding to execute the suspend function |
| `onpoweroff_key` | < kbd > s</ kbd > | Keybinding to execute the poweroff function |
2024-05-17 17:14:56 +02:00
| `ignore_case` | true | Ignore if CAPS LOCK is enabled |
2020-09-03 03:30:00 +02:00
2020-09-07 03:47:07 +02:00
Some color themes for inspiration:
2020-09-13 03:12:57 +02:00
![nord ](./logout-nord.png )
![outrun ](./logout-outrun.png )
![dark ](./logout-dark.png )
2020-09-30 04:23:02 +02:00
![dracula ](./logout-dracula.png )
2020-09-07 03:47:07 +02:00
```lua
logout.launch{
2020-09-30 03:23:06 +02:00
bg_color = "#261447", accent_color = "#ff4365", text_color = '#f706cf', icon_size = 40, icon_margin = 16, -- outrun
2020-09-07 03:47:07 +02:00
-- bg_color = "#0b0c10", accent_color = "#1f2833", text_color = '#66fce1', -- dark
-- bg_color = "#3B4252", accent_color = "#88C0D0", text_color = '#D8DEE9', -- nord
2020-09-30 04:23:02 +02:00
-- bg_color = "#282a36", accent_color = "#ff79c6", phrases = {}, -- dracula, no phrase
2020-09-07 03:47:07 +02:00
phrases = {"exit(0)", "Don't forget to be awesome.", "Yippee ki yay!"},
}
2020-09-07 19:27:15 +02:00
```