Code Monkey home page Code Monkey logo

lain's Introduction

Lain

image

Layouts, widgets and utilities for Awesome WM 4.x

Author

Luca CPZ

Version

git

License

GNU-GPL2

Source

https://github.com/lcpz/lain

Description

Successor of awesome-vain, this module provides alternative layouts, asynchronous widgets and utility functions for Awesome.

Contributions

Constructive criticism and suggestions are welcome.

If you want to create a pull request, make sure that:

  • Your code fits with the general style of the module. In particular, you should use the same indentation pattern that the code uses, and also avoid adding space at the ends of lines.
  • Your code its easy to understand, maintainable, and modularized. You should also avoid code duplication wherever possible by adding functions to or using lain.helpers. If something is unclear, or you can not write it in such a way that it will be clear, explain it with a comment.
  • You test your changes before submitting to make sure that your code works and does not break other parts of the module.
  • You update wiki submodule with a thorough section, if necessary.

Contributed widgets have to be put in widget/contrib.

lain's People

Contributors

0x0d avatar 2009 avatar aajjbb avatar almonteb avatar andering avatar anticlockwise avatar barbuk avatar blueluke avatar cahna avatar czarnodziej avatar d125q avatar exzombie avatar git-utd avatar gregflynn avatar guotsuan avatar hotandcoldfever avatar infinitytotality avatar klaernie avatar lcpz avatar mgoerlich-dev avatar mrmen avatar mrmouss avatar rohieb avatar rosscomputerguy avatar sim590 avatar trap000d avatar unisgn avatar wooparadog avatar worron avatar yawnt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lain's Issues

mem used frozen, swapused jumping

Hi,

With my current setup, often the mem widget displaying mem_now.used value freezes and instead mem_now.swapused flashes during the update step, showing the current mem_now.used value, for some reason in the color (markup) of the mem widget.

Video:
http://youtu.be/YRNpK-6pgJg
Note: the flashing yellow value does change, although it's not identical to htop. In the video it's 1317 at first, changes to values like 1310, 1311 later, while the left constant yellow value stays the same, as it seems, the memused value when awesome starts/rc.lua runs.

Example screens:
wat2
wat

rc.lua:
http://codepad.org/qICre4sQ

theme:
http://codepad.org/ysmWeejM

I think it has to do with using the mem widget twice. Perhaps because of non-local variables (entirely guessing) in https://github.com/copycat-killer/lain/blob/master/widgets/mem.lua

Is one supposed not to use a widget twice?

attempt to call field 'alsa' (a table value)

I tried to create a volume widget using this code:

volumewidget = lain.widgets.alsa({
        timeout = 0.5,
        settings = function ()
            widget:set_markup("<span color='#db2bff'>[ sound ] " .. volume_now.level .. " " .. volume_now.status .. "</span>")
        end
    })

But I get an error:

attempt to call field 'alsa' (a table value)

It's strange because I used this code some months ago and it worked.

imap widget failing

http://i.imgur.com/3mpryRs.jpg

this shows the imap widget not being displayed here are the lines i use in rc.lua:

-- Mail IMAP check
-- commented because it needs to be set before use
mailicon = wibox.widget.imagebox()
mailicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail) end)))
mailwidget = lain.widgets.imap({
timeout = 180,
is_plain = true,
server = "imap.gmail.com",
mail = "[email protected]",
password = "mypassword",
settings = function()
if mailcount > 0 then
mailicon:set_image(beautiful.widget_mail)
widget:set_markup(markup("#cccccc", mailcount .. " "))
else
widget:set_text("")
mailicon:set_image(nil)
end
end
})
snip
right_layout:add(mailicon)
right_layout:add(mailwidget)

yawn with new localization

create a localization : zh_CN, reload the awesome,then

Oops, an error happened!
/usr/share/awesome/lib/lain/widgets/yawn/init.lua:138:attempt to index a nil value

But the weather textbox shows well.
a

yawn quick fix for LANG

Hi

Under debian testing I had to update
LANG to LANGUAGE in order for os.getenv to work correctly

Regards

