diff --git a/_widgets/logout-menu-widget.md b/_widgets/logout-menu-widget.md new file mode 100644 index 0000000..f644573 --- /dev/null +++ b/_widgets/logout-menu-widget.md @@ -0,0 +1,48 @@ +--- +layout: page +--- +# Logout Menu Widget + +This widget shows a menu with options to log out from the current session, lock, reboot, suspend and power off the computer, similar to [logout-popup-widget](https://github.com/streetturtle/awesome-wm-widgets/tree/master/logout-popup-widget): + +![demo](../awesome-wm-widgets/assets/img/screenshots/logout-menu-widget/logout-menu.gif) + +## Installation + +Clone this repo (if not cloned yet) **./.config/awesome/** + +```bash +cd ./.config/awesome/ +git clone https://github.com/streetturtle/awesome-wm-widgets +``` +Then add the widget to the wibar: + +```lua +local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu") + +s.mytasklist, -- Middle widget + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + ... + -- default + logout_menu_widget(), + -- custom + logout_menu_widget{ + font = 'Play 14', + onlock = function() awful.spawn.with_shell('i3lock-fancy') end + } + ... +``` + +## Customization + +It is possible to customize the widget by providing a table with all or some of the following config parameters: + +| Name | Default | Description | +|---|---|---| +| `font` | `beautiful.font` | Font of the menu items | +| `onlogout` | `function() awesome.quit() end` | Function which is called when the logout item is clicked | +| `onlock` | `function() awful.spawn.with_shell("i3lock") end` | Function which is called when the lock item is clicked | +| `onreboot` | `function() awful.spawn.with_shell("reboot") end` | Function which is called when the reboot item is clicked | +| `onsuspend` | `function() awful.spawn.with_shell("systemctl suspend") end` | Function which is called when the suspend item is clicked | +| `onpoweroff` | `function() awful.spawn.with_shell("shutdown now") end` | Function which is called when the poweroff item is clicked | diff --git a/_widgets/logout-popup-widget.md b/_widgets/logout-popup-widget.md new file mode 100644 index 0000000..dfdf3a5 --- /dev/null +++ b/_widgets/logout-popup-widget.md @@ -0,0 +1,86 @@ +--- +layout: page +--- +# Logout Popup Widget + +Widget which allows to perform 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. + +
+ +
+ +When the widget is shown, following shortcuts can be used: + - Escape - hide widget + - s - shutdown + - r - reboot + - u - suspend + - k - lock + - l - log out + +# Installation + +Clone this (if not cloned yet) and the [awesome-buttons](https://github.com/streetturtle/awesome-buttons) repos under **./.config/awesome/** + +```bash +cd ./.config/awesome/ +git clone https://github.com/streetturtle/awesome-wm-widgets +git clone https://github.com/streetturtle/awesome-buttons +``` +Then + +- to show by a shortcut - define a shortcut in `globalkeys`: + + ```lua + local logout = require("awesome-wm-widgets.experiments.logout-widget.logout") + ... + globalkeys = gears.table.join( + ... + awful.key({ modkey }, "l", function() logout.launch() end, {description = "Show logout screen", group = "custom"}), + ``` + +- to show by clicking on a widget in wibar - add widget to the wibar: + + ```lua + local logout_popup = require("awesome-wm-widgets.logout-popup-widget.logout-popup") + + s.mytasklist, -- Middle widget + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + ... + logout_popup.widget{}, + ... + ``` + +# Customisation + +| Name | Default | Description | +|---|---|---| +| `icon` | `power.svg` | If used as widget - the path to the widget's icon | +| `icon_size` | `40` | Size of the icon | +| `icon_margin` | `16` | Margin around the icon | +| `bg_color` | `beautiful.bg_normal` | The color the background of the | +| `accent_color` | `beautiful.bg_focus` | The color of the buttons | +| `text_color` | `beautiful.fg_normal` | The color of text | +| `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 | +| `onlogout` | `function() awesome.quit() end` | Function which is called when the logout button is pressed | +| `onlock` | `function() awful.spawn.with_shell("systemctl suspend") end` | Function which is called when the lock button is pressed | +| `onreboot` | `function() awful.spawn.with_shell("reboot") end` | Function which is called when the reboot button is pressed | +| `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 | + +Some color themes for inspiration: + +![nord](../awesome-wm-widgets/assets/img/screenshots/logout-popup-widget/logout-nord.png) +![outrun](../awesome-wm-widgets/assets/img/screenshots/logout-popup-widget/logout-outrun.png) +![dark](../awesome-wm-widgets/assets/img/screenshots/logout-popup-widget/logout-dark.png) +![dracula](../awesome-wm-widgets/assets/img/screenshots/logout-popup-widget/logout-dracula.png) + +```lua +logout.launch{ + bg_color = "#261447", accent_color = "#ff4365", text_color = '#f706cf', icon_size = 40, icon_margin = 16, -- outrun + -- bg_color = "#0b0c10", accent_color = "#1f2833", text_color = '#66fce1', -- dark + -- bg_color = "#3B4252", accent_color = "#88C0D0", text_color = '#D8DEE9', -- nord + -- bg_color = "#282a36", accent_color = "#ff79c6", phrases = {}, -- dracula, no phrase + phrases = {"exit(0)", "Don't forget to be awesome.", "Yippee ki yay!"}, +} +``` diff --git a/assets/img/screenshots/logout-menu-widget/logout-menu.gif b/assets/img/screenshots/logout-menu-widget/logout-menu.gif new file mode 100644 index 0000000..9f17b51 Binary files /dev/null and b/assets/img/screenshots/logout-menu-widget/logout-menu.gif differ diff --git a/assets/img/screenshots/logout-popup-widget/logout-dark.png b/assets/img/screenshots/logout-popup-widget/logout-dark.png new file mode 100644 index 0000000..06e7c9c Binary files /dev/null and b/assets/img/screenshots/logout-popup-widget/logout-dark.png differ diff --git a/assets/img/screenshots/logout-popup-widget/logout-dracula.png b/assets/img/screenshots/logout-popup-widget/logout-dracula.png new file mode 100644 index 0000000..3c61c46 Binary files /dev/null and b/assets/img/screenshots/logout-popup-widget/logout-dracula.png differ diff --git a/assets/img/screenshots/logout-popup-widget/logout-nord.png b/assets/img/screenshots/logout-popup-widget/logout-nord.png new file mode 100644 index 0000000..9ab4b55 Binary files /dev/null and b/assets/img/screenshots/logout-popup-widget/logout-nord.png differ diff --git a/assets/img/screenshots/logout-popup-widget/logout-outrun.png b/assets/img/screenshots/logout-popup-widget/logout-outrun.png new file mode 100644 index 0000000..9be68b5 Binary files /dev/null and b/assets/img/screenshots/logout-popup-widget/logout-outrun.png differ diff --git a/assets/img/screenshots/logout-popup-widget/screenshot.gif b/assets/img/screenshots/logout-popup-widget/screenshot.gif new file mode 100644 index 0000000..4975c19 Binary files /dev/null and b/assets/img/screenshots/logout-popup-widget/screenshot.gif differ diff --git a/assets/img/screenshots/logout-popup-widget/screenshot.png b/assets/img/screenshots/logout-popup-widget/screenshot.png new file mode 100644 index 0000000..74ed7f0 Binary files /dev/null and b/assets/img/screenshots/logout-popup-widget/screenshot.png differ