added readme documentation

This commit is contained in:
gokul swaminathan 2021-02-15 17:42:44 -08:00 committed by GitHub
parent 47515afdf9
commit f12f38fcef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 51 additions and 0 deletions

View File

@ -205,6 +205,52 @@ bling.module.tabbed.iter() -- iterates through the currently focused
bling.module.tabbed.pick_with_dmenu() -- picks a client with a dmenu application (defaults to rofi, other options can be set with a string parameter like "dmenu")
```
##### 🎵 Playerctl Signals
This is a signal module in which you can connect to certain bling signals to grab playerctl info. Currently, this is what it supports:
- Song title and artist
- Album art (the path this module downloaded the art to)
- If playing or not
- Position
- Song length
This module relies on `playerctl` and `curl`. If you have this module disabled, you won't need those programs.
###### Signals
```lua
-- bling::playerctl::status -- first line is the signal
-- playing (boolean) -- indented lines are function parameters
-- bling::playerctl::album
-- album_art (string)
-- bling::playerctl::title_artist
-- title (string)
-- artist (string)
-- bling::playerctl::position
-- interval_sec (number)
-- length_sec (number)
```
###### Example Implementation
Lets say we have an imagebox. If I wanted to set the imagebox to show the album art, all I have to do is this:
```lua
local art = wibox.widget {
image = "default_image.png",
resize = true,
forced_height = dpi(80),
forced_width = dpi(80),
widget = wibox.widget.imagebox
}
awesome.connect_signal("bling::playerctl::album", function(path)
art:set_image(gears.surface.load_uncached(path))
end)
```
Thats all! You don't even have to worry about updating the imagebox, the signals will handle that for you.
### 🌈 Theme variables
You will find a list of all theme variables that are used in bling and comments on what they do in the `theme-var-template.lua` file - ready for you to copy them into your `theme.lua`. Theme variables are not only used to change the appearance of some features but also to adjust the functionality of some modules. So it is worth it to take a look at them.
@ -241,6 +287,11 @@ gif by [javacafe](https://github.com/JavaCafe01)
gif by me :)
### Playerctl Signals Implementation
![](https://user-images.githubusercontent.com/33443763/107377569-fa807900-6a9f-11eb-93c1-174c58eb7bf1.png)
screenshot by [javacafe](https://github.com/JavaCafe01)
## TODO
- [ ] Add external sources management for the wallpaper module (URLs, RSS feeds, NASA picture of the day, ...)
- [ ] Scratchpad module