Browse layout?

Hello, it seems that lain is missing the browse layout from vain. I would really appreciate if you could recreate that layout. Thank you!

lain/widgets/bat.lua line 123 can't compare number to nil

The error in the topic started happening recently.

I looked at the code and it looks like you are actually doing the math to figure out the percentage left on the battery. But this seems to be stored inside "/capacity", so i don't get why don't check for the file before deciding on doing the math.

I fixed the issue temporarly by doing bat_now.perc = first_line(bstr .. "/capacity"), this probably wont work on all systems, but it solves the problem nicely until a better approache is pushed.

Centerfair layout is broken

I get the following error
"Oops, an error happened!
/home/mouss/.config/awesome/lain/layout/centerfair.lua:98: attempt to index field '?' (a nil value'"

dfs script does not work on ubuntu

dfs script fails with message:

awk: line 16: syntax error at or near ,

running it with debug option everything seems fine until the final awk call ("Let's go!"):
$ sh dfs -d
.
.
.
MOUNT_POINT_MAX_LENGTH: 15
MOUNT_POINT_MAX_SIZE: 2147483647
awk: line 16: syntax error at or near ,

lain won't refresh widgets on second screen if using dual screen setup

Title is pretty much all there is to it.
I have 2 screen setup, laptop screen on eDP1 and external monitor on HDMI1, even though in xrandr it is set that HDMI1 is primary:

xrandr --output HDMI1 --primary --left-of eDP1 --auto --output eDP1 --auto 

And tray is on HDMI1 none of lain widgets won't refresh on HDMI1. I tested vicious widgets and it refreshes on both screens at the same time.

I call lain with:

local lain = require("lain")

and widgets with:
batwidget = lain.widgets.bat({
    settings = function()
        bat_perc = bat_now.perc
        if bat_perc == "N/A" then bat_perc = "Plug" end
        widget:set_markup(markup(gray, " Bat ") .. bat_perc .. "")
    end
})

If you need any more info let me know.
Just fyi i changed lain code in widgets/calendar.lua to match my locale (cal -m) and made few changes to icons - changed size. I guess that should not be the issue here.
Also, i just pulled latest code from git and issue is still here.

Imap widget shows too many emails

For example: I get 1(one) email - mail widget say: "you've got 4(four) emails!!!"
I get 2(two) email - mail widget say: "you've got a 8(eight) emails!!!"
etc (always digits of mails is multiply by four).
This is issue, and i've got a question:
Can I change place where the textbox is showing? From upper left to upper right?

A potential error in fs widget

In rc.lua.copland of awesome-copycats project , 'used' may be a nil value and attempt to compare with number

fshomeupd = lain.widgets.fs({
    partition = "/home",
    settings  = function()
        if used < 90 then
            diskbar:set_color(beautiful.fg_normal)
        else
            diskbar:set_color("#EB8F8F")
        end
        diskbar:set_value(used / 100)
    end
})

battery widget complains nil value of 'rate' when on battery

2014-04-26-003050_1920x1080_scrot
Hi, thanks for your gorgeous work, but there is a problem with me, when on battery it will continually complain that 'rate' is a 'nil value' which is on line 72 in lain/widgets/bat.lua, I tried modify the block like this

elseif bat_now.status == 'Discharing'
then
    rate = 1
    time_rate = rem / rate
end

it doesn't complai any more, but I have no idea what value it shoud be, because obviously it is not 1.
Thank you.

oops attempting to compate nil with number in lain/widgets/bat.lua line 128

    if bat_now.status == "Discharging" and notify == "on" and bat_now.perc ~= nil
    then
        if tonumber(bat_now.perc) <= 5 -- ISSUE IS HERE LINE 128 !!! :-1: 
        then
            bat.id = naughty.notify({
                preset = bat_notification_critical_preset,
                replaces_id = bat.id
            }).id
        elseif tonumber(bat_now.perc) <= 15
        then
            bat.id = naughty.notify({
                preset = bat_notification_low_preset,
                replaces_id = bat.id
            }).id
        end
    end
end

not prailno information is displayed in widgets

Hello, after installation, see what information is displayed incorrectly, thought somehow depends on the location, ru_RU, with LANG=C is the same.
pic-20141117-102104

the problem occurs at awesome from git and repo archlinux.

yawn failing

when I use mod+w it displays the message "service not available at this moment"

http://i.imgur.com/3mpryRs.jpg
here are the lines for this widget i use in rc.lua

-- Weather
weathericon = wibox.widget.imagebox(beautiful.widget_weather)
yawn = lain.widgets.yawn(12752509, {
settings = function()
widget:set_markup(markup("#eca4c4", forecast:lower() .. " @ " .. units .. "°C "))
end
})

right_layout:add(weathericon)
right_layout:add(yawn.widget)

Problem with calendar.lua in ubuntu 12.04 / 14.04

Hello! I'm using the calendar.lua in ubuntu 14.04 and i have a issue when the script try to do the sed in the output of /usr/bin/cal for hightlight the current day, take a look to this images:

1

But when the day is not selected:

2

This is the sed that tries to do:

/usr/bin/cal | sed -r -e "s/(^| )(27)($| )/\1<b><span foreground=\"#000000\" background=\"#aaaaaa\">\2<\/span><\/b>\3/"

Thank you!

net issue when 2 widgets

When we have 2 net widgets at same time (one for download speed and one for upload):

    net_widgetdl = lain.widgets.net({
        settings = function()
            widget:set_markup(markup.font("Tamsyn 1", " ") .. net_now.received .. space2)
        end
    })

    widget_netdl = wibox.widget.imagebox()
    widget_netdl:set_image(beautiful.widget_netdl)
    netwidgetdl = wibox.widget.background()
    netwidgetdl:set_widget(net_widgetdl)
    netwidgetdl:set_bgimage(beautiful.widget_display)
    net_widgetul = lain.widgets.net({
        settings = function()
            widget:set_markup(markup.font("Tamsyn 1", " ") .. net_now.sent .. space2)
        end
    })

    widget_netul = wibox.widget.imagebox()
    widget_netul:set_image(beautiful.widget_netul)
    netwidgetul = wibox.widget.background()
    netwidgetul:set_widget(net_widgetul)
    netwidgetul:set_bgimage(beautiful.widget_display)

there is strange issue, download speed freeze from start at 294754.4 or 6574.0 and such, also upload speed not displayin real speed.

When 1 net widget (with: .. net_now.received .. " - " .. net_now.sent .. ) - everything ok.

How to make it work when 2 net widgets at same time?

problem with battery widget bat.lua

Hey,

first of all. Love your themes. However, I am experiencing an issue with the battery widget on my laptop.

./lain/widgets/bat.lua:76: attempt to perform arithmetic operation on local 'rem' (a nil value)

Do you have any idea what might cause this?

Calendar widget dates not aligned to days

When using the calendar widget attached to the textclock widget, the days and dates are not aligned for dates with a single digit. I can't seem to change anything to align them. I've attached a screenshot. Is there a way to fix this? thanks!

2014-01-01-164103_279x135_scrot

lain.widgets.base doesn't work for more than 2 widgets

When adding more that one widget using lain.widgets.base, getting the error "attempt to call field 'base' (a table value)". This behaviour can be reproduced when the following code is added to rc.lua:

mywidget1 = lain.widgets.base({
    timeout = 10,
    cmd = "echo 20",
})
mywidget2 = lain.widgets.base({
    timeout = 5,
    cmd = "echo 10",
})

temperature readings on VM's

VM's don't have temp sensors and calls using the lain.widgets.temp brings up error

/usr/share/awesome/lib/lain/widgets/temp.lua:31 : attempt to index local 'f' (a nil value)

some of the awesome-copycats themes have this included. easy enough to remove if not required but it would be nicer if lain handled this gracefully.

thanks

coretemp widget failing

┌─(t0m5k1@b0x)-(3054/pts/1)-(09:07pm:20/01/14)-
└─>(%:~)
└─>> cat /sys/class/thermal/thermal_zone0/temp
cat: /sys/class/thermal/thermal_zone0/temp: No such file or directory

how do I "obtain" the temp file?
am I missing a dependency?

Issue with widget sizing.

Hi, I've been having an issue with widget sizing, particularly with the Filesystem and Calendar. There's an image here.

I'm running the latest version of Awesome (3.5.5 at time of writing) on Arch Linux.

useless gaps window misplacement

when using layouts with useless gaps, the distance between windows is matching what i set. however, the gaps at the top and left of the layout are larger than they should be, and the gaps at the bottom and right smaller. when i set theme.useless_gap_width to 10, for example, the gaps at the top and left are 12 while the bottom and right are 8. this off-by-two seems consistent (e.g. setting the gap to 20 yields a top and left of 22 and a bottom and right of 18).

temp widget false value with lm sensors with AMD Phenom X4 9550 on A7GM-S 2.0

Hello, thank you for lain and awesome-copycats!

On Arch Linux with AMD Phenom X4 9550 on A7GM-S 2.0, https://github.com/copycat-killer/lain/wiki/temp uses /sys/devices/virtual/thermal/thermal_zone0/temp which always contains the value 40000.

using find /sys/devices/ -name "*temp*" I discovered another file, which seems to contain a correct value (analog to sensors), which gets updated:
/sys/devices/pci0000:00/0000:00:18.3/temp1_input

I'm not sure what causes the first file not being updated or how to tell which file should be used to get the updated temperature.

As a dirty fix, I edit /usr/share/awesome/lib/lain/widgets/temp.lua and replace the imported files, hoping it will stay the same after rebooting.

mpdcover script is slow (imagemagick)

Recently i noticed that whenever a song changed in mpd awesome will hang for 5-10 seconds, i tracked the issue to mpdcover script and eventually to the convert command (imagemagick)
in https://github.com/copycat-killer/lain/blob/a250f4d3fcf483cdd7eb10254690a9a8feb4501a/scripts/mpdcover#L61

Mainly the -thumbnail and -extent arguments are what causes the slowdown.
For -thumbnail it can be changed to -scale or -sample for a faster resize but with lower quality output, as for extent i haven't found any alternatives (but i can't say i noticed it being missing).

