From ce04667af3ec0f9704e806af400e543863780095 Mon Sep 17 00:00:00 2001
From: streetturtle
Date: Tue, 29 Sep 2020 22:23:02 -0400
Subject: [PATCH] [logout] add shorcuts
---
logout-widget/README.md | 12 ++++++++++-
logout-widget/logout-dracula.png | Bin 0 -> 44660 bytes
logout-widget/logout.lua | 33 ++++++++++++++++++++++---------
logout-widget/screenshot.gif | Bin 172152 -> 446468 bytes
4 files changed, 35 insertions(+), 10 deletions(-)
create mode 100644 logout-widget/logout-dracula.png
diff --git a/logout-widget/README.md b/logout-widget/README.md
index a430258..7d1673d 100644
--- a/logout-widget/README.md
+++ b/logout-widget/README.md
@@ -6,6 +6,14 @@ Widget which allows to perform lock, reboot, log out, power off and sleep action
+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/**
@@ -50,7 +58,7 @@ Then
| `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 |
+| `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 |
@@ -62,12 +70,14 @@ Some color themes for inspiration:
![nord](./logout-nord.png)
![outrun](./logout-outrun.png)
![dark](./logout-dark.png)
+![dracula](./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/logout-widget/logout-dracula.png b/logout-widget/logout-dracula.png
new file mode 100644
index 0000000000000000000000000000000000000000..3c61c46c91a767f6f2f3737f6c4ac46e326707ec
GIT binary patch
literal 44660
zcmXuJV{|25*EM|N6WcaAwr!u-w$-tdj%}-B+qP}nNq3xdI?319{d{kY8dbIbtXiw~
z+;h!cV@4_~N+H7G!2tjOL>Xyu6#xLN>EH7u5d7b@%!^<5-wnc5R7MR51a2KD?f)C1
zxJhWasXAJ?c^JEx15~ZPySbUWm~3;b-d_BTP=Z++3Kq
z27zcx`B>OsMr06c*&!X>AFkr#<2mX4t{v|$EA{<7KVq-4Ss%8RK95>dhhXyjBdnEt
zahLSZ^WJ>6KOEow{`%_J`=wh5^RZILpUwD@{&mszx&7xFzAo4IZD{K2@eg74OFOUe
zO{83#2mhu5MWA?y#C{Mj%jq;G&LHQLrDhe=uhCyVN`HnMuoG?v+KOiPVeAbe9aCKR
zCZ!(_`MN%$IR#)Wg2E6XFxN@pxre^F1lQ#x>#C45cYKe6b#R9v{;6?~r_ibpiO8tz
z>X6xUgcnO;mq=(tUJjrx3*x{<%#zgRymR6s
zNytF}N3JRM(|`vn@nm55p@?VzJ9yU2jbdhb9FiOo;YAy1-U(?gmZUIJBX{T(;UP$I
zyyhjU3~&*sT*ZFT?(gpJ?{h+Cp*uiS*kB`0T_f;fYcMi&ZH!E7=7k6?#kl=z4IFED
z04W@Ep!#ozhx`DiM2-L#D`zjhY$SYI(c=kHx~ZPmLP7KNn*U#a{
zNSs%_b{>4rJYS#P5rGai&HW!gBAc!8g
zd8%|HMbqqvoooHp1#P+Sr>G1UyPfHUc@z}j&8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