Merge branch 'master' of github.com:streetturtle/awesome-wm-widgets
This commit is contained in:
commit
5ea231d259
|
@ -20,7 +20,7 @@ Blurs / pixelates background and shows widget with run prompt:
|
||||||
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
|
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
|
```lua
|
||||||
local run_shell = require("awesome-wm-widgets.run_shell.run_shell")
|
local run_shell = require("awesome-wm-widgets.run_shell.run_shell")
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Run Shell
|
||||||
|
|
||||||
|
Run prompt which is put inside a widget:
|
||||||
|
|
||||||
|
[Demo](https://imgur.com/ohjAuCQ.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),
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
# Run Shell
|
|
||||||
|
|
||||||
Blurs / pixelates background and shows widget with run prompt:
|
|
||||||
|
|
||||||
![screenshot](./blur.png)
|
|
||||||
|
|
||||||
![screenshot](./pixelate.png)
|
|
||||||
|
|
||||||
## 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**:
|
|
||||||
|
|
||||||
```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),
|
|
||||||
```
|
|
||||||
:warning: I am not 100% sure but it may (memory) leak. If awesome uses lots of RAM just reload config (Ctrl + Mod4 + r).
|
|
Binary file not shown.
|
@ -14,6 +14,8 @@ local gears = require("gears")
|
||||||
local completion = require("awful.completion")
|
local completion = require("awful.completion")
|
||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
|
|
||||||
|
local HOME = os.getenv("HOME")
|
||||||
|
|
||||||
local run_shell = awful.widget.prompt()
|
local run_shell = awful.widget.prompt()
|
||||||
|
|
||||||
local widget = {}
|
local widget = {}
|
||||||
|
@ -38,21 +40,41 @@ function widget.new()
|
||||||
image = '/usr/share/icons/Arc/actions/symbolic/system-shutdown-symbolic.svg',
|
image = '/usr/share/icons/Arc/actions/symbolic/system-shutdown-symbolic.svg',
|
||||||
widget = wibox.widget.imagebox,
|
widget = wibox.widget.imagebox,
|
||||||
resize = false,
|
resize = false,
|
||||||
|
opacity = 0.2,
|
||||||
set_hover = function(self, opacity)
|
set_hover = function(self, opacity)
|
||||||
naughty.notify{text = tostring(self.opacity)}
|
|
||||||
self.opacity = opacity
|
self.opacity = opacity
|
||||||
self.image = '/usr/share/icons/Arc/actions/symbolic/system-shutdown-symbolic.svg'
|
self.image = '/usr/share/icons/Arc/actions/symbolic/system-shutdown-symbolic.svg'
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local turnoff_notification
|
||||||
|
|
||||||
suspend_button:connect_signal("mouse::enter", function()
|
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)
|
suspend_button:set_hover(1)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
suspend_button:connect_signal("mouse::leave", function()
|
suspend_button:connect_signal("mouse::leave", function()
|
||||||
|
naughty.destroy(turnoff_notification)
|
||||||
suspend_button:set_hover(0.2)
|
suspend_button:set_hover(0.2)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
suspend_button:connect_signal("button::press", function(_,_,_,button)
|
||||||
|
if (button == 1) then
|
||||||
|
awful.spawn("shutdown now")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
w:setup {
|
w:setup {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -90,16 +112,6 @@ function widget.new()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
suspend_button,
|
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
|
layout = wibox.layout.fixed.horizontal
|
||||||
},
|
},
|
||||||
valign = 'bottom',
|
valign = 'bottom',
|
||||||
|
|
Loading…
Reference in New Issue