Right now im running it with convert "$cover" -scale $COVER_RESIZE -gravity "center" -background "$COVER_BACKGROUND" "$TEMP_PATH" without any issues.

If anyone else has this problem post here, at first i thought imagemagick was bugged but trying the fixes from http://www.daniloaz.com/en/high-cpu-load-when-converting-images-with-imagemagick/ didn't help so i don't think thats it.

yawn missing mist icon

I noticed a missing icon when yahoo weather gives the condition "mist". Maybe this could be linked to "foggy" but curently it gives me no icon.

Lain MPD widget slows down awesome

Not sure how to debug this. I'll follow instructions if you think is relevant. I'm actually just filling the bug for reference, as I don't think is anything critical, but might be messing with someone else's brains

Having lain MPD widget makes awesome lag each X seconds (wich i assume is the plugin refresh rate). I tested it with and without mpd daemon running.

Disabling mpd widget solved all my issues, and I'm not even using it, just reporting it here in case someone else thinks that copycat-killer themes are slow. Nope, they're not, it's just this widget malfunctioning, remove it and stop whinning.

Problem after last update on arch linux !

└-(>:) awesome --version
awesome v3.5.4 (Brown Paper Bag)
• Build: Apr 2 2014 09:32:34 for x86_64 by gcc version 4.8.2 (nobody@)
• Compiled against Lua 5.2.3 (running with Lua 5.2)
• D-Bus support: ✔

