Check out my organizations:
Fork my spoons
Collection of MacOS Hammerspoons plugins
Menu Bar Apps
Collection of MacOS menubar applications
Widgets for Awesome Window Manager
Home Page: http://pavelmakhov.com/awesome-wm-widgets/
License: MIT License
Check out my organizations:
Fork my spoons
Collection of MacOS Hammerspoons plugins
Menu Bar Apps
Collection of MacOS menubar applications
That would be super useful if it's possible to install widgets with luarocks ๐ธ
https://luarocks.org/
Hi.
Found a small typo in README.md for "Email widget".
In this line:
in email.lua cahnge path to python scripts
Thank for your work.
I upgraded to Awesome 4.3. Now the battery arc is not updating anymore. Only when Awesome starts (or restarts) the widget is drawn correctly, but then keeps showing the state of the battery from the moment Awesome was started. Under Awesome 4.2 my config worked correctly. I tested the latest version of awesome-wm-widget (master branch), but this doesn't seem to make a difference.
I think this is caused by the following error:
2019-04-23 14:15:52 E: awesome: Error during a protected call: /usr/share/awesome/lib/wibox/container/arcchart.lua:111: attempt to perform arithmetic on a function value (local 'v')
stack traceback:
/usr/share/awesome/lib/wibox/container/arcchart.lua:111: in function 'awesome-wm-widgets.batteryarc-widget.batteryarc.after_draw_children'
[C]: in function 'xpcall'
/usr/share/awesome/lib/gears/protected_call.lua:36: in function </usr/share/awesome/lib/gears/protected_call.lua:35>
(...tail calls...)
/usr/share/awesome/lib/wibox/hierarchy.lua:323: in local 'call'
/usr/share/awesome/lib/wibox/hierarchy.lua:348: in function 'wibox.hierarchy.draw'
/usr/share/awesome/lib/wibox/hierarchy.lua:345: in function 'wibox.hierarchy.draw'
/usr/share/awesome/lib/wibox/hierarchy.lua:345: in function 'wibox.hierarchy.draw'
/usr/share/awesome/lib/wibox/hierarchy.lua:345: in function 'wibox.hierarchy.draw'
/usr/share/awesome/lib/wibox/hierarchy.lua:345: in function 'wibox.hierarchy.draw'
/usr/share/awesome/lib/wibox/drawable.lua:160: in upvalue 'do_redraw'
/usr/share/awesome/lib/wibox/drawable.lua:390: in function </usr/share/awesome/lib/wibox/drawable.lua:388>
[C]: in function 'xpcall'
/usr/share/awesome/lib/gears/protected_call.lua:36: in function </usr/share/awesome/lib/gears/protected_call.lua:35>
(...tail calls...)
/usr/share/awesome/lib/gears/timer.lua:231: in function </usr/share/awesome/lib/gears/timer.lua:229>
My config is available here: https://github.com/teranex/awesome-config/tree/awesome-4.0
Proposal: add customization on instantiation or/and via env vars.
Can we get the rc.lua examples to be copy-pastable? Disclaimer I have no clue about Lua syntax, so I (assuming the example snippet in battery-widget/README wasn't directly copy/pastable) have been trying to get this to work, and can't resolve the syntax. If you were curious, here's what I have.
require("battery")
s.mytasklist,
{ -- This line give mes an 'unexpected symbol near { in rc.lua'
layout = wibox.layout.fixed.horizontal,
battery_widget,
}
But it would be great if non-Lua inclined users could get it up and running faster. I should also clarify I'm on awm 3.5.6, so I'm going to try using the actual compatible version - but it looks like a Lua syntax error not an awm version-related issue.
You can add mailnag support for email widget?
In the widget code, you need to call via DBUS to mailnag and get the number of letters, and so on. Icon of the widget with the number of new emails, and when you hover icon notification the list - the subject of the letter and the sender.
When clicking on the widget icon, open the mail client.
So, when it's charging, all works correctly and widget shows current %, but when it's unplugged, the widget number is always 0, and even with high battery there is a notification with "low battery level"
Hi,
First of all thank for sharing this code publicly :)
I have trouble using your widgets on Awesome WM.
I have cloned the repo in .config/awesome/
This is my config file .config/awesome/rc.lua
:
local brightness_w = require("awesome-wm-widgets.brightness-widget.brightness")
local batteryarc_widget = require("awesome-wm-widgets.batteryarc-widget.batteryarc")
local volumearc_widget = require("awesome-wm-widgets.volumearc-widget.volumearc")
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
wibox.widget.systray(),
volumearc_widget,
brightness_w,
batteryarc_widget,
mytextclock,
s.mylayoutbox,
},
}
And the result is this
Do you have any idea of something I did wrong ?
I'm using debian testing and awesome 4.2.
Thank you for your help ;)
Matthias
The regular volume icon works pretty well, but the volumebar widget is just not showing any bar... the widget is there (i can see it because there is a bigger space between my ":") and scrolling and clicking works i can test it in alsamixer. Maybe you have an idea...
PS.: for an update i would change your amixer -D pulse sset Master (...)
in amixer set Master (...)
because somehow it is faster and i got really weird side effects using your version. The level of the speakers left and right were unstable and were changing while changing the volume by scrolling. Even the levels of left and right didn't stayed equal. sometimes left was at 50% and right at 100% and the other way around, it seems like it depends on the scrolling speed... Same happened with using amixer -D pulse sset Master
for keyboard shortcuts.
With changing that i would change amixer -D pulse sget Master
to amixer get Master
, too.
Again greetings from Berlin, germany
and big thanks for the nice widgets!
Josh
I put the json.lua in awesome in ./config/awesome/ and the Arc folder in /user/share/icons/
I edited in the weather.lua my city and my api code (both are working i checked it via the browser at http://api.openweathermap.org/data/2.5/weather?q= and i got all the Output for Berlin and my key is working) in the rc.lua I added the line require("awesome-wm-widgets.weather-widget.weather") and in the wibar
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
mykeyboardlayout,
weather,
wibox.widget.systray(),
cpu_widget,
mytextclock,
s.mylayoutbox,
},
the widget is just not showing up. i don't have no erros i think because i got an error while i didn't entered my key...
ps.i hate markup i don't know how to make new paragraphs haha
greetings from germany!
I tried to add the mpdarc_widget
as written in README and got following error.
I looked the error up and it seems to be checking for is_widget
property which is not there.
I tried to dump the variable and it is there just as returned by the module.. the table of two sub-widgets and layout. Perhaps the returned object should also be created using wibox.widget
? Would try and PR it, but I don't know how to use wibox
to "merge two widgets together using layout".
I'm on x11-wm/awesome-4.2-r2
For example, in #66 the light
command is used to control the brightness.
I am wondering, whether there could be a way to control the commands (and icon path) without modifying the cloned repo.
For example, by reading the values from a lua table (and providing the defaults you are already using).
This way, the table could be written before the widget is added to the wibox.
I use the icons from mate icon theme, but had to overwrite the path inside the repo. Feels meh.
@streetturtle Would you accept PRs in this regard?
At my work I have internet connection though proxy server and when I try to translate something then the whole awesome wm session is hangs. Only killing and restarting awesome wm can help.
At home I have direct internet connection and I don't have the same problem.
Do you know how can I solve this problem?
I have set environment variables:
export http_proxy=http://my-proxy-server:my-port/
export https_proxy=https://my-proxy-server:my-port/
Hi,
I'm running Awesome WM 4.2 under kali with 4.18.0-kali3-amd64 kernel (last update). Laptop is Alienware 13R3 OLED.
battery-widget report:
2018-12-19 15:07:54 E: Error during a protected call: ...ig/awesome/awesome-wm-widgets/battery-widget/battery.lua:101: attempt to perform arithmetic on a nil value (field '?') stack traceback: ...ig/awesome/awesome-wm-widgets/battery-widget/battery.lua:101: in upvalue 'callback' /usr/share/awesome/lib/awful/widget/watch.lua:77: in function </usr/share/awesome/lib/awful/widget/watch.lua:76> (...tail calls...) /usr/share/awesome/lib/awful/spawn.lua:308: in function </usr/share/awesome/lib/awful/spawn.lua:302> [C]: in function 'xpcall' /usr/share/awesome/lib/gears/protected_call.lua:36: in function </usr/share/awesome/lib/gears/protected_call.lua:35> (...tail calls...) /usr/share/awesome/lib/awful/spawn.lua:403: in upvalue 'done' /usr/share/awesome/lib/awful/spawn.lua:418: in function </usr/share/awesome/lib/awful/spawn.lua:410>
Same with batteryarc-widget but with different line number.
acpi report:
Battery 0: Discharging, 0%, rate information unavailable
Battery 1: Full, 100%
acpi -i report:
Battery 0: Discharging, 0%, rate information unavailable
Battery 1: Full, 100%
Battery 1: design capacity 5000 mAh, last full capacity 4340 mAh = 86%
installed Arc font under ~/.icons, cloned the repo under ~/.config/awesome, required the widget and used it, though nothing gets displayed.
not sure what i'm doing wrong, i do have equivalent battery and volume working from elsewhere. any suggestions?
awesome -version: 4.2
When battery level is low the warning message pops up every 10 seconds, which is too often. The solution could be to introduce some kind of counter, so that message shows up every ~10th time.
Hi i got spotify-shell working everything works but Pause doesn't work any help on fixing it. It just goes to next track when i hit Pause
Sorry for creating an issue for this. But I wasn't able to find any other way to ask.
What font do you use in your awesome wm config? The one that's on screenshots.
Thank you for answer in advance.
I can't seem to get any of your widgets working at all on the three Awesome themes that I have (multicolor, powerline and powerline-blue).
Mainly I'm trying to use the spotify-widget. I'm following your instructions but it says to put:
"local spotify_widget = require("awesome-wm-widgets.spotify-widget.spotify")" into rc.lua as well as the "spotify_widget(),"
But since these themes use theme.lua - do I put those lines in there instead as that's where the other widgets are being called.
I can't seem to get it to work when I put it in either. I also have found a couple of sets of instructions for this - one with spotify_widget, and one with spotify_widget(), I can't seem to get either working.
Any suggestions?
the widget is working, but i can't see the number ,i just see three points like this ...
cloned the repo into ~/.config/awesome/widgets
but the syntax in all of the readme files didnt work with awesomwm 4.x versions
tried volume and battery
Currently for widgets which require internet connection (email/weather) in case of internet access loss they throw exceptions. Would be nice to hadle such errors and add small error icons for example. Or some error message.
I love the widgets, but have noticed a memory leak in the volume, brightness, and battery widgets. I see the leak on my desktop at work (which runs the unmodified volume widget code from the repository on an Antergos base) and on my laptop (which runs slightly modified versions of the volume and brightness widgets: it's an ARM chip running ArchLinuxARM (v7), so I cat the relevant file for the brightness and don't use pulse for the volume, but the battery widget is unchanged.)
I found the leak on the desktop system when getting a 'failed to allocate' error on trying to start a new instance of something, then tracking memory via htop; this showed a fairly steady leak (~500k/sec, if I'm reading htop right). I ruled out as much as I could, then finally decided to try disabling the volume widget; AwesomeWM memory use returned to stable. I then checked and repeated the same on the laptop, checking each widget individually. The leaks on the brightness and volume widgets are pretty much the same, though the battery widget seems to leak only slowly---I didn't even notice it at first.
Anyone else notice something similar, or have any idea how to fix it?
Just got this exception raised:
2018-07-17 13:47:55 W: awesome: luaA_dofunction:77: error while running function!
stack traceback:
...wesome/awesome-wm-widgets/volumearc-widget/volumearc.lua:38: in function 'callback'
/usr/share/awesome/lib/awful/widget/watch.lua:77: in function </usr/share/awesome/lib/awful/widget/watch.lua:76>
error: ...wesome/awesome-wm-widgets/volumearc-widget/volumearc.lua:38: bad argument #2 to 'format' (number expected, got nil)
So volume
was nil
for some reason (I think it was after unlocking i3lock
). No more additional data for now.
Hi,
I don't know much about the acpi and the different things under /sys/class/power_supply/BAT1/ but I figured I'd at least mention that I had to change the following lines in battery.lua to get it to work:
local _, status, capacity, time = string.match(stdout, '(.+): (%a+), (%d%d)%%, (.+)')
charge = tonumber(capacity)
Maybe it is not necessary for all systems, but at least for my system I had to do that.
Thanks for the excellent widgets, I've only tried the battery one so far but I will test the others soon enough! :)
My awesome version:
awesome v4.0 (Harder, Better, Faster, Stronger)
โข Compiled against Lua 5.1.5 (running with Lua 5.1)
โข D-Bus support: โ
โข execinfo support: โ
โข RandR 1.5 support: โ
โข LGI version: 0.9.1
sudo git clone https://gist.github.com/fa6258f3ff7b17747ee3.git /opt/
it's not good idea. In /opt/ you will have git repository.
In order to make the widget work again, I had to modify it as seen muammar/awesome@9089d27.
Battery is working for me, but volume needs to be refactored
Thanks for effort anyway
When battery is being charged the icons widget puts icons with following name battery-...-symbolic-charging.svg
but in Arc such icons is called battery-...-charging-symbolic.svg
.
This creates problems and freezes Awesome whenever the Internet connection is unstable.
The workaround is to asynchronously spawn curl subprocess: https://github.com/vicious-widgets/vicious/blob/9cf9e99/widgets/weather_all.lua#L95
I have experienced a problem which can be reproduced as follows:
Ctrl+Super+r
, the icon shows as it shouldThe issue consists of strict in-range comparisons aka <
or >
w/o ==
, which ignores all the in-sector boundaries from the comparison, resulting into wind direction calc function returning nil
.
It's coupled with a problem of 0
vs. 360
degrees.
Better and more optimal/reliable solution is to do math: https://www.campbellsci.eu/blog/convert-wind-directions
For the battery widgets, the nichosi.png
image is used:
icon = HOME .. "/.config/awesome/nichosi.png"
This does not seem to be present in my case -- and it is not part of the installation instructions.
I would assume, that this is a bug.
The brightness widget matches only the first 2 digits, therefore 100% Brightness is shown as 0% on the widget (if light -G
returns 100.00
).
From brightnessarc.lua:
local brightness_level = string.match(stdout, "(%d?%d?)")
Modifying the line above to
local brightness_level = string.match(stdout, "(%d?%d?%d?)")
fixes the issue.
I have followed the instructions to install the widget, but it does not show anything. Below, you may see the diff of the changes that I did. Note that the only difference is that I used bottom_layout:add(spotify_widget)
instead of right_layout:add(spotify_widget)
.
diff --git a/rc.lua b/rc.lua
index 0ab896d..e062ce1 100644
--- a/rc.lua
+++ b/rc.lua
@@ -12,6 +12,8 @@ local naughty = require("naughty")
local menubar = require("menubar")
-- Vicious
local vicious = require("vicious")
+-- Spotify
+require("spotify")
-- Load Debian menu entries
require("debian.menu")
@@ -297,6 +299,7 @@ vicious.register(batwidget, vicious.widgets.bat, ' | Bat:<span color="#CC9933">
bottom_layout:add(batwidget)
bottom_layout:add(cpuwidget)
bottom_layout:add(cpuwidget2)
+ bottom_layout:add(spotify_widget)
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
diff --git a/spotify.lua b/spotify.lua
new file mode 100644
index 0000000..828d3e6
--- /dev/null
+++ b/spotify.lua
@@ -0,0 +1,15 @@
+local wibox = require("wibox")
+local awful = require("awful")
+
+spotify_widget = wibox.widget.textbox()
+
+function updateSpotifyWidget(widget)
+ local current = awful.util.pread('sp current-oneline')
+ widget:set_text(current)
+end
+
+spotify_timer = timer ({timeout = 10})
+spotify_timer:connect_signal ("timeout", function() updateSpotifyWidget(spotify_widget) end)
+spotify_timer:start()
+
+spotify_timer:emit_signal("timeout")
\ No newline at end of file
Sometimes weather widget freezes Awesome, I guess the problem is in long polling request to the weather API. So it would be good to add some timeout to the request.
Also sometimes (for example if there are some DNS problems) Awesome shows exception that json.lua cannot parse string. This should also be handled.
I get this pop up error whenever I change the brightness. The brightness change is working fine, but the error is annoying. A quick glance over the lua doesn't have anything sticking out to me.
Line 50 looks like the main function. Here are lines 49-51:
spawn.easy_async(GET_BRIGHTNESS_CMD, function(stdout, stderr, exitreason, exitcode)
update_widget(brightness_widget, stdout, stderr, exitreason, exitcode)
end)
Being able to paste non-english characters into the widget would be very useful.
HI streetturtle
I need some help adding spotify_shell. I did it but its not coming up i do not know if i did it right. I'm using this guys awesome config. if you can look at the rc.lua see where everything should go and tell me.
Hello,
I added the volumearc widget, control using the mouse wheel works, also mute / unmute on left click. However, the color does not change when muted. The pattern matching doesn't seem to be a problem:
> soff = [[Simple mixer control 'Master',0
>> Capabilities: pvolume pswitch pswitch-joined
>> Playback channels: Front Left - Front Right
>> Limits: Playback 0 - 65536
>> Mono:
>> Front Left: Playback 22939 [35%] [off]
>> Front Right: Playback 22939 [35%] [off]
>> ]]
> son = [[Simple mixer control 'Master',0
>> Capabilities: pvolume pswitch pswitch-joined
>> Playback channels: Front Left - Front Right
>> Limits: Playback 0 - 65536
>> Mono:
>> Front Left: Playback 22939 [35%] [on]
>> Front Right: Playback 22939 [35%] [on]
>> ]]
> string.match(soff, "%[(o%D%D?)%]")
off
> string.match(son, "%[(o%D%D?)%]")
on
The son
and soff
strings are the output of amixer -D pulse sget Master
.
When am I supposed to find the definition of beautiful.widget_red
? grep -R "widget_red" /usr
turned up no relevant hits.
Disclaimer: I am both a lua and awesome newbie, so that there may be some trivial problem on my side involved.
Why increase the backlight to an unexpected value? I suspect that this is due to sending multiple presses, but I tried to establish sleep and it did not work. Any ideas? Thank!
Hi,
I submitted an issue some months ago and that seem to be working quite fine :)
Right now I was trying out the brightness widget and don't seem to be able to get it working and couldn't see any install instructions for it.
So far I added it as a require at the top of rc.lua and added:
s.mytasklist,
{
layout = wibox.layout.fixed.horizontal,
- -
brightness_widget,
- -
},
The battery and volume widget works splendidly so far at least, very nice work! :)
Best regards,
Taddic
The shell command using grep on the output of free will not return anything with most locales,
hence returning void.
Calling free with env did the trick for me.
I used the README.md instructions for adding a battery widget and nothing happened. The widget does not appear. No errors were raised (that I saw).
My awesomewm version is 4.2. Except for a couple lines changing default terminal and text editors and what theme to use (I have a custom theme) and also the lines added according to the instructions in README.md, nothing is different in my rc.lua from /etc/xdg/awesome/rc.lua.
But
I get spurious battery warnings when the battery is 100% full and I am on mains power. The battery arc is hollow, since my laptop stops charging when the battery is full and it runs on mains. When I put the mouse over the circle, it shows a small popup saying that the battery is 100% full. I would like to receive those battery warnings only if the battery is actually weak.
I am running 94252c4 with Awesome 4.2 on Debian/Buster (shouldn't matter, imho).
Make screenshot with all available widgets
Please include in troubleshooting "-D pulse" option of amixer can cause problems. As it did for me :).
I suggest:
local CMD_PARAMS="-D pulse" -- try without "-D pulse", check command in command line [INSTALL]
local GET_VOLUME_CMD = 'amixer ' ..CMD_PARAMS.. ' sget Master'
local INC_VOLUME_CMD = 'amixer ' ..CMD_PARAMS.. ' sset Master 5%+'
local DEC_VOLUME_CMD = 'amixer ' ..CMD_PARAMS.. ' sset Master 5%-'
local TOG_VOLUME_CMD = 'amixer ' ..CMD_PARAMS.. ' sset Master toggle'
volumebar_widget:connect_signal("button::press", function(_,_,_,button)
if (button == 4) then awful.spawn(INC_VOLUME_CMD, false)
elseif (button == 5) then awful.spawn(DEC_VOLUME_CMD, false)
elseif (button == 1) then awful.spawn(TOG_VOLUME_CMD, false)
end
spawn.easy_async(GET_VOLUME_CMD, function(stdout, stderr, exitreason, exitcode)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.