diff options
-rw-r--r-- | brightness-widget/README.md | 9 | ||||
-rw-r--r-- | brightness-widget/brightness.lua | 11 | ||||
-rw-r--r-- | calendar-widget/README.md | 21 | ||||
-rw-r--r-- | calendar-widget/calendar.lua | 7 | ||||
-rw-r--r-- | jira-widget/jira.lua | 9 |
5 files changed, 44 insertions, 13 deletions
diff --git a/brightness-widget/README.md b/brightness-widget/README.md index 47f7d9c..5bf0794 100644 --- a/brightness-widget/README.md +++ b/brightness-widget/README.md @@ -9,7 +9,7 @@ It is possible to customize widget by providing a table with all or some of the | Name | Default | Description | |---|---|---| | `type`| `arc` | The widget type. Could be `arc` or `icon_and_text` | -| `program` | `light` | The program used to control the brightness, either 'light' or 'xbacklight'. | +| `program` | `light` | The program used to control the brightness, either `light`, `xbacklight`, or `brightnessctl`. | | `step` | 5 | Step | | `base` | 20 | Base level to set brightness to on left click. | | `path_to_icon` | `/usr/share/icons/Arc/status/symbolic/display-brightness-symbolic.svg` | Path to the icon | @@ -44,6 +44,13 @@ To choose the right `program` argument, first you need to check which of them wo ``` If you're on Ubuntu/debian and if the brightness level doesn't change, try to do this: https://github.com/haikarainen/light/issues/113#issuecomment-632638436. + - using `brightnessctl`: + + On Ubuntu it is available in the apt repository. Install and check the ouptut of the following command. + ```bash + brightnessctl --list + ``` + Then clone this repo under **~/.config/awesome/**: ```bash diff --git a/brightness-widget/brightness.lua b/brightness-widget/brightness.lua index b66b1f0..ffdeb7b 100644 --- a/brightness-widget/brightness.lua +++ b/brightness-widget/brightness.lua @@ -45,14 +45,19 @@ local function worker(user_args) local tooltip = args.tooltip or false if program == 'light' then get_brightness_cmd = 'light -G' - set_brightness_cmd = 'light -S ' -- <level> + set_brightness_cmd = 'light -S %d' -- <level> inc_brightness_cmd = 'light -A ' .. step dec_brightness_cmd = 'light -U ' .. step elseif program == 'xbacklight' then get_brightness_cmd = 'xbacklight -get' - set_brightness_cmd = 'xbacklight -set ' -- <level> + set_brightness_cmd = 'xbacklight -set %d' -- <level> inc_brightness_cmd = 'xbacklight -inc ' .. step dec_brightness_cmd = 'xbacklight -dec ' .. step + elseif program == 'brightnessctl' then + get_brightness_cmd = 'bash -c "brightnessctl -m | cut -d, -f4 | tr -d %"' + set_brightness_cmd = 'brightnessctl set %d%%' -- <level> + inc_brightness_cmd = 'brightnessctl set +' .. step .. '%' + dec_brightness_cmd = 'brightnessctl set ' .. step .. '-%' else show_warning(program .. " command is not supported by the widget") return @@ -116,7 +121,7 @@ local function worker(user_args) function brightness_widget:set(value) current_level = value - spawn.easy_async(set_brightness_cmd .. value, function() + spawn.easy_async(string.format(set_brightness_cmd, value), function() spawn.easy_async(get_brightness_cmd, function(out) update_widget(brightness_widget.widget, out) end) diff --git a/calendar-widget/README.md b/calendar-widget/README.md index 3d878bf..c7b46e2 100644 --- a/calendar-widget/README.md +++ b/calendar-widget/README.md @@ -4,7 +4,6 @@ Calendar widget for Awesome WM - slightly improved version of the `wibox.widget. ## Features - - mouse support: scroll up - shows next month, scroll down - previous - themes: | Name | Screenshot | @@ -30,6 +29,23 @@ Calendar widget for Awesome WM - slightly improved version of the `wibox.widget. ![calendar_bottom_right](./calendar_bottom_right.png) + - mouse support: + move to the next and previous month. Using mouse buttons or scroll wheel. + + You can configure this by specifying the button to move to next/previous. + Usually these are configured as follows. If you want to use other mouse buttons, you can find their number using `xev`. + + | number | button | + |--------|--------| + | 4 | scroll up | + | 5 | scroll down | + | 1 | left click | + | 2 | right click | + | 3 | middles click | + + By default `previous_month_button` is 5, `next_month_button` is 4. + + ## How to use This widget needs an 'anchor' - another widget which triggers visibility of the calendar. Default `mytextclock` is the perfect candidate! @@ -47,6 +63,9 @@ local cw = calendar_widget({ theme = 'outrun', placement = 'bottom_right', radius = 8, +-- with customized next/previous (see table above) + previous_month_button = 1, + next_month_button = 3, }) mytextclock:connect_signal("button::press", function(_, _, _, button) diff --git a/calendar-widget/calendar.lua b/calendar-widget/calendar.lua index 81c28a9..d62f52b 100644 --- a/calendar-widget/calendar.lua +++ b/calendar-widget/calendar.lua @@ -95,7 +95,8 @@ local function worker(user_args) local theme = args.theme or 'naughty' local placement = args.placement or 'top' local radius = args.radius or 8 - + local next_month_button = args.next_month_button or 4 + local previous_month_button = args.previous_month_button or 5 local styles = {} local function rounded_shape(size) @@ -198,14 +199,14 @@ local function worker(user_args) popup:buttons( awful.util.table.join( - awful.button({}, 4, function() + awful.button({}, next_month_button, function() local a = cal:get_date() a.month = a.month + 1 cal:set_date(nil) cal:set_date(a) popup:set_widget(cal) end), - awful.button({}, 5, function() + awful.button({}, previous_month_button, function() local a = cal:get_date() a.month = a.month - 1 cal:set_date(nil) diff --git a/jira-widget/jira.lua b/jira-widget/jira.lua index 45c632e..f34e951 100644 --- a/jira-widget/jira.lua +++ b/jira-widget/jira.lua @@ -168,12 +168,11 @@ local function worker(user_args) local cur_status = '' for _, issue in ipairs(result.issues) do - local path_to_avatar = HOME_DIR ..'/.cache/awmw/jira-widget/avatars/' .. issue.fields.assignee.name or issue.fields.assignee.displayName - local name = '' + local name if issue.fields.assignee.name == nil then - name = issue.fields.assignee.displayName - else - name = issue.fields.assignee.name + name = issue.fields.assignee.displayName + else + name = issue.fields.assignee.name end local path_to_avatar = HOME_DIR ..'/.cache/awmw/jira-widget/avatars/' .. name |