From 2e2ab20022875fdcda969b39cb25c3f39cb98b24 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 30 Mar 2019 18:29:01 -0400 Subject: add run shell video --- run-shell/README_old.md | 17 ++++------------- run-shell/out.mp4 | Bin 0 -> 2497645 bytes run-shell/run-shell.lua | 34 +++++++++++++++++++++++----------- 3 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 run-shell/out.mp4 (limited to 'run-shell') diff --git a/run-shell/README_old.md b/run-shell/README_old.md index 039a23c..ae1dbbb 100644 --- a/run-shell/README_old.md +++ b/run-shell/README_old.md @@ -1,26 +1,18 @@ # Run Shell -Blurs / pixelates background and shows widget with run prompt: +Run prompt which is put inside a widget: -![screenshot](./blur.png) - -![screenshot](./pixelate.png) +![video](./out.mp4) ## Installation -1. To blur / pixelate the background this widget used [ffmpeg](https://www.ffmpeg.org/) and [frei0r](https://frei0r.dyne.org/) plugins (if you want to pixelate the background), which you need to install. Installation of those depends on your distribution, for ffmpeg just follow the installation section of the site, for frei0r I was able to install it by simply running - - ``` - sudo apt-get install frei0r-plugins - ``` - 1. Clone this repo under **~/.config/awesome/**: ```bash git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/ ``` -1. Require weather widget at the beginning of **rc.lua**: +1. Require widget at the beginning of **rc.lua**: ```lua local run_shell = require("awesome-wm-widgets.run_shell.run_shell") @@ -30,5 +22,4 @@ Blurs / pixelates background and shows widget with run prompt: ```lua awful.key({modkey}, "r", function () run_shell.launch() end), - ``` -:warning: I am not 100% sure but it may (memory) leak. If awesome uses lots of RAM just reload config (Ctrl + Mod4 + r). + \ No newline at end of file diff --git a/run-shell/out.mp4 b/run-shell/out.mp4 new file mode 100644 index 0000000..5db8172 Binary files /dev/null and b/run-shell/out.mp4 differ diff --git a/run-shell/run-shell.lua b/run-shell/run-shell.lua index c2a2e29..5ab4065 100644 --- a/run-shell/run-shell.lua +++ b/run-shell/run-shell.lua @@ -14,6 +14,8 @@ local gears = require("gears") local completion = require("awful.completion") local naughty = require("naughty") +local HOME = os.getenv("HOME") + local run_shell = awful.widget.prompt() local widget = {} @@ -38,21 +40,41 @@ function widget.new() image = '/usr/share/icons/Arc/actions/symbolic/system-shutdown-symbolic.svg', widget = wibox.widget.imagebox, resize = false, + opacity = 0.2, set_hover = function(self, opacity) - naughty.notify{text = tostring(self.opacity)} self.opacity = opacity self.image = '/usr/share/icons/Arc/actions/symbolic/system-shutdown-symbolic.svg' end } + local turnoff_notification + suspend_button:connect_signal("mouse::enter", function() + turnoff_notification = naughty.notify{ + icon = HOME .. "/.config/awesome/nichosi.png", + icon_size=100, + title = "Huston, we have a problem", + text = "You're about to turn off your computer", + timeout = 5, hover_timeout = 0.5, + position = "bottom_right", + bg = "#F06060", + fg = "#EEE9EF", + width = 300, + } suspend_button:set_hover(1) end) suspend_button:connect_signal("mouse::leave", function() + naughty.destroy(turnoff_notification) suspend_button:set_hover(0.2) end) + suspend_button:connect_signal("button::press", function(_,_,_,button) + if (button == 1) then + awful.spawn("shutdown now") + end + end) + w:setup { { { @@ -90,16 +112,6 @@ function widget.new() { { suspend_button, - { - image = '/usr/share/icons/Arc/actions/symbolic/application-exit-symbolic.svg', - resize = false, - widget = wibox.widget.imagebox, - }, - { - image = '/usr/share/icons/Arc/actions/symbolic/application-exit-symbolic.svg', - resize = false, - widget = wibox.widget.imagebox - }, layout = wibox.layout.fixed.horizontal }, valign = 'bottom', -- cgit v1.2.3 From 38d85c4c1c72de3f8694fc5a04472aea50e6e715 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 30 Mar 2019 18:29:42 -0400 Subject: Rename README_old.md to README.md --- run-shell/README.md | 25 +++++++++++++++++++++++++ run-shell/README_old.md | 25 ------------------------- 2 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 run-shell/README.md delete mode 100644 run-shell/README_old.md (limited to 'run-shell') diff --git a/run-shell/README.md b/run-shell/README.md new file mode 100644 index 0000000..f66a110 --- /dev/null +++ b/run-shell/README.md @@ -0,0 +1,25 @@ +# Run Shell + +Run prompt which is put inside a widget: + +![video](./out.mp4) + +## Installation + +1. Clone this repo under **~/.config/awesome/**: + + ```bash + git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/ + ``` + +1. Require widget at the beginning of **rc.lua**: + + ```lua + local run_shell = require("awesome-wm-widgets.run_shell.run_shell") + ``` + +1. Use it (don't forget to comment out the default prompt): + + ```lua + awful.key({modkey}, "r", function () run_shell.launch() end), + diff --git a/run-shell/README_old.md b/run-shell/README_old.md deleted file mode 100644 index ae1dbbb..0000000 --- a/run-shell/README_old.md +++ /dev/null @@ -1,25 +0,0 @@ -# Run Shell - -Run prompt which is put inside a widget: - -![video](./out.mp4) - -## Installation - -1. Clone this repo under **~/.config/awesome/**: - - ```bash - git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/ - ``` - -1. Require widget at the beginning of **rc.lua**: - - ```lua - local run_shell = require("awesome-wm-widgets.run_shell.run_shell") - ``` - -1. Use it (don't forget to comment out the default prompt): - - ```lua - awful.key({modkey}, "r", function () run_shell.launch() end), - \ No newline at end of file -- cgit v1.2.3 From 6577c02fd4c4d1e2ca7f2f8b8120778e440b3d1d Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 30 Mar 2019 22:32:40 -0400 Subject: Update README.md --- run-shell/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'run-shell') diff --git a/run-shell/README.md b/run-shell/README.md index f66a110..3b84f44 100644 --- a/run-shell/README.md +++ b/run-shell/README.md @@ -2,7 +2,7 @@ Run prompt which is put inside a widget: -![video](./out.mp4) +![video](https://imgur.com/a/BU9cTnj) ## Installation -- cgit v1.2.3 From 9129fe3cbca4ed4456ecd8552b16aa3d6a69124d Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 30 Mar 2019 22:34:04 -0400 Subject: Update README.md --- run-shell/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'run-shell') diff --git a/run-shell/README.md b/run-shell/README.md index 3b84f44..4ad1476 100644 --- a/run-shell/README.md +++ b/run-shell/README.md @@ -2,7 +2,7 @@ Run prompt which is put inside a widget: -![video](https://imgur.com/a/BU9cTnj) +![video](https://imgur.com/ohjAuCQ) ## Installation -- cgit v1.2.3 From 00b4d98c921ac5381589b4d12c1ef1601cf3eaa0 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 30 Mar 2019 22:34:28 -0400 Subject: Update README.md --- run-shell/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'run-shell') diff --git a/run-shell/README.md b/run-shell/README.md index 4ad1476..838b49d 100644 --- a/run-shell/README.md +++ b/run-shell/README.md @@ -2,7 +2,7 @@ Run prompt which is put inside a widget: -![video](https://imgur.com/ohjAuCQ) +![video](https://imgur.com/ohjAuCQ.mp4) ## Installation -- cgit v1.2.3 From 45b718d0b72302ef41d98a993bb89f2e0698e7e4 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 30 Mar 2019 22:37:20 -0400 Subject: Update README.md --- run-shell/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'run-shell') diff --git a/run-shell/README.md b/run-shell/README.md index 838b49d..59cbb5e 100644 --- a/run-shell/README.md +++ b/run-shell/README.md @@ -2,7 +2,7 @@ Run prompt which is put inside a widget: -![video](https://imgur.com/ohjAuCQ.mp4) +[Demo](https://imgur.com/ohjAuCQ.mp4) ## Installation -- cgit v1.2.3