Two errors :
-----First one
/usr/share/awesome/lib/gears/color.lua:210: Table index is nil

-----Second one:
error while running function
stack traceback :
/usr/share/awesome/lib/gears/color.lua:210: in functione /usr/share/awesome/lib/gears/color.lua:185
(Tails calls)
/usr/share/awesome/lib/gears/wallpaper:89: in function 'centered'
/home/plonky/.config/awesome/rc.lua:102: in main chunk
error: /usr/share/awesome/lib/gears/color.lua:210: table index is nil

mpd widget keeps creating files in /tmp folder

I have a pretty basic mpd widget setup (except that I'm using mopidy instead of mpd) and I realized some files are constantly created every 2 seconds in /tmp/asyncshell with a content:

OK MPD 0.17.0
ACK [2@0] {password} wrong number of arguments for "password"
volume: 100
repeat: 0
random: 0
single: 0
consume: 0
playlist: 0
playlistlength: 0
xfade: 0
state: stop
OK
OK
OK

When I delete the folder /tmp/asyncshell I start to get the following error every 2 seconds:

Oops, an error happened!
/usr/share/awesome/lib/lain/widgets/mpd.lua:67: attempt to index local 'f' (a nil value)

Is this bug related to lain?

MPD popup shows incorrect album art

Recently after updating to Awesome 3.5.4, I've noticed that the MPD popup is showing incorrect album art.

For example, if a song comes up and I skip it the album art of the next song will be the same as the previous song.

This appears to be partially fixed by simply not skipping ahead.
Using the latest lain version from git.

Tipos at wiki

Hello,

At https://github.com/copycat-killer/lain/wiki/Utilities there are a reference to create_tag, when should be add_tag (In anohter side I'm not sure why remove_tag is not working here).

At https://github.com/copycat-killer/lain/wiki/task, lain.widgets.task.show should be lain.widgets.custom.task.show

Maybe the code introduction to task widget could be changed to something like:

clockicon = wibox.widget.imagebox(beautiful.widget_clock)
lain.widgets.contrib.task:attach(clockicon)

Thank you

'Uselesstile code refactoring' commit breaks vertical client resizing

Previously by setting these keys it was possible to adjust the height of clients:

awful.key({ modkey, "Shift" }, "l", function () awful.client.incwfact(-0.05) end),
awful.key({ modkey, "Shift" }, "h", function () awful.client.incwfact( 0.05) end),

Commit 1925436 has broken this functionality as it no longer uses tag.getdata(t).windowfact.

Battery widget integration with Lenovo Thinkpad using tp_smapi

Like what happened with this battery widget-related issue, I was given an error: attempt to perform arithmetic operation on local 'rem' (a nil value). After some digging, I found that some of the monitors in /sys/class/power_supply/ either did not exist, or did not return expected values.

My laptop is a ThinkPad T420, and it is known that TP batteries don't always play nice with Awesome battery/power status widgets. So I expected to have to do some tweaking to get things working smoothly.

This commit contains my modifications to the bat.lua widget such that it will be compatible with TP laptops that have tp_smapi installed, while also retaining non-TP compatibility (it should work fine on systems that currently use this widget without issue, but I would need someone to test this). bat.lua will also now perform some start-up checks to automatically determine which configuration to use, and it will warn you with naughty notifications if something doesn't look right. There's also some performance tweaks and cleanups included.

You have some great themes! I've only switched to using Awesome WM within the last week, so I'm very new to this. I can make a pull request if this is something you'd be interested in incorporating for other users.

(Some other stylistic thoughts: Would this be better kept in its own tp-bat.lua widget? Should auto-detect be removed in favor of manual configuration by, say, adding a key to the args input table so args['module'] = 'smapi' would enable the alternate behavior?)

MPD widget acting up.

After the recent update too MPD, the widget have started to act up. Displaying N/A and turning on and off. Sometimes displaying the correct information.

lain imap widget doesn't work with gmail

Hey,
Trying to make mailwidget working with gmail account, here my settings:

    timeout  = 380,
    is_plain = true,
    server   = "imap.gmail.com",
    mail     = "[email protected]",
    password = "mypa$$w0rdh3r3",

Sent myself an email, i can see it in inbox and it 100% unread but i never get the mail notification widget showing up.

No space in between yawn.icon and "N/A" if network is down.

This is a minor issue, but I still wanted to let you know. If the network is down, there is no space between the yawn.icon and the yawn.widget if you have them side by side on your panel. Maybe add a space to the "N/A" in your yawn/init.lua ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.