diff --git a/.gitignore b/.gitignore index 82c3d36..468bc14 100644 --- a/.gitignore +++ b/.gitignore @@ -126,7 +126,8 @@ $RECYCLE.BIN/ .LSOverride # Icon must end with two \r -Icon +Icon + # Thumbnails ._* @@ -147,3 +148,6 @@ Network Trash Folder Temporary Items .apdisk +# awesome widgets/modules/etc that should not be included +awesome/awesome-wm-widgets/ +awesome/cyclefocus/ \ No newline at end of file diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml index 9926686..bb3c40b 100644 --- a/alacritty/alacritty.yml +++ b/alacritty/alacritty.yml @@ -61,25 +61,9 @@ window: # auto pick-up. Set this to `None` to use the default theme variant. #decorations_theme_variant: None - # Resize increments - # - # Prefer resizing window by discrete steps equal to cell dimensions. - #resize_increments: false - -#scrolling: - # Maximum number of lines in the scrollback buffer. - # Specifying '0' will disable scrolling. - #history: 10000 - - # Scrolling distance multiplier. - #multiplier: 3 - - # Transparent cell backgrounds - # - # Whether or not `window.opacity` applies to all cell backgrounds or only to - # the default background. When set to `true` all cells will be transparent - # regardless of their background color. - #transparent_background_colors: false +scrolling: + history: 150 + transparent_background_colors: true # Bell # diff --git a/awesome/README.md b/awesome/README.md index b1a62dd..4cd4c55 100644 --- a/awesome/README.md +++ b/awesome/README.md @@ -1,10 +1,12 @@ # awesome config ## Deps - picom -- [Fira Code](https://github.com/tonsky/FiraCode) -- pactl (fc38 `pulseaudio-utils`) +- [Fira Code](https://github.com/tonsky/FiraCode) *(technically optional, but the `spacestation` theme uses it)* +- pactl [fc38 `pulseaudio-utils`] (for `volume_widget`) ## Credits ### Widgets/modules/etc I use -- `volume_widget` comes from [streetturtle's widgets](https://github.com/streetturtle/awesome-wm-widgets) (MIT) +_You'll need to download these yourself if you're taking bits from my dotfiles_ +- `volume_widget` comes from [awesome-wm-widgets by streetturtle](https://github.com/streetturtle/awesome-wm-widgets) (MIT) +- `cyclefocus` comes from [awesome-cyclefocus by blueyed](https://github.com/blueyed/awesome-cyclefocus) (GPL 2.0) ### Other people's dotfiles I took from - Modularization is from [epsi-rns' awesome dotfiles](https://gitlab.com/epsi-rns/dotfiles) (MIT) diff --git a/awesome/awesome-wm-widgets/.luacheckrc b/awesome/awesome-wm-widgets/.luacheckrc deleted file mode 100644 index e4f47fa..0000000 --- a/awesome/awesome-wm-widgets/.luacheckrc +++ /dev/null @@ -1,24 +0,0 @@ -self = false - -globals = { - "screen", - "mouse", - "root", - "client" -} - -read_globals = { - "awesome", - "button", - "dbus", - "drawable", - "drawin", - "key", - "keygrabber", - "mousegrabber", - "selection", - "tag", - "window", - "table.unpack", - "math.atan2", -} \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/calendar-widget/README.md b/awesome/awesome-wm-widgets/calendar-widget/README.md deleted file mode 100644 index b663a18..0000000 --- a/awesome/awesome-wm-widgets/calendar-widget/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# Calendar Widget - -Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.calendar`. - -## Features - - -### Customization - -| Name | Default | Description | -|---|---|---| -| theme | `naughty` | The theme to use | -| placement | `top` | The position of the popup | -| radius | 8 | The popup radius | -| start_sunday | false | Start the week on Sunday | - - - themes: - - | Name | Screenshot | - |---|---| - | nord | ![nord_theme](./nord.png) | - | outrun | ![outrun_theme](./outrun.png) | - | light | ![outrun_theme](./light.png) | - | dark | ![outrun_theme](./dark.png) | - | naughty (default) | from local theme | - - - setup widget placement - - top center - in case you clock is centered: - - ![calendar_top](./calendar_top.png) - - top right - for default awesome config: - - ![calendar_top_right](./calendar_top_right.png) - - bottom right - in case your wibar at the bottom: - - ![calendar_bottom_right](./calendar_bottom_right.png) - - - setup first day of week - - By setting `start_sunday` to true: - ![calendar_start_sunday](./calendar_start_sunday.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! -Just after mytextclock is instantiated, create the widget and add the mouse listener to it. - -```lua -local calendar_widget = require("awesome-wm-widgets.calendar-widget.calendar") --- ... --- Create a textclock widget -mytextclock = wibox.widget.textclock() --- default -local cw = calendar_widget() --- or customized -local cw = calendar_widget({ - theme = 'outrun', - placement = 'bottom_right', - start_sunday = true, - radius = 8, --- with customized next/previous (see table above) - previous_month_button = 1, - next_month_button = 3, -}) -mytextclock:connect_signal("button::press", - function(_, _, _, button) - if button == 1 then cw.toggle() end - end) -``` diff --git a/awesome/awesome-wm-widgets/calendar-widget/calendar.lua b/awesome/awesome-wm-widgets/calendar-widget/calendar.lua deleted file mode 100644 index bc4a877..0000000 --- a/awesome/awesome-wm-widgets/calendar-widget/calendar.lua +++ /dev/null @@ -1,258 +0,0 @@ -------------------------------------------------- --- Calendar Widget for Awesome Window Manager --- Shows the current month and supports scroll up/down to switch month --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/calendar-widget - --- @author Pavel Makhov --- @copyright 2019 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local beautiful = require("beautiful") -local wibox = require("wibox") -local gears = require("gears") -local naughty = require("naughty") - -local calendar_widget = {} - -local function worker(user_args) - - local calendar_themes = { - nord = { - bg = '#2E3440', - fg = '#D8DEE9', - focus_date_bg = '#88C0D0', - focus_date_fg = '#000000', - weekend_day_bg = '#3B4252', - weekday_fg = '#88C0D0', - header_fg = '#E5E9F0', - border = '#4C566A' - }, - outrun = { - bg = '#0d0221', - fg = '#D8DEE9', - focus_date_bg = '#650d89', - focus_date_fg = '#2de6e2', - weekend_day_bg = '#261447', - weekday_fg = '#2de6e2', - header_fg = '#f6019d', - border = '#261447' - }, - dark = { - bg = '#000000', - fg = '#ffffff', - focus_date_bg = '#ffffff', - focus_date_fg = '#000000', - weekend_day_bg = '#444444', - weekday_fg = '#ffffff', - header_fg = '#ffffff', - border = '#333333' - }, - light = { - bg = '#ffffff', - fg = '#000000', - focus_date_bg = '#000000', - focus_date_fg = '#ffffff', - weekend_day_bg = '#AAAAAA', - weekday_fg = '#000000', - header_fg = '#000000', - border = '#CCCCCC' - }, - monokai = { - bg = '#272822', - fg = '#F8F8F2', - focus_date_bg = '#AE81FF', - focus_date_fg = '#ffffff', - weekend_day_bg = '#75715E', - weekday_fg = '#FD971F', - header_fg = '#F92672', - border = '#75715E' - }, - naughty = { - bg = beautiful.notification_bg or beautiful.bg, - fg = beautiful.notification_fg or beautiful.fg, - focus_date_bg = beautiful.notification_fg or beautiful.fg, - focus_date_fg = beautiful.notification_bg or beautiful.bg, - weekend_day_bg = beautiful.bg_focus, - weekday_fg = beautiful.fg, - header_fg = beautiful.fg, - border = beautiful.border_normal - } - - } - - local args = user_args or {} - - if args.theme ~= nil and calendar_themes[args.theme] == nil then - naughty.notify({ - preset = naughty.config.presets.critical, - title = 'Calendar Widget', - text = 'Theme "' .. args.theme .. '" not found, fallback to default'}) - args.theme = 'naughty' - end - - 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 start_sunday = args.start_sunday or false - - local styles = {} - local function rounded_shape(size) - return function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, size) - end - end - - styles.month = { - padding = 4, - bg_color = calendar_themes[theme].bg, - border_width = 0, - } - - styles.normal = { - markup = function(t) return t end, - shape = rounded_shape(4) - } - - styles.focus = { - fg_color = calendar_themes[theme].focus_date_fg, - bg_color = calendar_themes[theme].focus_date_bg, - markup = function(t) return '' .. t .. '' end, - shape = rounded_shape(4) - } - - styles.header = { - fg_color = calendar_themes[theme].header_fg, - bg_color = calendar_themes[theme].bg, - markup = function(t) return '' .. t .. '' end - } - - styles.weekday = { - fg_color = calendar_themes[theme].weekday_fg, - bg_color = calendar_themes[theme].bg, - markup = function(t) return '' .. t .. '' end, - } - - local function decorate_cell(widget, flag, date) - if flag == 'monthheader' and not styles.monthheader then - flag = 'header' - end - - -- highlight only today's day - if flag == 'focus' then - local today = os.date('*t') - if not (today.month == date.month and today.year == date.year) then - flag = 'normal' - end - end - - local props = styles[flag] or {} - if props.markup and widget.get_text and widget.set_markup then - widget:set_markup(props.markup(widget:get_text())) - end - -- Change bg color for weekends - local d = { year = date.year, month = (date.month or 1), day = (date.day or 1) } - local weekday = tonumber(os.date('%w', os.time(d))) - local default_bg = (weekday == 0 or weekday == 6) - and calendar_themes[theme].weekend_day_bg - or calendar_themes[theme].bg - local ret = wibox.widget { - { - { - widget, - halign = 'center', - widget = wibox.container.place - }, - margins = (props.padding or 2) + (props.border_width or 0), - widget = wibox.container.margin - }, - shape = props.shape, - shape_border_color = props.border_color or '#000000', - shape_border_width = props.border_width or 0, - fg = props.fg_color or calendar_themes[theme].fg, - bg = props.bg_color or default_bg, - widget = wibox.container.background - } - - return ret - end - - local cal = wibox.widget { - date = os.date('*t'), - font = beautiful.get_font(), - fn_embed = decorate_cell, - long_weekdays = true, - start_sunday = start_sunday, - widget = wibox.widget.calendar.month - } - - local popup = awful.popup { - ontop = true, - visible = false, - shape = rounded_shape(radius), - offset = { y = 5 }, - border_width = 1, - border_color = calendar_themes[theme].border, - widget = cal - } - - popup:buttons( - awful.util.table.join( - 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({}, previous_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) - ) - ) - - function calendar_widget.toggle() - - if popup.visible then - -- to faster render the calendar refresh it and just hide - cal:set_date(nil) -- the new date is not set without removing the old one - cal:set_date(os.date('*t')) - popup:set_widget(nil) -- just in case - popup:set_widget(cal) - popup.visible = not popup.visible - else - if placement == 'top' then - awful.placement.top(popup, { margins = { top = 30 }, parent = awful.screen.focused() }) - elseif placement == 'top_right' then - awful.placement.top_right(popup, { margins = { top = 30, right = 10}, parent = awful.screen.focused() }) - elseif placement == 'top_left' then - awful.placement.top_left(popup, { margins = { top = 30, left = 10}, parent = awful.screen.focused() }) - elseif placement == 'bottom_right' then - awful.placement.bottom_right(popup, { margins = { bottom = 30, right = 10}, - parent = awful.screen.focused() }) - elseif placement == 'bottom_left' then - awful.placement.bottom_left(popup, { margins = { bottom = 30, left = 10}, - parent = awful.screen.focused() }) - else - awful.placement.top(popup, { margins = { top = 30 }, parent = awful.screen.focused() }) - end - - popup.visible = true - - end - end - - return calendar_widget - -end - -return setmetatable(calendar_widget, { __call = function(_, ...) - return worker(...) -end }) diff --git a/awesome/awesome-wm-widgets/calendar-widget/calendar_bottom_right.png b/awesome/awesome-wm-widgets/calendar-widget/calendar_bottom_right.png deleted file mode 100644 index 2bc2e82..0000000 Binary files a/awesome/awesome-wm-widgets/calendar-widget/calendar_bottom_right.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/calendar-widget/calendar_start_sunday.png b/awesome/awesome-wm-widgets/calendar-widget/calendar_start_sunday.png deleted file mode 100644 index 126a218..0000000 Binary files a/awesome/awesome-wm-widgets/calendar-widget/calendar_start_sunday.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/calendar-widget/calendar_top.png b/awesome/awesome-wm-widgets/calendar-widget/calendar_top.png deleted file mode 100644 index 3e6b66b..0000000 Binary files a/awesome/awesome-wm-widgets/calendar-widget/calendar_top.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/calendar-widget/calendar_top_right.png b/awesome/awesome-wm-widgets/calendar-widget/calendar_top_right.png deleted file mode 100644 index 4a29022..0000000 Binary files a/awesome/awesome-wm-widgets/calendar-widget/calendar_top_right.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/calendar-widget/dark.png b/awesome/awesome-wm-widgets/calendar-widget/dark.png deleted file mode 100644 index 540289f..0000000 Binary files a/awesome/awesome-wm-widgets/calendar-widget/dark.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/calendar-widget/light.png b/awesome/awesome-wm-widgets/calendar-widget/light.png deleted file mode 100644 index ab675d1..0000000 Binary files a/awesome/awesome-wm-widgets/calendar-widget/light.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/calendar-widget/nord.png b/awesome/awesome-wm-widgets/calendar-widget/nord.png deleted file mode 100644 index 94f9f7e..0000000 Binary files a/awesome/awesome-wm-widgets/calendar-widget/nord.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/calendar-widget/outrun.png b/awesome/awesome-wm-widgets/calendar-widget/outrun.png deleted file mode 100644 index d59c123..0000000 Binary files a/awesome/awesome-wm-widgets/calendar-widget/outrun.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/cpu-widget/README.md b/awesome/awesome-wm-widgets/cpu-widget/README.md deleted file mode 100644 index b323f9b..0000000 --- a/awesome/awesome-wm-widgets/cpu-widget/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# CPU widget - -[![GitHub issues by-label](https://img.shields.io/github/issues-raw/streetturtle/awesome-wm-widgets/cpu)](https://github.com/streetturtle/awesome-wm-widgets/labels/cpu) - -This widget shows the average CPU load among all cores of the machine: - -![screenshot](./cpu.gif) - -## How it works - -To measure the load I took Paul Colby's bash [script](http://colby.id.au/calculating-cpu-usage-from-proc-stat/) and rewrote it in Lua, which was quite simple. -So awesome simply reads the first line of /proc/stat: - -```bash -$ cat /proc/stat | grep '^cpu ' -cpu 197294 718 50102 2002182 3844 0 2724 0 0 0 -``` - -and calculates the percentage. - -## Customization - -It is possible to customize widget by providing a table with all or some of the following config parameters: - -| Name | Default | Description | -|---|---|---| -| `width` | 50 | Width of the widget | -| `step_width` | 2 | Width of the step | -| `step_spacing` | 1 | Space size between steps | -| `color` | `beautiful.fg_normal` | Color of the graph | -| `enable_kill_button` | `false` | Show button which kills the process | -| `process_info_max_length` | `-1` | Truncate the process information. Some processes may have a very long list of parameters which won't fit in the screen, this options allows to truncate it to the given length. | -| `timeout` | 1 | How often in seconds the widget refreshes | - -### Example - -```lua -cpu_widget({ - width = 70, - step_width = 2, - step_spacing = 0, - color = '#434c5e' -}) -``` - -The config above results in the following widget: - -![custom](./custom.png) - -## Installation - -Clone/download repo and use widget in **rc.lua**: - -```lua -local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget") -... -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - -- default - cpu_widget(), - -- or custom - cpu_widget({ - width = 70, - step_width = 2, - step_spacing = 0, - color = '#434c5e' - }) - ... -``` diff --git a/awesome/awesome-wm-widgets/cpu-widget/cpu-widget.lua b/awesome/awesome-wm-widgets/cpu-widget/cpu-widget.lua deleted file mode 100644 index 11debe8..0000000 --- a/awesome/awesome-wm-widgets/cpu-widget/cpu-widget.lua +++ /dev/null @@ -1,339 +0,0 @@ -------------------------------------------------- --- CPU Widget for Awesome Window Manager --- Shows the current CPU utilization --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/cpu-widget - --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local watch = require("awful.widget.watch") -local wibox = require("wibox") -local beautiful = require("beautiful") -local gears = require("gears") - -local CMD = [[sh -c "grep '^cpu.' /proc/stat; ps -eo '%p|%c|%C|' -o "%mem" -o '|%a' --sort=-%cpu ]] - .. [[| head -11 | tail -n +2"]] - --- A smaller command, less resource intensive, used when popup is not shown. -local CMD_slim = [[grep --max-count=1 '^cpu.' /proc/stat]] - -local HOME_DIR = os.getenv("HOME") -local WIDGET_DIR = HOME_DIR .. '/.config/awesome/awesome-wm-widgets/cpu-widget' - -local cpu_widget = {} -local cpu_rows = { - spacing = 4, - layout = wibox.layout.fixed.vertical, -} -local is_update = true -local process_rows = { - layout = wibox.layout.fixed.vertical, -} - --- Splits the string by separator --- @return table with separated substrings -local function split(string_to_split, separator) - if separator == nil then separator = "%s" end - local t = {} - - for str in string.gmatch(string_to_split, "([^".. separator .."]+)") do - table.insert(t, str) - end - - return t -end - --- Checks if a string starts with a another string -local function starts_with(str, start) - return str:sub(1, #start) == start -end - - -local function create_textbox(args) - return wibox.widget{ - text = args.text, - align = args.align or 'left', - markup = args.markup, - forced_width = args.forced_width or 40, - widget = wibox.widget.textbox - } -end - -local function create_process_header(params) - local res = wibox.widget{ - create_textbox{markup = 'PID'}, - create_textbox{markup = 'Name'}, - { - create_textbox{markup = '%CPU'}, - create_textbox{markup = '%MEM'}, - params.with_action_column and create_textbox{forced_width = 20} or nil, - layout = wibox.layout.align.horizontal - }, - layout = wibox.layout.ratio.horizontal - } - res:ajust_ratio(2, 0.2, 0.47, 0.33) - - return res -end - -local function create_kill_process_button() - return wibox.widget{ - { - id = "icon", - image = WIDGET_DIR .. '/window-close-symbolic.svg', - resize = false, - opacity = 0.1, - widget = wibox.widget.imagebox - }, - widget = wibox.container.background - } -end - -local function worker(user_args) - - local args = user_args or {} - - local width = args.width or 50 - local step_width = args.step_width or 2 - local step_spacing = args.step_spacing or 1 - local color = args.color or beautiful.fg_normal - local background_color = args.background_color or "#00000000" - local enable_kill_button = args.enable_kill_button or false - local process_info_max_length = args.process_info_max_length or -1 - local timeout = args.timeout or 1 - - local cpugraph_widget = wibox.widget { - max_value = 100, - background_color = background_color, - forced_width = width, - step_width = step_width, - step_spacing = step_spacing, - widget = wibox.widget.graph, - color = "linear:0,0:0,20:0,#FF0000:0.3,#FFFF00:0.6," .. color - } - - -- This timer periodically executes the heavy command while the popup is open. - -- It is stopped when the popup is closed and only the slim command is run then. - -- This greatly improves performance while the popup is closed at the small cost - -- of a slightly longer popup opening time. - local popup_timer = gears.timer { - timeout = timeout - } - - local popup = awful.popup{ - ontop = true, - visible = false, - shape = gears.shape.rounded_rect, - border_width = 1, - border_color = beautiful.bg_normal, - maximum_width = 300, - offset = { y = 5 }, - widget = {} - } - - -- Do not update process rows when mouse cursor is over the widget - popup:connect_signal("mouse::enter", function() is_update = false end) - popup:connect_signal("mouse::leave", function() is_update = true end) - - cpugraph_widget:buttons( - awful.util.table.join( - awful.button({}, 1, function() - if popup.visible then - popup.visible = not popup.visible - -- When the popup is not visible, stop the timer - popup_timer:stop() - else - popup:move_next_to(mouse.current_widget_geometry) - -- Restart the timer, when the popup becomes visible - -- Emit the signal to start the timer directly and not wait the timeout first - popup_timer:start() - popup_timer:emit_signal("timeout") - end - end) - ) - ) - - --- By default graph widget goes from left to right, so we mirror it and push up a bit - cpu_widget = wibox.widget { - { - cpugraph_widget, - reflection = {horizontal = true}, - layout = wibox.container.mirror - }, - bottom = 2, - color = background_color, - widget = wibox.container.margin - } - - -- This part runs constantly, also when the popup is closed. - -- It updates the graph widget in the bar. - local maincpu = {} - watch(CMD_slim, timeout, function(widget, stdout) - - local _, user, nice, system, idle, iowait, irq, softirq, steal, _, _ = - stdout:match('(%w+)%s+(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)') - - local total = user + nice + system + idle + iowait + irq + softirq + steal - - local diff_idle = idle - tonumber(maincpu['idle_prev'] == nil and 0 or maincpu['idle_prev']) - local diff_total = total - tonumber(maincpu['total_prev'] == nil and 0 or maincpu['total_prev']) - local diff_usage = (1000 * (diff_total - diff_idle) / diff_total + 5) / 10 - - maincpu['total_prev'] = total - maincpu['idle_prev'] = idle - - widget:add_value(diff_usage) - end, - cpugraph_widget - ) - - -- This part runs whenever the timer is fired. - -- It therefore only runs when the popup is open. - local cpus = {} - popup_timer:connect_signal('timeout', function() - awful.spawn.easy_async(CMD, function(stdout, _, _, _) - local i = 1 - local j = 1 - for line in stdout:gmatch("[^\r\n]+") do - if starts_with(line, 'cpu') then - - if cpus[i] == nil then cpus[i] = {} end - - local name, user, nice, system, idle, iowait, irq, softirq, steal, _, _ = - line:match('(%w+)%s+(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)') - - local total = user + nice + system + idle + iowait + irq + softirq + steal - - local diff_idle = idle - tonumber(cpus[i]['idle_prev'] == nil and 0 or cpus[i]['idle_prev']) - local diff_total = total - tonumber(cpus[i]['total_prev'] == nil and 0 or cpus[i]['total_prev']) - local diff_usage = (1000 * (diff_total - diff_idle) / diff_total + 5) / 10 - - cpus[i]['total_prev'] = total - cpus[i]['idle_prev'] = idle - - local row = wibox.widget - { - create_textbox{text = name}, - create_textbox{text = math.floor(diff_usage) .. '%'}, - { - max_value = 100, - value = diff_usage, - forced_height = 20, - forced_width = 150, - paddings = 1, - margins = 4, - border_width = 1, - border_color = beautiful.bg_focus, - background_color = beautiful.bg_normal, - bar_border_width = 1, - bar_border_color = beautiful.bg_focus, - color = "linear:150,0:0,0:0,#D08770:0.3,#BF616A:0.6," .. beautiful.fg_normal, - widget = wibox.widget.progressbar, - - }, - layout = wibox.layout.ratio.horizontal - } - row:ajust_ratio(2, 0.15, 0.15, 0.7) - cpu_rows[i] = row - i = i + 1 - else - if is_update == true then - - local columns = split(line, '|') - - local pid = columns[1] - local comm = columns[2] - local cpu = columns[3] - local mem = columns[4] - local cmd = columns[5] - - local kill_proccess_button = enable_kill_button and create_kill_process_button() or nil - - local pid_name_rest = wibox.widget{ - create_textbox{text = pid}, - create_textbox{text = comm}, - { - create_textbox{text = cpu, align = 'center'}, - create_textbox{text = mem, align = 'center'}, - kill_proccess_button, - layout = wibox.layout.fixed.horizontal - }, - layout = wibox.layout.ratio.horizontal - } - pid_name_rest:ajust_ratio(2, 0.2, 0.47, 0.33) - - local row = wibox.widget { - { - pid_name_rest, - top = 4, - bottom = 4, - widget = wibox.container.margin - }, - widget = wibox.container.background - } - - row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) - row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) - - if enable_kill_button then - row:connect_signal("mouse::enter", function() kill_proccess_button.icon.opacity = 1 end) - row:connect_signal("mouse::leave", function() kill_proccess_button.icon.opacity = 0.1 end) - - kill_proccess_button:buttons( - awful.util.table.join( awful.button({}, 1, function() - row:set_bg('#ff0000') - awful.spawn.with_shell('kill -9 ' .. pid) - end) ) ) - end - - awful.tooltip { - objects = { row }, - mode = 'outside', - preferred_positions = {'bottom'}, - timer_function = function() - local text = cmd - if process_info_max_length > 0 and text:len() > process_info_max_length then - text = text:sub(0, process_info_max_length - 3) .. '...' - end - - return text - :gsub('%s%-', '\n\t-') -- put arguments on a new line - :gsub(':/', '\n\t\t:/') -- java classpath uses : to separate jars - end, - } - - process_rows[j] = row - - j = j + 1 - end - - end - end - popup:setup { - { - cpu_rows, - { - orientation = 'horizontal', - forced_height = 15, - color = beautiful.bg_focus, - widget = wibox.widget.separator - }, - create_process_header{with_action_column = enable_kill_button}, - process_rows, - layout = wibox.layout.fixed.vertical, - }, - margins = 8, - widget = wibox.container.margin - } - end) - end) - - return cpu_widget -end - -return setmetatable(cpu_widget, { __call = function(_, ...) - return worker(...) -end }) diff --git a/awesome/awesome-wm-widgets/cpu-widget/cpu.gif b/awesome/awesome-wm-widgets/cpu-widget/cpu.gif deleted file mode 100644 index cb97262..0000000 Binary files a/awesome/awesome-wm-widgets/cpu-widget/cpu.gif and /dev/null differ diff --git a/awesome/awesome-wm-widgets/cpu-widget/cpu.png b/awesome/awesome-wm-widgets/cpu-widget/cpu.png deleted file mode 100644 index 96ba29f..0000000 Binary files a/awesome/awesome-wm-widgets/cpu-widget/cpu.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/cpu-widget/custom.png b/awesome/awesome-wm-widgets/cpu-widget/custom.png deleted file mode 100644 index be275e4..0000000 Binary files a/awesome/awesome-wm-widgets/cpu-widget/custom.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/cpu-widget/window-close-symbolic.svg b/awesome/awesome-wm-widgets/cpu-widget/window-close-symbolic.svg deleted file mode 100644 index 46ff888..0000000 --- a/awesome/awesome-wm-widgets/cpu-widget/window-close-symbolic.svg +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - Gnome Symbolic Icon Theme - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - - - diff --git a/awesome/awesome-wm-widgets/email-widget/README.md b/awesome/awesome-wm-widgets/email-widget/README.md deleted file mode 100644 index 510792d..0000000 --- a/awesome/awesome-wm-widgets/email-widget/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Email widget - -This widget consists of an icon with counter which shows number of unread emails: ![email icon](./em-wid-1.png) -and a popup message which appears when mouse hovers over an icon: ![email popup](./em-wid-2.png) - -Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder. - -## Installation - -To install it put **email.lua** and **email-widget** folder under **~/.config/awesome**. Then - - - in **email.lua** change path to python scripts; - - in python scripts add your credentials (note that password should be encrypted using pgp for example); - - add widget to awesome: - -```lua -local email_widget, email_icon = require("email") - -... -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - email_icon, - email_widget, - ... -``` - -## How it works - -This widget uses the output of two python scripts, first is called every 20 seconds - it returns number of unread emails and second is called when mouse hovers over an icon and displays content of those emails. For both of them you'll need to provide your credentials and imap server. For testing, they can simply be called from console: - -``` bash -python ~/.config/awesome/email/count_unread_emails.py -python ~/.config/awesome/email/read_emails.py -``` diff --git a/awesome/awesome-wm-widgets/email-widget/count_unread_emails.py b/awesome/awesome-wm-widgets/email-widget/count_unread_emails.py deleted file mode 100644 index a843814..0000000 --- a/awesome/awesome-wm-widgets/email-widget/count_unread_emails.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python - -import imaplib -import re - -M=imaplib.IMAP4_SSL("mail.teenagemutantninjaturtles.com", 993) -M.login("mickey@tmnt.com","cowabunga") - -status, counts = M.status("INBOX","(MESSAGES UNSEEN)") - -if status == "OK": - unread = re.search(r'UNSEEN\s(\d+)', counts[0].decode('utf-8')).group(1) -else: - unread = "N/A" - -print(unread) diff --git a/awesome/awesome-wm-widgets/email-widget/em-wid-1.png b/awesome/awesome-wm-widgets/email-widget/em-wid-1.png deleted file mode 100644 index 5290ea8..0000000 Binary files a/awesome/awesome-wm-widgets/email-widget/em-wid-1.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/email-widget/em-wid-2.png b/awesome/awesome-wm-widgets/email-widget/em-wid-2.png deleted file mode 100644 index 0a0fd3a..0000000 Binary files a/awesome/awesome-wm-widgets/email-widget/em-wid-2.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/email-widget/email.lua b/awesome/awesome-wm-widgets/email-widget/email.lua deleted file mode 100644 index df80678..0000000 --- a/awesome/awesome-wm-widgets/email-widget/email.lua +++ /dev/null @@ -1,44 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local naughty = require("naughty") -local watch = require("awful.widget.watch") - -local path_to_icons = "/usr/share/icons/Arc/actions/22/" - -local email_widget = wibox.widget.textbox() -email_widget:set_font('Play 9') - -local email_icon = wibox.widget.imagebox() -email_icon:set_image(path_to_icons .. "/mail-mark-new.png") - -watch( - "python /home//.config/awesome/email-widget/count_unread_emails.py", 20, - function(_, stdout) - local unread_emails_num = tonumber(stdout) or 0 - if (unread_emails_num > 0) then - email_icon:set_image(path_to_icons .. "/mail-mark-unread.png") - email_widget:set_text(stdout) - elseif (unread_emails_num == 0) then - email_icon:set_image(path_to_icons .. "/mail-message-new.png") - email_widget:set_text("") - end - end -) - - -local function show_emails() - awful.spawn.easy_async([[bash -c 'python /home//.config/awesome/email-widget/read_unread_emails.py']], - function(stdout) - naughty.notify{ - text = stdout, - title = "Unread Emails", - timeout = 5, hover_timeout = 0.5, - width = 400, - } - end - ) -end - -email_icon:connect_signal("mouse::enter", function() show_emails() end) - -return email_widget, email_icon diff --git a/awesome/awesome-wm-widgets/email-widget/read_unread_emails.py b/awesome/awesome-wm-widgets/email-widget/read_unread_emails.py deleted file mode 100644 index fda8188..0000000 --- a/awesome/awesome-wm-widgets/email-widget/read_unread_emails.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python - -import imaplib -import email -import datetime - -def process_mailbox(M): - rv, data = M.search(None, "(UNSEEN)") - if rv != 'OK': - print "No messages found!" - return - - for num in data[0].split(): - rv, data = M.fetch(num, '(BODY.PEEK[])') - if rv != 'OK': - print "ERROR getting message", num - return - msg = email.message_from_bytes(data[0][1]) - for header in [ 'From', 'Subject', 'Date' ]: - hdr = email.header.make_header(email.header.decode_header(msg[header])) - if header == 'Date': - date_tuple = email.utils.parsedate_tz(str(hdr)) - if date_tuple: - local_date = datetime.datetime.fromtimestamp(email.utils.mktime_tz(date_tuple)) - print("{}: {}".format(header, local_date.strftime("%a, %d %b %Y %H:%M:%S"))) - else: - print('{}: {}'.format(header, hdr)) - # with code below you can process text of email - # if msg.is_multipart(): - # for payload in msg.get_payload(): - # if payload.get_content_maintype() == 'text': - # print payload.get_payload() - # else: - # print msg.get_payload() - - -M=imaplib.IMAP4_SSL("mail.teenagemutantninjaturtles.com", 993) -M.login("mickey@tmnt.com","cowabunga") - -rv, data = M.select("INBOX") -if rv == 'OK': - process_mailbox(M) -M.close() -M.logout() diff --git a/awesome/awesome-wm-widgets/fs-widget/README.md b/awesome/awesome-wm-widgets/fs-widget/README.md deleted file mode 100644 index 4657e9e..0000000 --- a/awesome/awesome-wm-widgets/fs-widget/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Filesystem Widget - -This widget shows file system disk space usage which is based on the `df` output. When clicked another widget appears with more detailed information. By default, it monitors the "/" mount. It can be configured with a list of mounts to monitor though only the first will show in the wibar. To have multiple mounts displayed on the wibar simply define multiple `fs_widgets` with different mounts as arguments. - -![](./screenshot.png) - -## Customizations - -It is possible to customize widget by providing a table with all or some of the following config parameters: - -| Name | Default | Description | -|---|---|---| -| `mounts` | `{'/'}` | Table with mounts to monitor, check the output from a `df` command for available options (column 'Mounted on') | -| `timeout` | 60 | How often in seconds the widget refreshes | - -## Installation - -Clone/download repo and use the widget in **rc.lua**: - -```lua - local fs_widget = require("awesome-wm-widgets.fs-widget.fs-widget") - ... - s.mywibox:setup { - s.mytasklist, -- Middle widget - { -- Right widgets - fs_widget(), --default - fs_widget({ mounts = { '/', '/mnt/music' } }), -- multiple mounts - ... -``` diff --git a/awesome/awesome-wm-widgets/fs-widget/fs-widget.lua b/awesome/awesome-wm-widgets/fs-widget/fs-widget.lua deleted file mode 100644 index ca76193..0000000 --- a/awesome/awesome-wm-widgets/fs-widget/fs-widget.lua +++ /dev/null @@ -1,190 +0,0 @@ -local awful = require("awful") -local watch = require("awful.widget.watch") -local wibox = require("wibox") -local beautiful = require("beautiful") -local gears = require("gears") - -local storage_bar_widget = {} - ---- Table with widget configuration, consists of three sections: ---- - general - general configuration ---- - widget - configuration of the widget displayed on the wibar ---- - popup - configuration of the popup -local config = {} - --- general -config.mounts = { '/' } -config.refresh_rate = 60 - --- wibar widget -config.widget_width = 40 -config.widget_bar_color = '#aaaaaa' -config.widget_onclick_bg = '#ff0000' -config.widget_border_color = '#535d6c66' -config.widget_background_color = '#22222233' - --- popup -config.popup_bg = '#22222233' -config.popup_border_width = 1 -config.popup_border_color = '#535d6c66' -config.popup_bar_color = '#aaaaaa' -config.popup_bar_background_color = '#22222233' -config.popup_bar_border_color = '#535d6c66' - -local function worker(user_args) - local args = user_args or {} - - -- Setup config for the widget instance. - -- The `_config` table will keep the first existing value after checking - -- in this order: user parameter > beautiful > module default. - local _config = {} - for prop, value in pairs(config) do - _config[prop] = args[prop] or beautiful[prop] or value - end - - storage_bar_widget = wibox.widget { - { - id = 'progressbar', - color = _config.widget_bar_color, - max_value = 100, - forced_height = 20, - forced_width = _config.widget_width, - paddings = 2, - margins = 4, - border_width = 1, - border_radius = 2, - border_color = _config.widget_border_color, - background_color = _config.widget_background_color, - widget = wibox.widget.progressbar - }, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, 4) - end, - widget = wibox.container.background, - set_value = function(self, new_value) - self:get_children_by_id("progressbar")[1].value = new_value - end - } - - local disk_rows = { - { widget = wibox.widget.textbox }, - spacing = 4, - layout = wibox.layout.fixed.vertical, - } - - local disk_header = wibox.widget { - { - markup = 'Mount', - forced_width = 150, - align = 'left', - widget = wibox.widget.textbox, - }, - { - markup = 'Used', - align = 'left', - widget = wibox.widget.textbox, - }, - layout = wibox.layout.ratio.horizontal - } - disk_header:ajust_ratio(1, 0, 0.3, 0.7) - - local popup = awful.popup { - bg = _config.popup_bg, - ontop = true, - visible = false, - shape = gears.shape.rounded_rect, - border_width = _config.popup_border_width, - border_color = _config.popup_border_color, - maximum_width = 400, - offset = { y = 5 }, - widget = {} - } - - storage_bar_widget:buttons( - awful.util.table.join( - awful.button({}, 1, function() - if popup.visible then - popup.visible = not popup.visible - storage_bar_widget:set_bg('#00000000') - else - storage_bar_widget:set_bg(_config.widget_background_color) - popup:move_next_to(mouse.current_widget_geometry) - end - end) - ) - ) - - local disks = {} - watch([[bash -c "df | tail -n +2"]], _config.refresh_rate, - function(widget, stdout) - for line in stdout:gmatch("[^\r\n$]+") do - local filesystem, size, used, avail, perc, mount = - line:match('([%p%w]+)%s+([%d%w]+)%s+([%d%w]+)%s+([%d%w]+)%s+([%d]+)%%%s+([%p%w]+)') - - disks[mount] = {} - disks[mount].filesystem = filesystem - disks[mount].size = size - disks[mount].used = used - disks[mount].avail = avail - disks[mount].perc = perc - disks[mount].mount = mount - - if disks[mount].mount == _config.mounts[1] then - widget:set_value(tonumber(disks[mount].perc)) - end - end - - for k, v in ipairs(_config.mounts) do - - local row = wibox.widget { - { - text = disks[v].mount, - forced_width = 150, - widget = wibox.widget.textbox - }, - { - color = _config.popup_bar_color, - max_value = 100, - value = tonumber(disks[v].perc), - forced_height = 20, - paddings = 1, - margins = 4, - border_width = 1, - border_color = _config.popup_bar_border_color, - background_color = _config.popup_bar_background_color, - bar_border_width = 1, - bar_border_color = _config.popup_bar_border_color, - widget = wibox.widget.progressbar, - }, - { - text = math.floor(disks[v].used / 1024 / 1024) - .. '/' - .. math.floor(disks[v].size / 1024 / 1024) .. 'GB(' - .. math.floor(disks[v].perc) .. '%)', - widget = wibox.widget.textbox - }, - layout = wibox.layout.ratio.horizontal - } - row:ajust_ratio(2, 0.3, 0.3, 0.4) - - disk_rows[k] = row - end - popup:setup { - { - disk_header, - disk_rows, - layout = wibox.layout.fixed.vertical, - }, - margins = 8, - widget = wibox.container.margin - } - end, - storage_bar_widget - ) - - return storage_bar_widget -end - -return setmetatable(storage_bar_widget, { __call = function(_, ...) - return worker(...) -end }) diff --git a/awesome/awesome-wm-widgets/fs-widget/screenshot.png b/awesome/awesome-wm-widgets/fs-widget/screenshot.png deleted file mode 100644 index 41e6ccc..0000000 Binary files a/awesome/awesome-wm-widgets/fs-widget/screenshot.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/README.md b/awesome/awesome-wm-widgets/logout-menu-widget/README.md deleted file mode 100644 index 6f8ca27..0000000 --- a/awesome/awesome-wm-widgets/logout-menu-widget/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Logout Menu Widget - -This widget shows a menu with options to log out from the current session, lock, reboot, suspend and power off the computer, similar to [logout-popup-widget](https://github.com/streetturtle/awesome-wm-widgets/tree/master/logout-popup-widget): - -![demo](./logout-menu.gif) - -## Installation - -Clone this repo (if not cloned yet) under **./.config/awesome/** - -```bash -cd ./.config/awesome/ -git clone https://github.com/streetturtle/awesome-wm-widgets -``` -Then add the widget to the wibar: - -```lua -local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu") - -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - -- default - logout_menu_widget(), - -- custom - logout_menu_widget{ - font = 'Play 14', - onlock = function() awful.spawn.with_shell('i3lock-fancy') end - } - ... -``` - -## Customization - -It is possible to customize the widget by providing a table with all or some of the following config parameters: - -| Name | Default | Description | -|---|---|---| -| `font` | `beautiful.font` | Font of the menu items | -| `onlogout` | `function() awesome.quit() end` | Function which is called when the logout item is clicked | -| `onlock` | `function() awful.spawn.with_shell("i3lock") end` | Function which is called when the lock item is clicked | -| `onreboot` | `function() awful.spawn.with_shell("reboot") end` | Function which is called when the reboot item is clicked | -| `onsuspend` | `function() awful.spawn.with_shell("systemctl suspend") end` | Function which is called when the suspend item is clicked | -| `onpoweroff` | `function() awful.spawn.with_shell("shutdown now") end` | Function which is called when the poweroff item is clicked | diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/icons/lock.svg b/awesome/awesome-wm-widgets/logout-menu-widget/icons/lock.svg deleted file mode 100644 index 3cfa528..0000000 --- a/awesome/awesome-wm-widgets/logout-menu-widget/icons/lock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/icons/log-out.svg b/awesome/awesome-wm-widgets/logout-menu-widget/icons/log-out.svg deleted file mode 100644 index 77afebb..0000000 --- a/awesome/awesome-wm-widgets/logout-menu-widget/icons/log-out.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/icons/moon.svg b/awesome/awesome-wm-widgets/logout-menu-widget/icons/moon.svg deleted file mode 100644 index 60e6ce8..0000000 --- a/awesome/awesome-wm-widgets/logout-menu-widget/icons/moon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/icons/power.svg b/awesome/awesome-wm-widgets/logout-menu-widget/icons/power.svg deleted file mode 100644 index 68b1be8..0000000 --- a/awesome/awesome-wm-widgets/logout-menu-widget/icons/power.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/icons/power_w.svg b/awesome/awesome-wm-widgets/logout-menu-widget/icons/power_w.svg deleted file mode 100644 index 1f9c4e3..0000000 --- a/awesome/awesome-wm-widgets/logout-menu-widget/icons/power_w.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/icons/refresh-cw.svg b/awesome/awesome-wm-widgets/logout-menu-widget/icons/refresh-cw.svg deleted file mode 100644 index 39f52a5..0000000 --- a/awesome/awesome-wm-widgets/logout-menu-widget/icons/refresh-cw.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.gif b/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.gif deleted file mode 100644 index 9f17b51..0000000 Binary files a/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.gif and /dev/null differ diff --git a/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua b/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua deleted file mode 100644 index 9a634f1..0000000 --- a/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua +++ /dev/null @@ -1,136 +0,0 @@ -------------------------------------------------- --- Logout Menu Widget for Awesome Window Manager --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/logout-menu-widget - --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local wibox = require("wibox") -local gears = require("gears") -local beautiful = require("beautiful") - -local HOME = os.getenv('HOME') -local ICON_DIR = HOME .. '/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/' - -local logout_menu_widget = wibox.widget { - { - { - image = ICON_DIR .. 'power_w.svg', - resize = true, - widget = wibox.widget.imagebox, - }, - margins = 4, - layout = wibox.container.margin - }, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, 4) - end, - widget = wibox.container.background, -} - -local popup = awful.popup { - ontop = true, - visible = false, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, 4) - end, - border_width = 1, - border_color = beautiful.bg_focus, - maximum_width = 400, - offset = { y = 5 }, - widget = {} -} - -local function worker(user_args) - local rows = { layout = wibox.layout.fixed.vertical } - - local args = user_args or {} - - local font = args.font or beautiful.font - - local onlogout = args.onlogout or function () awesome.quit() end - local onlock = args.onlock or function() awful.spawn.with_shell("i3lock") end - local onreboot = args.onreboot or function() awful.spawn.with_shell("reboot") end - local onsuspend = args.onsuspend or function() awful.spawn.with_shell("systemctl suspend") end - local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("shutdown now") end - - local menu_items = { - { name = 'Log out', icon_name = 'log-out.svg', command = onlogout }, - { name = 'Lock', icon_name = 'lock.svg', command = onlock }, - { name = 'Reboot', icon_name = 'refresh-cw.svg', command = onreboot }, - { name = 'Suspend', icon_name = 'moon.svg', command = onsuspend }, - { name = 'Power off', icon_name = 'power.svg', command = onpoweroff }, - } - - for _, item in ipairs(menu_items) do - - local row = wibox.widget { - { - { - { - image = ICON_DIR .. item.icon_name, - resize = false, - widget = wibox.widget.imagebox - }, - { - text = item.name, - font = font, - widget = wibox.widget.textbox - }, - spacing = 12, - layout = wibox.layout.fixed.horizontal - }, - margins = 8, - layout = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } - - row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) - row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) - - local old_cursor, old_wibox - row:connect_signal("mouse::enter", function() - local wb = mouse.current_wibox - old_cursor, old_wibox = wb.cursor, wb - wb.cursor = "hand1" - end) - row:connect_signal("mouse::leave", function() - if old_wibox then - old_wibox.cursor = old_cursor - old_wibox = nil - end - end) - - row:buttons(awful.util.table.join(awful.button({}, 1, function() - popup.visible = not popup.visible - item.command() - end))) - - table.insert(rows, row) - end - popup:setup(rows) - - logout_menu_widget:buttons( - awful.util.table.join( - awful.button({}, 1, function() - if popup.visible then - popup.visible = not popup.visible - logout_menu_widget:set_bg('#00000000') - else - popup:move_next_to(mouse.current_widget_geometry) - logout_menu_widget:set_bg(beautiful.bg_focus) - end - end) - ) - ) - - return logout_menu_widget - -end - -return worker diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/README.md b/awesome/awesome-wm-widgets/logout-popup-widget/README.md deleted file mode 100644 index d95b692..0000000 --- a/awesome/awesome-wm-widgets/logout-popup-widget/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# Logout Popup Widget - -Widget which allows performing lock, reboot, log out, power off and sleep actions. It can be called either by a shortcut, or by clicking on a widget in wibar. - -

- screenshot -

- -When the widget is shown, following shortcuts can be used: - - Escape - hide widget - - s - shutdown - - r - reboot - - u - suspend - - k - lock - - l - log out - -# Installation - -Clone this (if not cloned yet) and the [awesome-buttons](https://github.com/streetturtle/awesome-buttons) repos under **./.config/awesome/** - -```bash -cd ./.config/awesome/ -git clone https://github.com/streetturtle/awesome-wm-widgets -git clone https://github.com/streetturtle/awesome-buttons -``` -Then - -- to show by a shortcut - define a shortcut in `globalkeys`: - - ```lua - local logout_popup = require("awesome-wm-widgets.logout-popup-widget.logout-popup") - ... - globalkeys = gears.table.join( - ... - awful.key({ modkey }, "l", function() logout_popup.launch() end, {description = "Show logout screen", group = "custom"}), - ``` - -- to show by clicking on a widget in wibar - add widget to the wibar: - - ```lua - local logout_popup = require("awesome-wm-widgets.logout-popup-widget.logout-popup") - - s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - logout_popup.widget{}, - ... - ``` - -# Customisation - -| Name | Default | Description | -|---|---|---| -| `icon` | `power.svg` | If used as widget - the path to the widget's icon | -| `icon_size` | `40` | Size of the icon | -| `icon_margin` | `16` | Margin around the icon | -| `bg_color` | `beautiful.bg_normal` | The color the background of the | -| `accent_color` | `beautiful.bg_focus` | The color of the buttons | -| `text_color` | `beautiful.fg_normal` | The color of text | -| `label_color` | `beautiful.fg_normal` | The color of the button's label | -| `phrases` | `{'Goodbye!'}` | The table with phrase(s) to show, if more than one provided, the phrase is chosen randomly. Leave empty (`{}`) to hide the phrase | -| `onlogout` | `function() awesome.quit() end` | Function which is called when the logout button is pressed | -| `onlock` | `function() awful.spawn.with_shell("systemctl suspend") end` | Function which is called when the lock button is pressed | -| `onreboot` | `function() awful.spawn.with_shell("reboot") end` | Function which is called when the reboot button is pressed | -| `onsuspend` | `function() awful.spawn.with_shell("systemctl suspend") end` | Function which is called when the suspend button is pressed | -| `onpoweroff` | `function() awful.spawn.with_shell("shutdown now") end` | Function which is called when the poweroff button is pressed | - -Some color themes for inspiration: - -![nord](./logout-nord.png) -![outrun](./logout-outrun.png) -![dark](./logout-dark.png) -![dracula](./logout-dracula.png) - -```lua -logout.launch{ - bg_color = "#261447", accent_color = "#ff4365", text_color = '#f706cf', icon_size = 40, icon_margin = 16, -- outrun - -- bg_color = "#0b0c10", accent_color = "#1f2833", text_color = '#66fce1', -- dark - -- bg_color = "#3B4252", accent_color = "#88C0D0", text_color = '#D8DEE9', -- nord - -- bg_color = "#282a36", accent_color = "#ff79c6", phrases = {}, -- dracula, no phrase - phrases = {"exit(0)", "Don't forget to be awesome.", "Yippee ki yay!"}, -} -``` diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/logout-dark.png b/awesome/awesome-wm-widgets/logout-popup-widget/logout-dark.png deleted file mode 100644 index 06e7c9c..0000000 Binary files a/awesome/awesome-wm-widgets/logout-popup-widget/logout-dark.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/logout-dracula.png b/awesome/awesome-wm-widgets/logout-popup-widget/logout-dracula.png deleted file mode 100644 index 3c61c46..0000000 Binary files a/awesome/awesome-wm-widgets/logout-popup-widget/logout-dracula.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/logout-nord.png b/awesome/awesome-wm-widgets/logout-popup-widget/logout-nord.png deleted file mode 100644 index 9ab4b55..0000000 Binary files a/awesome/awesome-wm-widgets/logout-popup-widget/logout-nord.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/logout-outrun.png b/awesome/awesome-wm-widgets/logout-popup-widget/logout-outrun.png deleted file mode 100644 index 9be68b5..0000000 Binary files a/awesome/awesome-wm-widgets/logout-popup-widget/logout-outrun.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/logout-popup.lua b/awesome/awesome-wm-widgets/logout-popup-widget/logout-popup.lua deleted file mode 100644 index efe6882..0000000 --- a/awesome/awesome-wm-widgets/logout-popup-widget/logout-popup.lua +++ /dev/null @@ -1,187 +0,0 @@ -------------------------------------------------- --- Logout widget for Awesome Window Manager --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/logout-widget - --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local capi = {keygrabber = keygrabber } -local wibox = require("wibox") -local gears = require("gears") -local beautiful = require("beautiful") -local awesomebuttons = require("awesome-buttons.awesome-buttons") - - -local HOME_DIR = os.getenv("HOME") -local WIDGET_DIR = HOME_DIR .. '/.config/awesome/awesome-wm-widgets/logout-popup-widget' - - -local w = wibox { - bg = beautiful.fg_normal, - max_widget_size = 500, - ontop = true, - height = 200, - width = 400, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, 8) - end -} - -local action = wibox.widget { - text = ' ', - widget = wibox.widget.textbox -} - -local phrase_widget = wibox.widget{ - align = 'center', - widget = wibox.widget.textbox -} - -local function create_button(icon_name, action_name, accent_color, label_color, onclick, icon_size, icon_margin) - - local button = awesomebuttons.with_icon { - type = 'basic', - icon = icon_name, - color = accent_color, - icon_size = icon_size, - icon_margin = icon_margin, - onclick = function() - onclick() - w.visible = false - capi.keygrabber.stop() - end - } - button:connect_signal("mouse::enter", function() - action:set_markup('' .. action_name .. '') - end) - - button:connect_signal("mouse::leave", function() action:set_markup(' ') end) - - return button -end - -local function launch(args) - args = args or {} - - local bg_color = args.bg_color or beautiful.bg_normal - local accent_color = args.accent_color or beautiful.bg_focus - local text_color = args.text_color or beautiful.fg_normal - local label_color = args.label_color or beautiful.fg_focus - local phrases = args.phrases or {'Goodbye!'} - local icon_size = args.icon_size or 40 - local icon_margin = args.icon_margin or 16 - - local onlogout = args.onlogout or function () awesome.quit() end - local onlock = args.onlock or function() awful.spawn.with_shell("i3lock") end - local onreboot = args.onreboot or function() awful.spawn.with_shell("reboot") end - local onsuspend = args.onsuspend or function() awful.spawn.with_shell("systemctl suspend") end - local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("shutdown now") end - - w:set_bg(bg_color) - if #phrases > 0 then - phrase_widget:set_markup( - '' .. phrases[ math.random( #phrases ) ] .. '') - end - - w:setup { - { - phrase_widget, - { - { - create_button('log-out', 'Log Out (l)', - accent_color, label_color, onlogout, icon_size, icon_margin), - create_button('lock', 'Lock (k)', - accent_color, label_color, onlock, icon_size, icon_margin), - create_button('refresh-cw', 'Reboot (r)', - accent_color, label_color, onreboot, icon_size, icon_margin), - create_button('moon', 'Suspend (u)', - accent_color, label_color, onsuspend, icon_size, icon_margin), - create_button('power', 'Power Off (s)', - accent_color, label_color, onpoweroff, icon_size, icon_margin), - id = 'buttons', - spacing = 8, - layout = wibox.layout.fixed.horizontal - }, - valign = 'center', - layout = wibox.container.place - }, - { - action, - haligh = 'center', - layout = wibox.container.place - }, - spacing = 32, - layout = wibox.layout.fixed.vertical - }, - id = 'a', - shape_border_width = 1, - valign = 'center', - layout = wibox.container.place - } - - w.screen = mouse.screen - w.visible = true - - awful.placement.centered(w) - capi.keygrabber.run(function(_, key, event) - if event == "release" then return end - if key then - if key == 'Escape' then - phrase_widget:set_text('') - capi.keygrabber.stop() - w.visible = false - elseif key == 's' then onpoweroff() - elseif key == 'r' then onreboot() - elseif key == 'u' then onsuspend() - elseif key == 'k' then onlock() - elseif key == 'l' then onlogout() - end - - if key == 'Escape' or string.match("srukl", key) then - phrase_widget:set_text('') - capi.keygrabber.stop() - w.visible = false - end - end - end) -end - -local function widget(args) - local icon = args.icon or WIDGET_DIR .. '/power.svg' - - local res = wibox.widget { - { - { - image = icon, - widget = wibox.widget.imagebox - }, - margins = 4, - layout = wibox.container.margin - }, - layout = wibox.layout.fixed.horizontal, - } - - res:buttons( - awful.util.table.join( - awful.button({}, 1, function() - if w.visible then - phrase_widget:set_text('') - capi.keygrabber.stop() - w.visible = false - else - launch(args) - end - end) - )) - - return res - -end - -return { - launch = launch, - widget = widget -} diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/power.svg b/awesome/awesome-wm-widgets/logout-popup-widget/power.svg deleted file mode 100644 index 1f9c4e3..0000000 --- a/awesome/awesome-wm-widgets/logout-popup-widget/power.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/screenshot.gif b/awesome/awesome-wm-widgets/logout-popup-widget/screenshot.gif deleted file mode 100644 index 4975c19..0000000 Binary files a/awesome/awesome-wm-widgets/logout-popup-widget/screenshot.gif and /dev/null differ diff --git a/awesome/awesome-wm-widgets/logout-popup-widget/screenshot.png b/awesome/awesome-wm-widgets/logout-popup-widget/screenshot.png deleted file mode 100644 index 74ed7f0..0000000 Binary files a/awesome/awesome-wm-widgets/logout-popup-widget/screenshot.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/mpris-widget/README.md b/awesome/awesome-wm-widgets/mpris-widget/README.md deleted file mode 100644 index 7efad78..0000000 --- a/awesome/awesome-wm-widgets/mpris-widget/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# MPRIS Widget (In progress) - -Music Player Info widget cy @mgabs - -# Prerequisite - -Install `playerctl` (mpris implementation), should be available in repo, e.g for Ubuntu: - -```bash -sudo apt-get install playerctl -``` - -## Installation - -To use this widget clone repo under **~/.config/awesome/** and then add it in **rc.lua**: - -```lua -local mpris_widget = require("awesome-wm-widgets.mpris-widget") -... -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - mpris_widget(), - ... -``` diff --git a/awesome/awesome-wm-widgets/mpris-widget/init.lua b/awesome/awesome-wm-widgets/mpris-widget/init.lua deleted file mode 100644 index 5e45ffa..0000000 --- a/awesome/awesome-wm-widgets/mpris-widget/init.lua +++ /dev/null @@ -1,187 +0,0 @@ -------------------------------------------------- --- mpris based Arc Widget for Awesome Window Manager --- Modelled after Pavel Makhov's work --- @author Mohammed Gaber --- requires - playerctl --- @copyright 2020 -------------------------------------------------- -local awful = require("awful") -local beautiful = require("beautiful") -local watch = require("awful.widget.watch") -local wibox = require("wibox") -local gears = require("gears") - -local GET_MPD_CMD = "playerctl -p %s -f '{{status}};{{xesam:artist}};{{xesam:title}}' metadata" - -local TOGGLE_MPD_CMD = "playerctl play-pause" -local NEXT_MPD_CMD = "playerctl next" -local PREV_MPD_CMD = "playerctl previous" -local LIST_PLAYERS_CMD = "playerctl -l" - -local PATH_TO_ICONS = "/usr/share/icons/Arc" -local PAUSE_ICON_NAME = PATH_TO_ICONS .. "/actions/24/player_pause.png" -local PLAY_ICON_NAME = PATH_TO_ICONS .. "/actions/24/player_play.png" -local STOP_ICON_NAME = PATH_TO_ICONS .. "/actions/24/player_stop.png" -local LIBRARY_ICON_NAME = PATH_TO_ICONS .. "/actions/24/music-library.png" - -local default_player = '' - -local icon = wibox.widget { - id = "icon", - widget = wibox.widget.imagebox, - image = PLAY_ICON_NAME -} - -local mpris_widget = wibox.widget{ - { - id = 'artist', - widget = wibox.widget.textbox - }, - { - icon, - max_value = 1, - value = 0, - thickness = 2, - start_angle = 4.71238898, -- 2pi*3/4 - forced_height = 24, - forced_width = 24, - rounded_edge = true, - bg = "#ffffff11", - paddings = 0, - widget = wibox.container.arcchart - }, - { - id = 'title', - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.horizontal, - set_text = function(self, artist, title) - self:get_children_by_id('artist')[1]:set_text(artist) - self:get_children_by_id('title')[1]:set_text(title) - end -} - -local rows = { layout = wibox.layout.fixed.vertical } - -local popup = awful.popup{ - bg = beautiful.bg_normal, - ontop = true, - visible = false, - shape = gears.shape.rounded_rect, - border_width = 1, - border_color = beautiful.bg_focus, - maximum_width = 400, - offset = { y = 5 }, - widget = {} -} - -local function rebuild_popup() - awful.spawn.easy_async(LIST_PLAYERS_CMD, function(stdout, _, _, _) - for i = 0, #rows do rows[i]=nil end - for player_name in stdout:gmatch("[^\r\n]+") do - if player_name ~='' and player_name ~=nil then - - local checkbox = wibox.widget{ - { - checked = player_name == default_player, - color = beautiful.bg_normal, - paddings = 2, - shape = gears.shape.circle, - forced_width = 20, - forced_height = 20, - check_color = beautiful.fg_urgent, - widget = wibox.widget.checkbox - }, - valign = 'center', - layout = wibox.container.place, - } - - checkbox:connect_signal("button::press", function() - default_player = player_name - rebuild_popup() - end) - - table.insert(rows, wibox.widget { - { - { - checkbox, - { - { - text = player_name, - align = 'left', - widget = wibox.widget.textbox - }, - left = 10, - layout = wibox.container.margin - }, - spacing = 8, - layout = wibox.layout.align.horizontal - }, - margins = 4, - layout = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - }) - end - end - end) - - popup:setup(rows) -end - -local function worker() - - -- retrieve song info - local current_song, artist, player_status - - local update_graphic = function(widget, stdout, _, _, _) - local words = gears.string.split(stdout, ';') - player_status = words[1] - artist = words[2] - current_song = words[3] - if current_song ~= nil then - if string.len(current_song) > 18 then - current_song = string.sub(current_song, 0, 9) .. ".." - end - end - - if player_status == "Playing" then - icon.image = PLAY_ICON_NAME - widget.colors = {beautiful.widget_main_color} - widget:set_text(artist, current_song) - elseif player_status == "Paused" then - icon.image = PAUSE_ICON_NAME - widget.colors = {beautiful.widget_main_color} - widget:set_text(artist, current_song) - elseif player_status == "Stopped" then - icon.image = STOP_ICON_NAME - else -- no player is running - icon.image = LIBRARY_ICON_NAME - widget.colors = {beautiful.widget_red} - end - end - - mpris_widget:buttons( - awful.util.table.join( - awful.button({}, 3, function() - if popup.visible then - popup.visible = not popup.visible - else - rebuild_popup() - popup:move_next_to(mouse.current_widget_geometry) - end - end), - awful.button({}, 4, function() awful.spawn(NEXT_MPD_CMD, false) end), - awful.button({}, 5, function() awful.spawn(PREV_MPD_CMD, false) end), - awful.button({}, 1, function() awful.spawn(TOGGLE_MPD_CMD, false) end) - ) - ) - - watch(string.format(GET_MPD_CMD, "'" .. default_player .. "'"), 1, update_graphic, mpris_widget) - - return mpris_widget - -end - -return setmetatable(mpris_widget, {__call = function(_, ...) return worker(...) end}) diff --git a/awesome/awesome-wm-widgets/net-speed-widget/README.md b/awesome/awesome-wm-widgets/net-speed-widget/README.md deleted file mode 100644 index a09893e..0000000 --- a/awesome/awesome-wm-widgets/net-speed-widget/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Net Speed Widget - -The widget and readme is in progress - -## Installation - -Please refer to the [installation](https://github.com/streetturtle/awesome-wm-widgets#installation) section of the repo. - -Clone repo, include widget and use it in **rc.lua**: - -```lua -local net_speed_widget = require("awesome-wm-widgets.net-speed-widget.net-speed") -... -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - net_speed_widget(), - ... - } - ... -``` diff --git a/awesome/awesome-wm-widgets/net-speed-widget/icons/down.svg b/awesome/awesome-wm-widgets/net-speed-widget/icons/down.svg deleted file mode 100644 index 9a98f39..0000000 --- a/awesome/awesome-wm-widgets/net-speed-widget/icons/down.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/awesome/awesome-wm-widgets/net-speed-widget/icons/up.svg b/awesome/awesome-wm-widgets/net-speed-widget/icons/up.svg deleted file mode 100644 index e3c12a7..0000000 --- a/awesome/awesome-wm-widgets/net-speed-widget/icons/up.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/awesome/awesome-wm-widgets/net-speed-widget/net-speed.lua b/awesome/awesome-wm-widgets/net-speed-widget/net-speed.lua deleted file mode 100644 index 6dd3b05..0000000 --- a/awesome/awesome-wm-widgets/net-speed-widget/net-speed.lua +++ /dev/null @@ -1,126 +0,0 @@ -------------------------------------------------- --- Net Speed Widget for Awesome Window Manager --- Shows current upload/download speed --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/net-speed-widget - --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- - -local watch = require("awful.widget.watch") -local wibox = require("wibox") - -local HOME_DIR = os.getenv("HOME") -local WIDGET_DIR = HOME_DIR .. '/.config/awesome/awesome-wm-widgets/net-speed-widget/' -local ICONS_DIR = WIDGET_DIR .. 'icons/' - -local net_speed_widget = {} - -local function convert_to_h(bytes) - local speed - local dim - local bits = bytes * 8 - if bits < 1000 then - speed = bits - dim = 'b/s' - elseif bits < 1000000 then - speed = bits/1000 - dim = 'kb/s' - elseif bits < 1000000000 then - speed = bits/1000000 - dim = 'mb/s' - elseif bits < 1000000000000 then - speed = bits/1000000000 - dim = 'gb/s' - else - speed = tonumber(bits) - dim = 'b/s' - end - return math.floor(speed + 0.5) .. dim -end - -local function split(string_to_split, separator) - if separator == nil then separator = "%s" end - local t = {} - - for str in string.gmatch(string_to_split, "([^".. separator .."]+)") do - table.insert(t, str) - end - - return t -end - -local function worker(user_args) - - local args = user_args or {} - - local interface = args.interface or '*' - local timeout = args.timeout or 1 - local width = args.width or 55 - - net_speed_widget = wibox.widget { - { - id = 'rx_speed', - forced_width = width, - align = 'right', - widget = wibox.widget.textbox - }, - { - image = ICONS_DIR .. 'down.svg', - widget = wibox.widget.imagebox - }, - { - image = ICONS_DIR .. 'up.svg', - widget = wibox.widget.imagebox - }, - { - id = 'tx_speed', - forced_width = width, - align = 'left', - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.horizontal, - set_rx_text = function(self, new_rx_speed) - self:get_children_by_id('rx_speed')[1]:set_text(tostring(new_rx_speed)) - end, - set_tx_text = function(self, new_tx_speed) - self:get_children_by_id('tx_speed')[1]:set_text(tostring(new_tx_speed)) - end - } - - -- make sure these are not shared across different worker/widgets (e.g. two monitors) - -- otherwise the speed will be randomly split among the worker in each monitor - local prev_rx = 0 - local prev_tx = 0 - - local update_widget = function(widget, stdout) - - local cur_vals = split(stdout, '\r\n') - - local cur_rx = 0 - local cur_tx = 0 - - for i, v in ipairs(cur_vals) do - if i%2 == 1 then cur_rx = cur_rx + v end - if i%2 == 0 then cur_tx = cur_tx + v end - end - - local speed_rx = (cur_rx - prev_rx) / timeout - local speed_tx = (cur_tx - prev_tx) / timeout - - widget:set_rx_text(convert_to_h(speed_rx)) - widget:set_tx_text(convert_to_h(speed_tx)) - - prev_rx = cur_rx - prev_tx = cur_tx - end - - watch(string.format([[bash -c "cat /sys/class/net/%s/statistics/*_bytes"]], interface), - timeout, update_widget, net_speed_widget) - - return net_speed_widget - -end - -return setmetatable(net_speed_widget, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/awesome-wm-widgets/pactl-widget/README.md b/awesome/awesome-wm-widgets/pactl-widget/README.md deleted file mode 100644 index ad6639b..0000000 --- a/awesome/awesome-wm-widgets/pactl-widget/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Pactl volume widget - -This is a volume widget that uses `pactl` only for controlling volume and -selecting sinks and sources. Hence, it can be used with PulseAudio or PipeWire -likewise, unlike the original Volume widget. - -Other than that it is heavily based on the original widget, including its -customization and icon options. For screenshots, see the original widget. - -## Installation - -Clone the repo under **~/.config/awesome/** and add widget in **rc.lua**: - -```lua -local volume_widget = require('awesome-wm-widgets.pactl-widget.volume') -... -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - -- default - volume_widget(), - -- customized - volume_widget{ - widget_type = 'arc' - }, -``` - -### Shortcuts - -To improve responsiveness of the widget when volume level is changed by a shortcut use corresponding methods of the widget: - -```lua -awful.key({}, "XF86AudioRaiseVolume", function () volume_widget:inc(5) end), -awful.key({}, "XF86AudioLowerVolume", function () volume_widget:dec(5) end), -awful.key({}, "XF86AudioMute", function () volume_widget:toggle() end), -``` - -## Customization - -It is possible to customize the widget by providing a table with all or some of -the following config parameters: - -### Generic parameter - -| Name | Default | Description | -|---|---|---| -| `mixer_cmd` | `pavucontrol` | command to run on middle click (e.g. a mixer program) | -| `step` | `5` | How much the volume is raised or lowered at once (in %) | -| `widget_type`| `icon_and_text`| Widget type, one of `horizontal_bar`, `vertical_bar`, `icon`, `icon_and_text`, `arc` | -| `device` | `@DEFAULT_SINK@` | Select the device name to control | -| `tooltip` | `false` | Display volume level in a tooltip when the mouse cursor hovers the widget | - -For more details on parameters depending on the chosen widget type, please -refer to the original Volume widget. diff --git a/awesome/awesome-wm-widgets/pactl-widget/pactl.lua b/awesome/awesome-wm-widgets/pactl-widget/pactl.lua deleted file mode 100644 index 638dc7e..0000000 --- a/awesome/awesome-wm-widgets/pactl-widget/pactl.lua +++ /dev/null @@ -1,124 +0,0 @@ -local spawn = require("awful.spawn") -local utils = require("awesome-wm-widgets.pactl-widget.utils") - -local pactl = {} - - -function pactl.volume_increase(device, step) - spawn('pactl set-sink-volume ' .. device .. ' +' .. step .. '%', false) -end - -function pactl.volume_decrease(device, step) - spawn('pactl set-sink-volume ' .. device .. ' -' .. step .. '%', false) -end - -function pactl.mute_toggle(device) - spawn('pactl set-sink-mute ' .. device .. ' toggle', false) -end - -function pactl.get_volume(device) - local stdout = utils.popen_and_return('pactl get-sink-volume ' .. device) - - local volsum, volcnt = 0, 0 - for vol in string.gmatch(stdout, "(%d?%d?%d)%%") do - vol = tonumber(vol) - if vol ~= nil then - volsum = volsum + vol - volcnt = volcnt + 1 - end - end - - if volcnt == 0 then - return nil - end - - return volsum / volcnt -end - -function pactl.get_mute(device) - local stdout = utils.popen_and_return('pactl get-sink-mute ' .. device) - if string.find(stdout, "yes") then - return true - else - return false - end -end - -function pactl.get_sinks_and_sources() - local default_sink = utils.trim(utils.popen_and_return('pactl get-default-sink')) - local default_source = utils.trim(utils.popen_and_return('pactl get-default-source')) - - local sinks = {} - local sources = {} - - local device - local ports - local key - local value - local in_section - - for line in utils.popen_and_return('pactl list'):gmatch('[^\r\n]*') do - - if string.match(line, '^%a+ #') then - in_section = nil - end - - local is_sink_line = string.match(line, '^Sink #') - local is_source_line = string.match(line, '^Source #') - - if is_sink_line or is_source_line then - in_section = "main" - - device = { - id = line:match('#(%d+)'), - is_default = false - } - if is_sink_line then - table.insert(sinks, device) - else - table.insert(sources, device) - end - end - - -- Found a new subsection - if in_section ~= nil and string.match(line, '^\t%a+:$') then - in_section = utils.trim(line):lower() - in_section = string.sub(in_section, 1, #in_section-1) - - if in_section == 'ports' then - ports = {} - device['ports'] = ports - end - end - - -- Found a key-value pair - if string.match(line, "^\t*[^\t]+: ") then - local t = utils.split(line, ':') - key = utils.trim(t[1]):lower():gsub(' ', '_') - value = utils.trim(t[2]) - end - - -- Key value pair on 1st level - if in_section ~= nil and string.match(line, "^\t[^\t]+: ") then - device[key] = value - - if key == "name" and (value == default_sink or value == default_source) then - device['is_default'] = true - end - end - - -- Key value pair in ports section - if in_section == "ports" and string.match(line, "^\t\t[^\t]+: ") then - ports[key] = value - end - end - - return sinks, sources -end - -function pactl.set_default(type, name) - spawn('pactl set-default-' .. type .. ' "' .. name .. '"', false) -end - - -return pactl diff --git a/awesome/awesome-wm-widgets/pactl-widget/utils.lua b/awesome/awesome-wm-widgets/pactl-widget/utils.lua deleted file mode 100644 index 52e7869..0000000 --- a/awesome/awesome-wm-widgets/pactl-widget/utils.lua +++ /dev/null @@ -1,28 +0,0 @@ -local utils = {} - - -function utils.trim(str) - return string.match(str, "^%s*(.-)%s*$") -end - -function utils.split(string_to_split, separator) - if separator == nil then separator = "%s" end - local t = {} - - for str in string.gmatch(string_to_split, "([^".. separator .."]+)") do - table.insert(t, str) - end - - return t -end - -function utils.popen_and_return(cmd) - local handle = io.popen(cmd) - local result = handle:read("*a") - handle:close() - - return result -end - - -return utils diff --git a/awesome/awesome-wm-widgets/pactl-widget/volume.lua b/awesome/awesome-wm-widgets/pactl-widget/volume.lua deleted file mode 100644 index 1c3108c..0000000 --- a/awesome/awesome-wm-widgets/pactl-widget/volume.lua +++ /dev/null @@ -1,243 +0,0 @@ -------------------------------------------------- --- A purely pactl-based volume widget based on the original Volume widget --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/pactl-widget - --- @author Stefan Huber --- @copyright 2023 Stefan Huber -------------------------------------------------- - -local awful = require("awful") -local wibox = require("wibox") -local spawn = require("awful.spawn") -local gears = require("gears") -local beautiful = require("beautiful") - -local pactl = require("awesome-wm-widgets.pactl-widget.pactl") -local utils = require("awesome-wm-widgets.pactl-widget.utils") - - -local widget_types = { - icon_and_text = require("awesome-wm-widgets.volume-widget.widgets.icon-and-text-widget"), - icon = require("awesome-wm-widgets.volume-widget.widgets.icon-widget"), - arc = require("awesome-wm-widgets.volume-widget.widgets.arc-widget"), - horizontal_bar = require("awesome-wm-widgets.volume-widget.widgets.horizontal-bar-widget"), - vertical_bar = require("awesome-wm-widgets.volume-widget.widgets.vertical-bar-widget") -} -local volume = {} - -local rows = { layout = wibox.layout.fixed.vertical } - -local popup = awful.popup{ - bg = beautiful.bg_normal, - ontop = true, - visible = false, - shape = gears.shape.rounded_rect, - border_width = 1, - border_color = beautiful.bg_focus, - maximum_width = 400, - offset = { y = 5 }, - widget = {} -} - -local function build_main_line(device) - if device.active_port ~= nil and device.ports[device.active_port] ~= nil then - return device.description .. ' · ' .. utils.split(device.ports[device.active_port], " ")[1] - else - return device.description - end -end - -local function build_rows(devices, on_checkbox_click, device_type) - local device_rows = { layout = wibox.layout.fixed.vertical } - for _, device in pairs(devices) do - - local checkbox = wibox.widget { - checked = device.is_default, - color = beautiful.bg_normal, - paddings = 2, - shape = gears.shape.circle, - forced_width = 20, - forced_height = 20, - check_color = beautiful.fg_urgent, - widget = wibox.widget.checkbox - } - - checkbox:connect_signal("button::press", function() - pactl.set_default(device_type, device.name) - on_checkbox_click() - end) - - local row = wibox.widget { - { - { - { - checkbox, - valign = 'center', - layout = wibox.container.place, - }, - { - { - text = build_main_line(device), - align = 'left', - widget = wibox.widget.textbox - }, - left = 10, - layout = wibox.container.margin - }, - spacing = 8, - layout = wibox.layout.align.horizontal - }, - margins = 4, - layout = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } - - row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) - row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) - - local old_cursor, old_wibox - row:connect_signal("mouse::enter", function() - local wb = mouse.current_wibox - old_cursor, old_wibox = wb.cursor, wb - wb.cursor = "hand1" - end) - row:connect_signal("mouse::leave", function() - if old_wibox then - old_wibox.cursor = old_cursor - old_wibox = nil - end - end) - - row:connect_signal("button::press", function() - pactl.set_default(device_type, device.name) - on_checkbox_click() - end) - - table.insert(device_rows, row) - end - - return device_rows -end - -local function build_header_row(text) - return wibox.widget{ - { - markup = "" .. text .. "", - align = 'center', - widget = wibox.widget.textbox - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } -end - -local function rebuild_popup() - for i = 0, #rows do - rows[i]=nil - end - - local sinks, sources = pactl.get_sinks_and_sources() - table.insert(rows, build_header_row("SINKS")) - table.insert(rows, build_rows(sinks, function() rebuild_popup() end, "sink")) - table.insert(rows, build_header_row("SOURCES")) - table.insert(rows, build_rows(sources, function() rebuild_popup() end, "source")) - - popup:setup(rows) -end - -local function worker(user_args) - - local args = user_args or {} - - local mixer_cmd = args.mixer_cmd or 'pavucontrol' - local widget_type = args.widget_type - local refresh_rate = args.refresh_rate or 1 - local step = args.step or 5 - local device = args.device or '@DEFAULT_SINK@' - local tooltip = args.tooltip or false - - if widget_types[widget_type] == nil then - volume.widget = widget_types['icon_and_text'].get_widget(args.icon_and_text_args) - else - volume.widget = widget_types[widget_type].get_widget(args) - end - - local function update_graphic(widget) - local vol = pactl.get_volume(device) - if vol ~= nil then - widget:set_volume_level(vol) - end - - if pactl.get_mute(device) then - widget:mute() - else - widget:unmute() - end - end - - function volume:inc(s) - pactl.volume_increase(device, s or step) - update_graphic(volume.widget) - end - - function volume:dec(s) - pactl.volume_decrease(device, s or step) - update_graphic(volume.widget) - end - - function volume:toggle() - pactl.mute_toggle(device) - update_graphic(volume.widget) - end - - function volume:popup() - if popup.visible then - popup.visible = not popup.visible - else - rebuild_popup() - popup:move_next_to(mouse.current_widget_geometry) - end - end - - function volume:mixer() - if mixer_cmd then - spawn(mixer_cmd) - end - end - - volume.widget:buttons( - awful.util.table.join( - awful.button({}, 1, function() volume:toggle() end), - awful.button({}, 2, function() volume:mixer() end), - awful.button({}, 3, function() volume:popup() end), - awful.button({}, 4, function() volume:inc() end), - awful.button({}, 5, function() volume:dec() end) - ) - ) - - gears.timer { - timeout = refresh_rate, - call_now = true, - autostart = true, - callback = function() - update_graphic(volume.widget) - end - } - - if tooltip then - awful.tooltip { - objects = { volume.widget }, - timer_function = function() - return pactl.get_volume(device) .. " %" - end, - } - end - - return volume.widget -end - - -return setmetatable(volume, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/awesome-wm-widgets/ram-widget/README.md b/awesome/awesome-wm-widgets/ram-widget/README.md deleted file mode 100644 index 568245b..0000000 --- a/awesome/awesome-wm-widgets/ram-widget/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Ram widget - -This widget shows the RAM usage. When clicked another widget appears with more detailed information: - -![screenshot](./out.gif) - -Note: this widget is compatible with Awesome v4.3+, as it is using [awful.popup](https://awesomewm.org/doc/api/classes/awful.popup.html) - -## Customization - -It is possible to customize widget by providing a table with all or some of the following config parameters: - -| Name | Default | Description | -|---|---|---| -| `color_used` | `beautiful.bg_urgent` | Color for used RAM | -| `color_free` | `beautiful.fg_normal` | Color for free RAM | -| `color_buf` | `beautiful.border_color_active` | Color for buffers/cache | -| `widget_height` | `25` | Height of the widget | -| `widget_width` | `25` | Width of the widget | -| `widget_show_buf` | `false` | Whether to display buffers/cache separately in the tray widget. If `false`, buffers/cache are considered free RAM. | -| `timeout` | 1 | How often (in seconds) the widget refreshes | - -## Installation - -Please refer to the [installation](https://github.com/streetturtle/awesome-wm-widgets#installation) section of the repo. - -Clone repo, include widget and use it in **rc.lua**: - -```lua -local ram_widget = require("awesome-wm-widgets.ram-widget.ram-widget") -... -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - ram_widget(), - ... - } - ... -``` - diff --git a/awesome/awesome-wm-widgets/ram-widget/out.gif b/awesome/awesome-wm-widgets/ram-widget/out.gif deleted file mode 100644 index 736f894..0000000 Binary files a/awesome/awesome-wm-widgets/ram-widget/out.gif and /dev/null differ diff --git a/awesome/awesome-wm-widgets/ram-widget/ram-widget.lua b/awesome/awesome-wm-widgets/ram-widget/ram-widget.lua deleted file mode 100644 index 867d28e..0000000 --- a/awesome/awesome-wm-widgets/ram-widget/ram-widget.lua +++ /dev/null @@ -1,108 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local gears = require("gears") -local watch = require("awful.widget.watch") -local wibox = require("wibox") - - -local ramgraph_widget = {} - - -local function worker(user_args) - local args = user_args or {} - local timeout = args.timeout or 1 - local color_used = args.color_used or beautiful.bg_urgent - local color_free = args.color_free or beautiful.fg_normal - local color_buf = args.color_buf or beautiful.border_color_active - local widget_show_buf = args.widget_show_buf or false - local widget_height = args.widget_height or 25 - local widget_width = args.widget_width or 25 - - --- Main ram widget shown on wibar - ramgraph_widget = wibox.widget { - border_width = 0, - colors = { - color_used, - color_free, - color_buf, - }, - display_labels = false, - forced_height = widget_height, - forced_width = widget_width, - widget = wibox.widget.piechart - } - - --- Widget which is shown when user clicks on the ram widget - local popup = awful.popup{ - ontop = true, - visible = false, - widget = { - widget = wibox.widget.piechart, - forced_height = 200, - forced_width = 400, - colors = { - color_used, - color_free, - color_buf, -- buf_cache - }, - }, - shape = gears.shape.rounded_rect, - border_color = beautiful.border_color_active, - border_width = 1, - offset = { y = 5 }, - } - - --luacheck:ignore 231 - local total, used, free, shared, buff_cache, available, total_swap, used_swap, free_swap - - local function getPercentage(value) - return math.floor(value / (total+total_swap) * 100 + 0.5) .. '%' - end - - watch('bash -c "LANGUAGE=en_US.UTF-8 free | grep -z Mem.*Swap.*"', timeout, - function(widget, stdout) - total, used, free, shared, buff_cache, available, total_swap, used_swap, free_swap = - stdout:match('(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*Swap:%s*(%d+)%s*(%d+)%s*(%d+)') - - if widget_show_buf then - widget.data = { used, free, buff_cache } - else - widget.data = { used, total-used } - end - - if popup.visible then - popup:get_widget().data_list = { - {'used ' .. getPercentage(used + used_swap), used + used_swap}, - {'free ' .. getPercentage(free + free_swap), free + free_swap}, - {'buff_cache ' .. getPercentage(buff_cache), buff_cache} - } - end - end, - ramgraph_widget - ) - - ramgraph_widget:buttons( - awful.util.table.join( - awful.button({}, 1, function() - popup:get_widget().data_list = { - {'used ' .. getPercentage(used + used_swap), used + used_swap}, - {'free ' .. getPercentage(free + free_swap), free + free_swap}, - {'buff_cache ' .. getPercentage(buff_cache), buff_cache} - } - - if popup.visible then - popup.visible = not popup.visible - else - popup:move_next_to(mouse.current_widget_geometry) - end - end) - ) - ) - - return ramgraph_widget -end - - -return setmetatable(ramgraph_widget, { __call = function(_, ...) - return worker(...) -end }) diff --git a/awesome/awesome-wm-widgets/todo-widget/README.md b/awesome/awesome-wm-widgets/todo-widget/README.md deleted file mode 100644 index c97d845..0000000 --- a/awesome/awesome-wm-widgets/todo-widget/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# ToDo Widget - -This widget displays a list of todo items and allows marking item as done/undone, delete an item and create new ones: - -![screenshot](./todo.gif) - -# Installation - -Widget persists todo items as a JSON, so in order to simplify JSON serialisation/deserialisation download a **json.lua** from this repository: https://github.com/rxi/json.lua under `~/.config/awesone` folder. And don't forget to star a repo :) - -Then clone this repository under **~/.config/awesome/** and add the widget in **rc.lua**: - -```lua -local todo_widget = require("awesome-wm-widgets.todo-widget.todo") -... -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - -- default - todo_widget(), - ... -``` -Also note that widget uses [Arc Icons](https://github.com/horst3180/arc-icon-theme) and expects them to be installed under `/usr/share/icons/Arc/`. - -# Theming - -Widget uses your theme's colors. In case you want to have different colors, without changing your theme, please create an issue for it. I'll extract them as widget parameters. diff --git a/awesome/awesome-wm-widgets/todo-widget/checkbox-checked-symbolic.svg b/awesome/awesome-wm-widgets/todo-widget/checkbox-checked-symbolic.svg deleted file mode 100644 index afeca62..0000000 --- a/awesome/awesome-wm-widgets/todo-widget/checkbox-checked-symbolic.svg +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - diff --git a/awesome/awesome-wm-widgets/todo-widget/chevron-down.svg b/awesome/awesome-wm-widgets/todo-widget/chevron-down.svg deleted file mode 100644 index dceeb0f..0000000 --- a/awesome/awesome-wm-widgets/todo-widget/chevron-down.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/todo-widget/chevron-up.svg b/awesome/awesome-wm-widgets/todo-widget/chevron-up.svg deleted file mode 100644 index 88474ce..0000000 --- a/awesome/awesome-wm-widgets/todo-widget/chevron-up.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/todo-widget/list-add-symbolic.svg b/awesome/awesome-wm-widgets/todo-widget/list-add-symbolic.svg deleted file mode 100644 index 9cc2d3a..0000000 --- a/awesome/awesome-wm-widgets/todo-widget/list-add-symbolic.svg +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - diff --git a/awesome/awesome-wm-widgets/todo-widget/todo.gif b/awesome/awesome-wm-widgets/todo-widget/todo.gif deleted file mode 100644 index 7160e21..0000000 Binary files a/awesome/awesome-wm-widgets/todo-widget/todo.gif and /dev/null differ diff --git a/awesome/awesome-wm-widgets/todo-widget/todo.lua b/awesome/awesome-wm-widgets/todo-widget/todo.lua deleted file mode 100644 index 78ca262..0000000 --- a/awesome/awesome-wm-widgets/todo-widget/todo.lua +++ /dev/null @@ -1,340 +0,0 @@ -------------------------------------------------- --- ToDo Widget for Awesome Window Manager --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/todo-widget - --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local wibox = require("wibox") -local json = require("json") -local spawn = require("awful.spawn") -local gears = require("gears") -local beautiful = require("beautiful") -local gfs = require("gears.filesystem") - -local HOME_DIR = os.getenv("HOME") -local WIDGET_DIR = HOME_DIR .. '/.config/awesome/awesome-wm-widgets/todo-widget' -local STORAGE = HOME_DIR .. '/.cache/awmw/todo-widget/todos.json' - -local GET_TODO_ITEMS = 'bash -c "cat ' .. STORAGE .. '"' - -local rows = { layout = wibox.layout.fixed.vertical } -local todo_widget = {} -local update_widget -todo_widget.widget = wibox.widget { - { - { - { - { - id = "icon", - forced_height = 16, - forced_width = 16, - widget = wibox.widget.imagebox - }, - valign = 'center', - layout = wibox.container.place - }, - { - id = "txt", - widget = wibox.widget.textbox - }, - spacing = 4, - layout = wibox.layout.fixed.horizontal, - }, - margins = 4, - layout = wibox.container.margin - }, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, 4) - end, - widget = wibox.container.background, - set_text = function(self, new_value) - self:get_children_by_id("txt")[1].text = new_value - end, - set_icon = function(self, new_value) - self:get_children_by_id("icon")[1].image = new_value - end -} - -function todo_widget:update_counter(todos) - local todo_count = 0 - for _,p in ipairs(todos) do - if not p.status then - todo_count = todo_count + 1 - end - end - - todo_widget.widget:set_text(todo_count) -end - -local popup = awful.popup{ - bg = beautiful.bg_normal, - ontop = true, - visible = false, - shape = gears.shape.rounded_rect, - border_width = 1, - border_color = beautiful.bg_focus, - maximum_width = 400, - offset = { y = 5 }, - widget = {} -} - -local add_button = wibox.widget { - { - { - image = WIDGET_DIR .. '/list-add-symbolic.svg', - resize = false, - widget = wibox.widget.imagebox - }, - top = 11, - left = 8, - right = 8, - layout = wibox.container.margin - }, - shape = function(cr, width, height) - gears.shape.circle(cr, width, height, 12) - end, - widget = wibox.container.background -} - -add_button:connect_signal("button::press", function() - local pr = awful.widget.prompt() - - table.insert(rows, wibox.widget { - { - { - pr.widget, - spacing = 8, - layout = wibox.layout.align.horizontal - }, - margins = 8, - layout = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - }) - awful.prompt.run{ - prompt = "New item: ", - bg = beautiful.bg_normal, - bg_cursor = beautiful.fg_urgent, - textbox = pr.widget, - exe_callback = function(input_text) - if not input_text or #input_text == 0 then return end - spawn.easy_async(GET_TODO_ITEMS, function(stdout) - local res = json.decode(stdout) - table.insert(res.todo_items, {todo_item = input_text, status = false}) - spawn.easy_async_with_shell("echo '" .. json.encode(res) .. "' > " .. STORAGE, function() - spawn.easy_async(GET_TODO_ITEMS, function(items) update_widget(items) end) - end) - end) - end - } - popup:setup(rows) -end) -add_button:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) -add_button:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) - -local function worker(user_args) - - local args = user_args or {} - - local icon = args.icon or WIDGET_DIR .. '/checkbox-checked-symbolic.svg' - - todo_widget.widget:set_icon(icon) - - function update_widget(stdout) - local result = json.decode(stdout) - if result == nil or result == '' then result = {} end - todo_widget:update_counter(result.todo_items) - - for i = 0, #rows do rows[i]=nil end - - local first_row = wibox.widget { - { - {widget = wibox.widget.textbox}, - { - markup = 'ToDo', - align = 'center', - forced_width = 350, -- for horizontal alignment - forced_height = 40, - widget = wibox.widget.textbox - }, - add_button, - spacing = 8, - layout = wibox.layout.fixed.horizontal - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } - - table.insert(rows, first_row) - - for i, todo_item in ipairs(result.todo_items) do - - local checkbox = wibox.widget { - checked = todo_item.status, - color = beautiful.bg_normal, - paddings = 2, - shape = gears.shape.circle, - forced_width = 20, - forced_height = 20, - check_color = beautiful.fg_urgent, - widget = wibox.widget.checkbox - } - - checkbox:connect_signal("button::press", function(c) - c:set_checked(not c.checked) - todo_item.status = not todo_item.status - result.todo_items[i] = todo_item - spawn.easy_async_with_shell("echo '" .. json.encode(result) .. "' > " .. STORAGE, function () - todo_widget:update_counter(result.todo_items) - end) - end) - - - local trash_button = wibox.widget { - { - { image = WIDGET_DIR .. '/window-close-symbolic.svg', - resize = false, - widget = wibox.widget.imagebox - }, - margins = 5, - layout = wibox.container.margin - }, - border_width = 1, - shape = function(cr, width, height) - gears.shape.circle(cr, width, height, 10) - end, - widget = wibox.container.background - } - - trash_button:connect_signal("button::press", function() - table.remove(result.todo_items, i) - spawn.easy_async_with_shell("printf '" .. json.encode(result) .. "' > " .. STORAGE, function () - spawn.easy_async(GET_TODO_ITEMS, function(items) update_widget(items) end) - end) - end) - - - local move_up = wibox.widget { - image = WIDGET_DIR .. '/chevron-up.svg', - resize = false, - widget = wibox.widget.imagebox - } - - move_up:connect_signal("button::press", function() - local temp = result.todo_items[i] - result.todo_items[i] = result.todo_items[i-1] - result.todo_items[i-1] = temp - spawn.easy_async_with_shell("printf '" .. json.encode(result) .. "' > " .. STORAGE, function () - spawn.easy_async(GET_TODO_ITEMS, function(items) update_widget(items) end) - end) - end) - - local move_down = wibox.widget { - image = WIDGET_DIR .. '/chevron-down.svg', - resize = false, - widget = wibox.widget.imagebox - } - - move_down:connect_signal("button::press", function() - local temp = result.todo_items[i] - result.todo_items[i] = result.todo_items[i+1] - result.todo_items[i+1] = temp - spawn.easy_async_with_shell("printf '" .. json.encode(result) .. "' > " .. STORAGE, function () - spawn.easy_async(GET_TODO_ITEMS, function(items) update_widget(items) end) - end) - end) - - - local move_buttons = { - layout = wibox.layout.fixed.vertical - } - - if i == 1 and #result.todo_items > 1 then - table.insert(move_buttons, move_down) - elseif i == #result.todo_items and #result.todo_items > 1 then - table.insert(move_buttons, move_up) - elseif #result.todo_items > 1 then - table.insert(move_buttons, move_up) - table.insert(move_buttons, move_down) - end - - local row = wibox.widget { - { - { - { - checkbox, - valign = 'center', - layout = wibox.container.place, - }, - { - { - text = todo_item.todo_item, - align = 'left', - widget = wibox.widget.textbox - }, - left = 10, - layout = wibox.container.margin - }, - { - { - move_buttons, - valign = 'center', - layout = wibox.container.place, - }, - { - trash_button, - valign = 'center', - layout = wibox.container.place, - }, - spacing = 8, - layout = wibox.layout.align.horizontal - }, - spacing = 8, - layout = wibox.layout.align.horizontal - }, - margins = 8, - layout = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } - - row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) - row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) - - table.insert(rows, row) - end - - popup:setup(rows) - end - - todo_widget.widget:buttons( - gears.table.join( - awful.button({}, 1, function() - if popup.visible then - todo_widget.widget:set_bg('#00000000') - popup.visible = not popup.visible - else - todo_widget.widget:set_bg(beautiful.bg_focus) - popup:move_next_to(mouse.current_widget_geometry) - end - end) - ) - ) - - spawn.easy_async(GET_TODO_ITEMS, function(stdout) update_widget(stdout) end) - - return todo_widget.widget -end - -if not gfs.file_readable(STORAGE) then - spawn.easy_async(string.format([[bash -c "dirname %s | xargs mkdir -p && echo '{\"todo_items\":{}}' > %s"]], - STORAGE, STORAGE)) -end - -return setmetatable(todo_widget, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/awesome-wm-widgets/todo-widget/window-close-symbolic.svg b/awesome/awesome-wm-widgets/todo-widget/window-close-symbolic.svg deleted file mode 100644 index 46ff888..0000000 --- a/awesome/awesome-wm-widgets/todo-widget/window-close-symbolic.svg +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - Gnome Symbolic Icon Theme - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - - - diff --git a/awesome/awesome-wm-widgets/volume-widget/README.md b/awesome/awesome-wm-widgets/volume-widget/README.md deleted file mode 100644 index 4fc7f55..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# Volume widget - -Volume widget based on [amixer](https://linux.die.net/man/1/amixer) (is used for controlling the audio volume) and [pacmd](https://linux.die.net/man/1/pacmd) (is used for selecting a sink/source). Also, the widget provides an easy way to customize how it looks, following types are supported out-of-the-box: - -![types](screenshots/variations.png) - -From left to right: `horizontal_bar`, `vertical_bar`, `icon`, `icon_and_text`, `arc` - -A right-click on the widget opens a popup where you can choose a sink/source: -![sink-sources](screenshots/volume-sink-sources.png) - -Left click toggles mute and middle click opens a mixer ([pavucontrol](https://freedesktop.org/software/pulseaudio/pavucontrol/) by default). - -### Features - - - switch between sinks/sources by right click on the widget; - - more responsive than previous versions of volume widget, which were refreshed once a second; - - 5 predefined customizable looks; - -## Installation - -Clone the repo under **~/.config/awesome/** and add widget in **rc.lua**: - -```lua -local volume_widget = require('awesome-wm-widgets.volume-widget.volume') -... -s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - -- default - volume_widget(), - -- customized - volume_widget{ - widget_type = 'arc' - }, -``` - -Note that widget uses following command the get the current volume: `amixer -D pulse sget Master`, so please make sure that it works for you, otherwise you need to set parameter `device = 'default'`. - -### Shortcuts - -To improve responsiveness of the widget when volume level is changed by a shortcut use corresponding methods of the widget: - -```lua -awful.key({ modkey }, "]", function() volume_widget:inc(5) end), -awful.key({ modkey }, "[", function() volume_widget:dec(5) end), -awful.key({ modkey }, "\\", function() volume_widget:toggle() end), -``` - -## Customization - -It is possible to customize the widget by providing a table with all or some of the following config parameters: - -### Generic parameter - -| Name | Default | Description | -|---|---|---| -| `mixer_cmd` | `pavucontrol` | command to run on middle click (e.g. a mixer program) | -| `step` | `5` | How much the volume is raised or lowered at once (in %) | -| `widget_type`| `icon_and_text`| Widget type, one of `horizontal_bar`, `vertical_bar`, `icon`, `icon_and_text`, `arc` | -| `device` | `pulse` | Select the device name to control | - -Depends on the chosen widget type add parameters from the corresponding section below: - -#### `icon` parameters - -| Name | Default | Description | -|---|---|---| -| `icon_dir`| `./icons`| Path to the folder with icons | - -_Note:_ if you are changing icons, the folder should contain following .svg images: - - audio-volume-high-symbolic - - audio-volume-medium-symbolic - - audio-volume-low-symbolic - - audio-volume-muted-symbolic - -#### `icon_and_text` parameters - -| Name | Default | Description | -|---|---|---| -| `icon_dir`| `./icons`| Path to the folder with icons | -| `font` | `beautiful.font` | Font name and size, like `Play 12` | - -#### `arc` parameters - -| Name | Default | Description | -|---|---|---| -| `thickness` | 2 | Thickness of the arc | -| `main_color` | `beautiful.fg_color` | Color of the arc | -| `bg_color` | `#ffffff11` | Color of the arc's background | -| `mute_color` | `beautiful.fg_urgent` | Color of the arc when mute | -| `size` | 18 | Size of the widget | - -#### `horizontal_bar` parameters - -| Name | Default | Description | -|---|---|---| -| `main_color` | `beautiful.fg_normal` | Color of the bar | -| `mute_color` | `beautiful.fg_urgent` | Color of the bar when mute | -| `bg_color` | `'#ffffff11'` | Color of the bar's background | -| `width` | `50` | The bar width | -| `margins` | `10` | Top and bottom margins (if your wibar is 22 px high, bar will be 2 px = 22 - 2*10) | -| `shape` | `'bar'` | [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc | -| `with_icon` | `true` | Show volume icon| - -_Note:_ I didn't figure out how does the `forced_height` property of progressbar widget work (maybe it doesn't work at all), thus there is a workaround with margins. - -#### `vertical_bar` parameters - -| Name | Default | Description | -|---|---|---| -| `main_color` | `beautiful.fg_normal` | Color of the bar | -| `mute_color` | `beautiful.fg_urgent` | Color of the bar when mute | -| `bg_color` | `'#ffffff11'` | Color of the bar's background | -| `width` | `10` | The bar width | -| `margins` | `20` | Top and bottom margins (if your wibar is 22 px high, bar will be 2 px = 22 - 2*10) | -| `shape` | `'bar'` | [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc | -| `with_icon` | `true` | Show volume icon| diff --git a/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-high-symbolic.svg b/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-high-symbolic.svg deleted file mode 100644 index 985c107..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-high-symbolic.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-low-symbolic.svg b/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-low-symbolic.svg deleted file mode 100644 index 7eb4531..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-low-symbolic.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-medium-symbolic.svg b/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-medium-symbolic.svg deleted file mode 100644 index 11e44fe..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-medium-symbolic.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-muted-symbolic.svg b/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-muted-symbolic.svg deleted file mode 100644 index e577d05..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-muted-symbolic.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/awesome/awesome-wm-widgets/volume-widget/screenshots/variations.png b/awesome/awesome-wm-widgets/volume-widget/screenshots/variations.png deleted file mode 100644 index 21d7ead..0000000 Binary files a/awesome/awesome-wm-widgets/volume-widget/screenshots/variations.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/volume-widget/screenshots/volume-sink-sources.png b/awesome/awesome-wm-widgets/volume-widget/screenshots/volume-sink-sources.png deleted file mode 100644 index 7d010bc..0000000 Binary files a/awesome/awesome-wm-widgets/volume-widget/screenshots/volume-sink-sources.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/volume-widget/utils.lua b/awesome/awesome-wm-widgets/volume-widget/utils.lua deleted file mode 100644 index 417a666..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/utils.lua +++ /dev/null @@ -1,105 +0,0 @@ - - -local utils = {} - -local function split(string_to_split, separator) - if separator == nil then separator = "%s" end - local t = {} - - for str in string.gmatch(string_to_split, "([^".. separator .."]+)") do - table.insert(t, str) - end - - return t -end - -function utils.extract_sinks_and_sources(pacmd_output) - local sinks = {} - local sources = {} - local device - local properties - local ports - local in_sink = false - local in_source = false - local in_device = false - local in_properties = false - local in_ports = false - for line in pacmd_output:gmatch("[^\r\n]+") do - if string.match(line, 'source%(s%) available.') then - in_sink = false - in_source = true - end - if string.match(line, 'sink%(s%) available.') then - in_sink = true - in_source = false - end - - if string.match(line, 'index:') then - in_device = true - in_properties = false - device = { - id = line:match(': (%d+)'), - is_default = string.match(line, '*') ~= nil - } - if in_sink then - table.insert(sinks, device) - elseif in_source then - table.insert(sources, device) - end - end - - if string.match(line, '^\tproperties:') then - in_device = false - in_properties = true - properties = {} - device['properties'] = properties - end - - if string.match(line, 'ports:') then - in_device = false - in_properties = false - in_ports = true - ports = {} - device['ports'] = ports - end - - if string.match(line, 'active port:') then - in_device = false - in_properties = false - in_ports = false - device['active_port'] = line:match(': (.+)'):gsub('<',''):gsub('>','') - end - - if in_device then - local t = split(line, ': ') - local key = t[1]:gsub('\t+', ''):lower() - local value = t[2]:gsub('^<', ''):gsub('>$', '') - device[key] = value - end - - if in_properties then - local t = split(line, '=') - local key = t[1]:gsub('\t+', ''):gsub('%.', '_'):gsub('-', '_'):gsub(':', ''):gsub("%s+$", "") - local value - if t[2] == nil then - value = t[2] - else - value = t[2]:gsub('"', ''):gsub("^%s+", ""):gsub(' Analog Stereo', '') - end - properties[key] = value - end - - if in_ports then - local t = split(line, ': ') - local key = t[1] - if key ~= nil then - key = key:gsub('\t+', '') - end - ports[key] = t[2] - end - end - - return sinks, sources -end - -return utils \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/volume-widget/volume-2.svg b/awesome/awesome-wm-widgets/volume-widget/volume-2.svg deleted file mode 100644 index 10f1c67..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/volume-2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/volume-widget/volume.lua b/awesome/awesome-wm-widgets/volume-widget/volume.lua deleted file mode 100644 index 4c44042..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/volume.lua +++ /dev/null @@ -1,228 +0,0 @@ -------------------------------------------------- --- The Ultimate Volume Widget for Awesome Window Manager --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/volume-widget - --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local wibox = require("wibox") -local spawn = require("awful.spawn") -local gears = require("gears") -local beautiful = require("beautiful") -local watch = require("awful.widget.watch") -local utils = require("awesome-wm-widgets.volume-widget.utils") - - -local LIST_DEVICES_CMD = [[sh -c "pacmd list-sinks; pacmd list-sources"]] -local function GET_VOLUME_CMD(device) return 'amixer -D ' .. device .. ' sget Master' end -local function INC_VOLUME_CMD(device, step) return 'amixer -D ' .. device .. ' sset Master ' .. step .. '%+' end -local function DEC_VOLUME_CMD(device, step) return 'amixer -D ' .. device .. ' sset Master ' .. step .. '%-' end -local function TOG_VOLUME_CMD(device) return 'amixer -D ' .. device .. ' sset Master toggle' end - - -local widget_types = { - icon_and_text = require("awesome-wm-widgets.volume-widget.widgets.icon-and-text-widget"), - icon = require("awesome-wm-widgets.volume-widget.widgets.icon-widget"), - arc = require("awesome-wm-widgets.volume-widget.widgets.arc-widget"), - horizontal_bar = require("awesome-wm-widgets.volume-widget.widgets.horizontal-bar-widget"), - vertical_bar = require("awesome-wm-widgets.volume-widget.widgets.vertical-bar-widget") -} -local volume = {} - -local rows = { layout = wibox.layout.fixed.vertical } - -local popup = awful.popup{ - bg = beautiful.bg_normal, - ontop = true, - visible = false, - shape = gears.shape.rounded_rect, - border_width = 1, - border_color = beautiful.bg_focus, - maximum_width = 400, - offset = { y = 5 }, - widget = {} -} - -local function build_main_line(device) - if device.active_port ~= nil and device.ports[device.active_port] ~= nil then - return device.properties.device_description .. ' · ' .. device.ports[device.active_port] - else - return device.properties.device_description - end -end - -local function build_rows(devices, on_checkbox_click, device_type) - local device_rows = { layout = wibox.layout.fixed.vertical } - for _, device in pairs(devices) do - - local checkbox = wibox.widget { - checked = device.is_default, - color = beautiful.bg_normal, - paddings = 2, - shape = gears.shape.circle, - forced_width = 20, - forced_height = 20, - check_color = beautiful.fg_urgent, - widget = wibox.widget.checkbox - } - - checkbox:connect_signal("button::press", function() - spawn.easy_async(string.format([[sh -c 'pacmd set-default-%s "%s"']], device_type, device.name), function() - on_checkbox_click() - end) - end) - - local row = wibox.widget { - { - { - { - checkbox, - valign = 'center', - layout = wibox.container.place, - }, - { - { - text = build_main_line(device), - align = 'left', - widget = wibox.widget.textbox - }, - left = 10, - layout = wibox.container.margin - }, - spacing = 8, - layout = wibox.layout.align.horizontal - }, - margins = 4, - layout = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } - - row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) - row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) - - local old_cursor, old_wibox - row:connect_signal("mouse::enter", function() - local wb = mouse.current_wibox - old_cursor, old_wibox = wb.cursor, wb - wb.cursor = "hand1" - end) - row:connect_signal("mouse::leave", function() - if old_wibox then - old_wibox.cursor = old_cursor - old_wibox = nil - end - end) - - row:connect_signal("button::press", function() - spawn.easy_async(string.format([[sh -c 'pacmd set-default-%s "%s"']], device_type, device.name), function() - on_checkbox_click() - end) - end) - - table.insert(device_rows, row) - end - - return device_rows -end - -local function build_header_row(text) - return wibox.widget{ - { - markup = "" .. text .. "", - align = 'center', - widget = wibox.widget.textbox - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } -end - -local function rebuild_popup() - spawn.easy_async(LIST_DEVICES_CMD, function(stdout) - - local sinks, sources = utils.extract_sinks_and_sources(stdout) - - for i = 0, #rows do rows[i]=nil end - - table.insert(rows, build_header_row("SINKS")) - table.insert(rows, build_rows(sinks, function() rebuild_popup() end, "sink")) - table.insert(rows, build_header_row("SOURCES")) - table.insert(rows, build_rows(sources, function() rebuild_popup() end, "source")) - - popup:setup(rows) - end) -end - - -local function worker(user_args) - - local args = user_args or {} - - local mixer_cmd = args.mixer_cmd or 'pavucontrol' - local widget_type = args.widget_type - local refresh_rate = args.refresh_rate or 1 - local step = args.step or 5 - local device = args.device or 'pulse' - - if widget_types[widget_type] == nil then - volume.widget = widget_types['icon_and_text'].get_widget(args.icon_and_text_args) - else - volume.widget = widget_types[widget_type].get_widget(args) - end - - local function update_graphic(widget, stdout) - local mute = string.match(stdout, "%[(o%D%D?)%]") -- \[(o\D\D?)\] - [on] or [off] - if mute == 'off' then widget:mute() - elseif mute == 'on' then widget:unmute() - end - local volume_level = string.match(stdout, "(%d?%d?%d)%%") -- (\d?\d?\d)\%) - volume_level = string.format("% 3d", volume_level) - widget:set_volume_level(volume_level) - end - - function volume:inc(s) - spawn.easy_async(INC_VOLUME_CMD(device, s or step), function(stdout) update_graphic(volume.widget, stdout) end) - end - - function volume:dec(s) - spawn.easy_async(DEC_VOLUME_CMD(device, s or step), function(stdout) update_graphic(volume.widget, stdout) end) - end - - function volume:toggle() - spawn.easy_async(TOG_VOLUME_CMD(device), function(stdout) update_graphic(volume.widget, stdout) end) - end - - function volume:mixer() - if mixer_cmd then - spawn.easy_async(mixer_cmd) - end - end - - volume.widget:buttons( - awful.util.table.join( - awful.button({}, 3, function() - if popup.visible then - popup.visible = not popup.visible - else - rebuild_popup() - popup:move_next_to(mouse.current_widget_geometry) - end - end), - awful.button({}, 4, function() volume:inc() end), - awful.button({}, 5, function() volume:dec() end), - awful.button({}, 2, function() volume:mixer() end), - awful.button({}, 1, function() volume:toggle() end) - ) - ) - - watch(GET_VOLUME_CMD(device), refresh_rate, update_graphic, volume.widget) - - return volume.widget -end - -return setmetatable(volume, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/awesome-wm-widgets/volume-widget/widgets/arc-widget.lua b/awesome/awesome-wm-widgets/volume-widget/widgets/arc-widget.lua deleted file mode 100644 index b512f12..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/widgets/arc-widget.lua +++ /dev/null @@ -1,46 +0,0 @@ -local wibox = require("wibox") -local beautiful = require('beautiful') - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -local widget = {} - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local thickness = args.thickness or 2 - local main_color = args.main_color or beautiful.fg_color - local bg_color = args.bg_color or '#ffffff11' - local mute_color = args.mute_color or beautiful.fg_urgent - local size = args.size or 18 - - return wibox.widget { - { - id = "icon", - image = ICON_DIR .. 'audio-volume-high-symbolic.svg', - resize = true, - widget = wibox.widget.imagebox, - }, - max_value = 100, - thickness = thickness, - start_angle = 4.71238898, -- 2pi*3/4 - forced_height = size, - forced_width = size, - bg = bg_color, - paddings = 2, - widget = wibox.container.arcchart, - set_volume_level = function(self, new_value) - self.value = new_value - end, - mute = function(self) - self.colors = { mute_color } - end, - unmute = function(self) - self.colors = { main_color } - end - } - -end - - -return widget \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/volume-widget/widgets/horizontal-bar-widget.lua b/awesome/awesome-wm-widgets/volume-widget/widgets/horizontal-bar-widget.lua deleted file mode 100644 index be1f38d..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/widgets/horizontal-bar-widget.lua +++ /dev/null @@ -1,58 +0,0 @@ -local wibox = require("wibox") -local beautiful = require('beautiful') -local gears = require("gears") - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -local widget = {} - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local main_color = args.main_color or beautiful.fg_normal - local mute_color = args.mute_color or beautiful.fg_urgent - local bg_color = args.bg_color or '#ffffff11' - local width = args.width or 50 - local margins = args.margins or 10 - local shape = args.shape or 'bar' - local with_icon = args.with_icon == true and true or false - - local bar = wibox.widget { - { - { - id = "icon", - image = ICON_DIR .. 'audio-volume-high-symbolic.svg', - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - visible = with_icon, - layout = wibox.container.place, - }, - { - id = 'bar', - max_value = 100, - forced_width = width, - color = main_color, - margins = { top = margins, bottom = margins }, - background_color = bg_color, - shape = gears.shape[shape], - widget = wibox.widget.progressbar, - }, - spacing = 4, - layout = wibox.layout.fixed.horizontal, - set_volume_level = function(self, new_value) - self:get_children_by_id('bar')[1]:set_value(tonumber(new_value)) - end, - mute = function(self) - self:get_children_by_id('bar')[1]:set_color(mute_color) - end, - unmute = function(self) - self:get_children_by_id('bar')[1]:set_color(main_color) - end - } - - return bar -end - -return widget diff --git a/awesome/awesome-wm-widgets/volume-widget/widgets/icon-and-text-widget.lua b/awesome/awesome-wm-widgets/volume-widget/widgets/icon-and-text-widget.lua deleted file mode 100644 index b1a2793..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/widgets/icon-and-text-widget.lua +++ /dev/null @@ -1,59 +0,0 @@ -local wibox = require("wibox") -local beautiful = require('beautiful') - -local widget = {} - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local font = args.font or beautiful.font - local icon_dir = args.icon_dir or ICON_DIR - - return wibox.widget { - { - { - id = "icon", - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - layout = wibox.container.place - }, - { - id = 'txt', - font = font, - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.horizontal, - set_volume_level = function(self, new_value) - self:get_children_by_id('txt')[1]:set_text(new_value) - local volume_icon_name - if self.is_muted then - volume_icon_name = 'audio-volume-muted-symbolic' - else - local new_value_num = tonumber(new_value) - if (new_value_num >= 0 and new_value_num < 33) then - volume_icon_name="audio-volume-low-symbolic" - elseif (new_value_num < 66) then - volume_icon_name="audio-volume-medium-symbolic" - else - volume_icon_name="audio-volume-high-symbolic" - end - end - self:get_children_by_id('icon')[1]:set_image(icon_dir .. volume_icon_name .. '.svg') - end, - mute = function(self) - self.is_muted = true - self:get_children_by_id('icon')[1]:set_image(icon_dir .. 'audio-volume-muted-symbolic.svg') - end, - unmute = function(self) - self.is_muted = false - end - } - -end - - -return widget \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/volume-widget/widgets/icon-widget.lua b/awesome/awesome-wm-widgets/volume-widget/widgets/icon-widget.lua deleted file mode 100644 index cc39a3d..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/widgets/icon-widget.lua +++ /dev/null @@ -1,46 +0,0 @@ -local wibox = require("wibox") - -local widget = {} - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local icon_dir = args.icon_dir or ICON_DIR - - return wibox.widget { - { - id = "icon", - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - layout = wibox.container.place, - set_volume_level = function(self, new_value) - local volume_icon_name - if self.is_muted then - volume_icon_name = 'audio-volume-muted-symbolic' - else - local new_value_num = tonumber(new_value) - if (new_value_num >= 0 and new_value_num < 33) then - volume_icon_name="audio-volume-low-symbolic" - elseif (new_value_num < 66) then - volume_icon_name="audio-volume-medium-symbolic" - else - volume_icon_name="audio-volume-high-symbolic" - end - end - self:get_children_by_id('icon')[1]:set_image(icon_dir .. volume_icon_name .. '.svg') - end, - mute = function(self) - self.is_muted = true - self:get_children_by_id('icon')[1]:set_image(icon_dir .. 'audio-volume-muted-symbolic.svg') - end, - unmute = function(self) - self.is_muted = false - end - } -end - -return widget \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/volume-widget/widgets/vertical-bar-widget.lua b/awesome/awesome-wm-widgets/volume-widget/widgets/vertical-bar-widget.lua deleted file mode 100644 index 6f32b50..0000000 --- a/awesome/awesome-wm-widgets/volume-widget/widgets/vertical-bar-widget.lua +++ /dev/null @@ -1,64 +0,0 @@ -local wibox = require("wibox") -local beautiful = require('beautiful') -local gears = require("gears") - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -local widget = {} - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local main_color = args.main_color or beautiful.fg_normal - local mute_color = args.mute_color or beautiful.fg_urgent - local bg_color = args.bg_color or '#ffffff11' - local width = args.width or 10 - local margins = args.height or 2 - local shape = args.shape or 'bar' - local with_icon = args.with_icon == true and true or false - - local bar = wibox.widget { - { - { - id = "icon", - image = ICON_DIR .. 'audio-volume-high-symbolic.svg', - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - visible = with_icon, - layout = wibox.container.place, - }, - { - { - id = 'bar', - max_value = 100, - forced_width = width, - forced_height = 5, - margins = { top = margins, bottom = margins }, - color = main_color, - background_color = bg_color, - shape = gears.shape[shape], - widget = wibox.widget.progressbar, - }, - forced_width = width, - direction = 'east', - layout = wibox.container.rotate, - }, - spacing = 4, - layout = wibox.layout.fixed.horizontal, - set_volume_level = function(self, new_value) - self:get_children_by_id('bar')[1]:set_value(tonumber(new_value)) - end, - mute = function(self) - self:get_children_by_id('bar')[1]:set_color(mute_color) - end, - unmute = function(self) - self:get_children_by_id('bar')[1]:set_color(main_color) - end - } - - return bar -end - -return widget diff --git a/awesome/awesome-wm-widgets/weather-widget/README.md b/awesome/awesome-wm-widgets/weather-widget/README.md deleted file mode 100644 index 3bf6228..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Weather widget - -

- GitHub issues by-label - - - Twitter URL - -

- -The widget showing current, hourly and daily weather forecast: - -

- screenshot -

- -The widget consists of three sections: - - current weather, including humidity, wind speed, UV index - - hourly forecast for the next 24 hours - - daily forecast for the next five days - -## Customization - -It is possible to customize widget by providing a table with all or some of the following config parameters: - -| Name | Default | Description | -|---|---|---| -| coordinates | Required | Table with two elements: latitude and longitude, e.g. `{46.204400, 6.143200}` | -| api_key | Required | Get it [here](https://openweathermap.org/appid) | -| font_name | `beautiful.font:gsub("%s%d+$", "")` | **Name** of the font to use e.g. 'Play' | -| both_units_widget | false | Show temperature in both units - '28°C (83°F) | -| units | metric | `metric` for celsius, `imperial` for fahrenheit | -| show_hourly_forecast | false | Show hourly forecase section | -| time_format_12h |false | 12 or 24 hour format (13:00 - default or 1pm) | -| show_daily_forecast | false | Show daily forecast section | -| icon_pack_name | weather-underground-icons | Name of the icon pack, could be `weather-underground-icon` or `VitalyGorbachev` or create your own, more details below | -| icons_extension | `.png` | File extension of icons in the pack | -| timeout | 120 | How often in seconds the widget refreshes | - -### Icons: - -The widget comes with two predefined icon packs: - - - weather-underground-icons taken from [here](https://github.com/manifestinteractive/weather-underground-icons) - - VitalyGorbachev taken from [here](https://www.flaticon.com/authors/vitaly-gorbachev) - -To add your custom icons, create a folder with the pack name under `/icons` and use the folder name in widget's config. There should be 18 icons, preferably 128x128 minimum. Icons should also respect the naming convention, please check widget's source. - -### Examples: - -#### Custom font, icons - -![example1](./example1.png) - -```lua -weather_curl_widget({ - api_key='', - coordinates = {45.5017, -73.5673}, - time_format_12h = true, - units = 'imperial', - both_units_widget = true, - font_name = 'Carter One', - icons = 'VitalyGorbachev', - icons_extension = '.svg', - show_hourly_forecast = true, - show_daily_forecast = true, -}), -``` - -#### Only current weather - -![example2](./example2.png) - -```lua -weather_curl_widget({ - api_key='', - coordinates = {45.5017, -73.5673}, -}), -``` - -## Installation - -1. Download json parser for lua from [github.com/rxi/json.lua](https://github.com/rxi/json.lua) and place it under **~/.config/awesome/** (don't forget to star a repo ): - - ```bash - wget -P ~/.config/awesome/ https://raw.githubusercontent.com/rxi/json.lua/master/json.lua - ``` - -1. Clone this repo under **~/.config/awesome/**: - - ```bash - git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/ - ``` - -1. Get Open Weather Map app id here: [openweathermap.org/appid](https://openweathermap.org/appid). - -1. Require weather widget at the beginning of **rc.lua**: - - ```lua - local weather_widget = require("awesome-wm-widgets.weather-widget.weather") - ``` - -1. Add widget to the tasklist: - - ```lua - s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - ... - --default - weather_widget({ - api_key='', - coordinates = {45.5017, -73.5673}, - }), - , - --customized - weather_curl_widget({ - api_key='', - coordinates = {45.5017, -73.5673}, - time_format_12h = true, - units = 'imperial', - both_units_widget = true, - font_name = 'Carter One', - icons = 'VitalyGorbachev', - icons_extension = '.svg', - show_hourly_forecast = true, - show_daily_forecast = true, - }), - ... - ``` - -## More screenshots - -Only negative temperature: - -![negative](./negative.png) - -Both positive and negative tempertature: - -![both](./both.png) - -## How it works - -TBW diff --git a/awesome/awesome-wm-widgets/weather-widget/both.png b/awesome/awesome-wm-widgets/weather-widget/both.png deleted file mode 100644 index 0947a37..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/both.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/example1.png b/awesome/awesome-wm-widgets/weather-widget/example1.png deleted file mode 100644 index 7074faa..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/example1.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/example2.png b/awesome/awesome-wm-widgets/weather-widget/example2.png deleted file mode 100644 index 857274b..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/example2.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/example_response.json b/awesome/awesome-wm-widgets/weather-widget/example_response.json deleted file mode 100644 index 2b90a6e..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/example_response.json +++ /dev/null @@ -1,1419 +0,0 @@ -{ - "lat": 45.5, - "lon": -73.57, - "timezone": "America/Toronto", - "timezone_offset": -14400, - "current": { - "dt": 1603155313, - "sunrise": 1603106181, - "sunset": 1603144896, - "temp": 8.91, - "feels_like": 7.97, - "pressure": 1025, - "humidity": 100, - "dew_point": 8.91, - "uvi": 2.37, - "clouds": 90, - "visibility": 4828, - "wind_speed": 1, - "wind_deg": 40, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10n" - }, - { - "id": 701, - "main": "Mist", - "description": "mist", - "icon": "50n" - } - ], - "rain": { - "1h": 0.65 - } - }, - "hourly": [ - { - "dt": 1603152000, - "temp": -8.91, - "feels_like": 7.95, - "pressure": 1025, - "humidity": 100, - "dew_point": 8.91, - "clouds": 90, - "visibility": 10000, - "wind_speed": 1.03, - "wind_deg": 32, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 0.4 - } - }, - { - "dt": 1603155600, - "temp": -9.16, - "feels_like": 7.7, - "pressure": 1025, - "humidity": 91, - "dew_point": 7.77, - "clouds": 95, - "visibility": 10000, - "wind_speed": 1.34, - "wind_deg": 67, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10n" - } - ], - "pop": 0.29, - "rain": { - "1h": 0.87 - } - }, - { - "dt": 1603159200, - "temp": -9.24, - "feels_like": 7.7, - "pressure": 1024, - "humidity": 88, - "dew_point": 7.36, - "clouds": 98, - "visibility": 10000, - "wind_speed": 1.32, - "wind_deg": 48, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10n" - } - ], - "pop": 0.59, - "rain": { - "1h": 0.42 - } - }, - { - "dt": 1603162800, - "temp": -9.18, - "feels_like": 6.91, - "pressure": 1023, - "humidity": 86, - "dew_point": 6.96, - "clouds": 99, - "visibility": 10000, - "wind_speed": 2.23, - "wind_deg": 42, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0.86 - }, - { - "dt": 1603166400, - "temp": -9.09, - "feels_like": 6.46, - "pressure": 1023, - "humidity": 88, - "dew_point": 7.21, - "clouds": 100, - "visibility": 10000, - "wind_speed": 2.83, - "wind_deg": 46, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10n" - } - ], - "pop": 0.94, - "rain": { - "1h": 0.6 - } - }, - { - "dt": 1603170000, - "temp": -8.96, - "feels_like": 6.43, - "pressure": 1022, - "humidity": 91, - "dew_point": 7.62, - "clouds": 100, - "visibility": 5405, - "wind_speed": 2.81, - "wind_deg": 18, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 1.89 - } - }, - { - "dt": 1603173600, - "temp": -8.84, - "feels_like": 6.29, - "pressure": 1021, - "humidity": 91, - "dew_point": 7.6, - "clouds": 100, - "visibility": 7599, - "wind_speed": 2.8, - "wind_deg": 35, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 2.07 - } - }, - { - "dt": 1603177200, - "temp": -8.92, - "feels_like": 6.34, - "pressure": 1021, - "humidity": 92, - "dew_point": 7.78, - "clouds": 100, - "visibility": 8594, - "wind_speed": 2.91, - "wind_deg": 44, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 1.19 - } - }, - { - "dt": 1603180800, - "temp": -9.08, - "feels_like": 7.18, - "pressure": 1020, - "humidity": 93, - "dew_point": 8.06, - "clouds": 100, - "visibility": 9347, - "wind_speed": 2.06, - "wind_deg": 37, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 1.02 - } - }, - { - "dt": 1603184400, - "temp": -8.98, - "feels_like": 6.28, - "pressure": 1019, - "humidity": 93, - "dew_point": 8, - "clouds": 100, - "visibility": 6164, - "wind_speed": 3.16, - "wind_deg": 354, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 1.89 - } - }, - { - "dt": 1603188000, - "temp": -8.69, - "feels_like": 5.78, - "pressure": 1019, - "humidity": 92, - "dew_point": 7.58, - "clouds": 100, - "visibility": 5143, - "wind_speed": 3.31, - "wind_deg": 29, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 2.6 - } - }, - { - "dt": 1603191600, - "temp": -8.6, - "feels_like": 6.08, - "pressure": 1019, - "humidity": 92, - "dew_point": 7.42, - "clouds": 100, - "visibility": 6072, - "wind_speed": 2.73, - "wind_deg": 29, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 2.3 - } - }, - { - "dt": 1603195200, - "temp": -8.56, - "feels_like": 6.68, - "pressure": 1019, - "humidity": 92, - "dew_point": 7.45, - "clouds": 100, - "visibility": 6697, - "wind_speed": 1.8, - "wind_deg": 16, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 2.58 - } - }, - { - "dt": 1603198800, - "temp": -8.74, - "feels_like": 6.88, - "pressure": 1020, - "humidity": 91, - "dew_point": 7.38, - "clouds": 100, - "visibility": 10000, - "wind_speed": 1.77, - "wind_deg": 319, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 1.06 - } - }, - { - "dt": 1603202400, - "temp": -8.93, - "feels_like": 7.32, - "pressure": 1020, - "humidity": 90, - "dew_point": 7.48, - "clouds": 100, - "visibility": 10000, - "wind_speed": 1.42, - "wind_deg": 291, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 0.95 - } - }, - { - "dt": 1603206000, - "temp": -9.07, - "feels_like": 6.75, - "pressure": 1021, - "humidity": 89, - "dew_point": 7.43, - "clouds": 100, - "visibility": 10000, - "wind_speed": 2.43, - "wind_deg": 276, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 0.31 - } - }, - { - "dt": 1603209600, - "temp": -9.31, - "feels_like": 6.58, - "pressure": 1022, - "humidity": 86, - "dew_point": 7.17, - "clouds": 100, - "visibility": 10000, - "wind_speed": 2.93, - "wind_deg": 262, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04d" - } - ], - "pop": 0.8 - }, - { - "dt": 1603213200, - "temp": -10.07, - "feels_like": 6.68, - "pressure": 1023, - "humidity": 80, - "dew_point": 6.78, - "clouds": 100, - "visibility": 10000, - "wind_speed": 3.77, - "wind_deg": 269, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04d" - } - ], - "pop": 0.8 - }, - { - "dt": 1603216800, - "temp": -11.87, - "feels_like": 7.99, - "pressure": 1023, - "humidity": 67, - "dew_point": 6.15, - "clouds": 99, - "visibility": 10000, - "wind_speed": 4.21, - "wind_deg": 265, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04d" - } - ], - "pop": 0.8 - }, - { - "dt": 1603220400, - "temp": -12.05, - "feels_like": 7.95, - "pressure": 1024, - "humidity": 64, - "dew_point": 5.63, - "clouds": 100, - "visibility": 10000, - "wind_speed": 4.38, - "wind_deg": 270, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04d" - } - ], - "pop": 0 - }, - { - "dt": 1603224000, - "temp": -11.74, - "feels_like": 7.54, - "pressure": 1025, - "humidity": 63, - "dew_point": 5.08, - "clouds": 100, - "visibility": 10000, - "wind_speed": 4.38, - "wind_deg": 276, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04d" - } - ], - "pop": 0 - }, - { - "dt": 1603227600, - "temp": -11.09, - "feels_like": 7.13, - "pressure": 1026, - "humidity": 62, - "dew_point": 4.24, - "clouds": 100, - "visibility": 10000, - "wind_speed": 3.79, - "wind_deg": 293, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04d" - } - ], - "pop": 0 - }, - { - "dt": 1603231200, - "temp": -10.13, - "feels_like": 6.51, - "pressure": 1027, - "humidity": 63, - "dew_point": 3.43, - "clouds": 100, - "visibility": 10000, - "wind_speed": 3.13, - "wind_deg": 318, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603234800, - "temp": -9.53, - "feels_like": 7.02, - "pressure": 1028, - "humidity": 63, - "dew_point": 3.02, - "clouds": 100, - "visibility": 10000, - "wind_speed": 1.4, - "wind_deg": 329, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603238400, - "temp": -9.2, - "feels_like": 7.3, - "pressure": 1028, - "humidity": 65, - "dew_point": 3.03, - "clouds": 100, - "visibility": 10000, - "wind_speed": 0.56, - "wind_deg": 52, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603242000, - "temp": -8.73, - "feels_like": 6.57, - "pressure": 1029, - "humidity": 68, - "dew_point": 3.28, - "clouds": 100, - "visibility": 10000, - "wind_speed": 0.98, - "wind_deg": 75, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603245600, - "temp": -8.12, - "feels_like": 5.55, - "pressure": 1029, - "humidity": 71, - "dew_point": 3.27, - "clouds": 89, - "visibility": 10000, - "wind_speed": 1.57, - "wind_deg": 68, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603249200, - "temp": -7.83, - "feels_like": 4.86, - "pressure": 1029, - "humidity": 71, - "dew_point": 3.05, - "clouds": 93, - "visibility": 10000, - "wind_speed": 2.07, - "wind_deg": 68, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603252800, - "temp": -7.49, - "feels_like": 4.21, - "pressure": 1029, - "humidity": 72, - "dew_point": 2.8, - "clouds": 94, - "visibility": 10000, - "wind_speed": 2.48, - "wind_deg": 66, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603256400, - "temp": -6.92, - "feels_like": 3.31, - "pressure": 1029, - "humidity": 73, - "dew_point": 2.47, - "clouds": 96, - "visibility": 10000, - "wind_speed": 2.87, - "wind_deg": 81, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603260000, - "temp": -6.49, - "feels_like": 2.48, - "pressure": 1029, - "humidity": 74, - "dew_point": 2.22, - "clouds": 96, - "visibility": 10000, - "wind_speed": 3.38, - "wind_deg": 78, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603263600, - "temp": -6.3, - "feels_like": 1.81, - "pressure": 1028, - "humidity": 71, - "dew_point": 1.55, - "clouds": 100, - "visibility": 10000, - "wind_speed": 3.89, - "wind_deg": 84, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603267200, - "temp": -6.22, - "feels_like": 1.39, - "pressure": 1027, - "humidity": 69, - "dew_point": 0.99, - "clouds": 98, - "visibility": 10000, - "wind_speed": 4.27, - "wind_deg": 74, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0 - }, - { - "dt": 1603270800, - "temp": -6.69, - "feels_like": 1.66, - "pressure": 1026, - "humidity": 65, - "dew_point": 0.79, - "clouds": 96, - "visibility": 10000, - "wind_speed": 4.47, - "wind_deg": 69, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0.05 - }, - { - "dt": 1603274400, - "temp": -6.53, - "feels_like": 1.74, - "pressure": 1024, - "humidity": 68, - "dew_point": 1.07, - "clouds": 97, - "visibility": 10000, - "wind_speed": 4.23, - "wind_deg": 65, - "weather": [ - { - "id": 804, - "main": "Clouds", - "description": "overcast clouds", - "icon": "04n" - } - ], - "pop": 0.28 - }, - { - "dt": 1603278000, - "temp": -6.41, - "feels_like": 1.87, - "pressure": 1023, - "humidity": 73, - "dew_point": 1.96, - "clouds": 97, - "visibility": 10000, - "wind_speed": 4.08, - "wind_deg": 73, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10n" - } - ], - "pop": 0.35, - "rain": { - "1h": 0.17 - } - }, - { - "dt": 1603281600, - "temp": -6.42, - "feels_like": 2.71, - "pressure": 1022, - "humidity": 79, - "dew_point": 3.21, - "clouds": 98, - "visibility": 9620, - "wind_speed": 3.16, - "wind_deg": 71, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "pop": 0.62, - "rain": { - "1h": 0.37 - } - }, - { - "dt": 1603285200, - "temp": -6.67, - "feels_like": 3.38, - "pressure": 1021, - "humidity": 86, - "dew_point": 4.59, - "clouds": 100, - "visibility": 10000, - "wind_speed": 2.95, - "wind_deg": 84, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10d" - } - ], - "pop": 0.9, - "rain": { - "1h": 1.08 - } - }, - { - "dt": 1603288800, - "temp": -8.55, - "feels_like": 5.61, - "pressure": 1019, - "humidity": 87, - "dew_point": 6.64, - "clouds": 100, - "visibility": 10000, - "wind_speed": 3.05, - "wind_deg": 135, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 0.23 - } - }, - { - "dt": 1603292400, - "temp": -10.85, - "feels_like": 8.09, - "pressure": 1018, - "humidity": 95, - "dew_point": 10.13, - "clouds": 100, - "visibility": 10000, - "wind_speed": 4.04, - "wind_deg": 150, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 0.31 - } - }, - { - "dt": 1603296000, - "temp": -13.37, - "feels_like": 10.29, - "pressure": 1017, - "humidity": 90, - "dew_point": 11.93, - "clouds": 100, - "visibility": 10000, - "wind_speed": 5.19, - "wind_deg": 170, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 0.32 - } - }, - { - "dt": 1603299600, - "temp": -13.92, - "feels_like": 11.34, - "pressure": 1015, - "humidity": 94, - "dew_point": 13.07, - "clouds": 100, - "visibility": 6450, - "wind_speed": 5.01, - "wind_deg": 177, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 3.08 - } - }, - { - "dt": 1603303200, - "temp": -14.85, - "feels_like": 12.78, - "pressure": 1014, - "humidity": 95, - "dew_point": 14.1, - "clouds": 100, - "visibility": 10000, - "wind_speed": 4.79, - "wind_deg": 183, - "weather": [ - { - "id": 502, - "main": "Rain", - "description": "heavy intensity rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 4.94 - } - }, - { - "dt": 1603306800, - "temp": -15.94, - "feels_like": 13.56, - "pressure": 1014, - "humidity": 93, - "dew_point": 14.96, - "clouds": 100, - "visibility": 7138, - "wind_speed": 5.61, - "wind_deg": 207, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 2.71 - } - }, - { - "dt": 1603310400, - "temp": -16.72, - "feels_like": 14.6, - "pressure": 1014, - "humidity": 93, - "dew_point": 15.66, - "clouds": 100, - "visibility": 10000, - "wind_speed": 5.64, - "wind_deg": 208, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 1.33 - } - }, - { - "dt": 1603314000, - "temp": -16.74, - "feels_like": 14.61, - "pressure": 1014, - "humidity": 94, - "dew_point": 15.81, - "clouds": 100, - "visibility": 10000, - "wind_speed": 5.75, - "wind_deg": 216, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "pop": 1, - "rain": { - "1h": 0.89 - } - }, - { - "dt": 1603317600, - "temp": -17.05, - "feels_like": 14.53, - "pressure": 1015, - "humidity": 92, - "dew_point": 15.83, - "clouds": 100, - "visibility": 10000, - "wind_speed": 6.3, - "wind_deg": 234, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 0.51 - } - }, - { - "dt": 1603321200, - "temp": -16.74, - "feels_like": 14.18, - "pressure": 1016, - "humidity": 87, - "dew_point": 14.65, - "clouds": 100, - "visibility": 10000, - "wind_speed": 5.74, - "wind_deg": 257, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10n" - } - ], - "pop": 1, - "rain": { - "1h": 0.22 - } - } - ], - "daily": [ - { - "dt": 1603123200, - "sunrise": 1603106181, - "sunset": 1603144896, - "temp": { - "day": 12, - "min": 8.91, - "max": 12.73, - "night": 9.05, - "eve": 9.72, - "morn": 12.73 - }, - "feels_like": { - "day": 9.92, - "night": 7.02, - "eve": 7.88, - "morn": 8.02 - }, - "pressure": 1025, - "humidity": 78, - "dew_point": 8.34, - "wind_speed": 2.41, - "wind_deg": 242, - "weather": [ - { - "id": 501, - "main": "Rain", - "description": "moderate rain", - "icon": "10d" - } - ], - "clouds": 100, - "pop": 1, - "rain": 8.77, - "uvi": 2.37 - }, - { - "dt": 1603209600, - "sunrise": 1603192663, - "sunset": 1603231195, - "temp": { - "day": 9.07, - "min": 7.83, - "max": 11.87, - "night": 7.83, - "eve": 11.09, - "morn": 8.98 - }, - "feels_like": { - "day": 6.75, - "night": 4.86, - "eve": 7.13, - "morn": 6.28 - }, - "pressure": 1021, - "humidity": 89, - "dew_point": 7.43, - "wind_speed": 2.43, - "wind_deg": 276, - "weather": [ - { - "id": 502, - "main": "Rain", - "description": "heavy intensity rain", - "icon": "10d" - } - ], - "clouds": 100, - "pop": 1, - "rain": 18.46, - "uvi": 2.3 - }, - { - "dt": 1603296000, - "sunrise": 1603279145, - "sunset": 1603317495, - "temp": { - "day": 10.85, - "min": 6.42, - "max": 16.74, - "night": 12.25, - "eve": 16.74, - "morn": 6.69 - }, - "feels_like": { - "day": 8.09, - "night": 8.59, - "eve": 14.61, - "morn": 1.66 - }, - "pressure": 1018, - "humidity": 95, - "dew_point": 10.13, - "wind_speed": 4.04, - "wind_deg": 150, - "weather": [ - { - "id": 502, - "main": "Rain", - "description": "heavy intensity rain", - "icon": "10d" - } - ], - "clouds": 100, - "pop": 1, - "rain": 16.19, - "uvi": 2.32 - }, - { - "dt": 1603382400, - "sunrise": 1603365627, - "sunset": 1603403795, - "temp": { - "day": 9.95, - "min": 7.29, - "max": 11.27, - "night": 7.29, - "eve": 11.01, - "morn": 9.44 - }, - "feels_like": { - "day": 5.45, - "night": 2.63, - "eve": 8.07, - "morn": 5.65 - }, - "pressure": 1027, - "humidity": 57, - "dew_point": 2.03, - "wind_speed": 4, - "wind_deg": 283, - "weather": [ - { - "id": 802, - "main": "Clouds", - "description": "scattered clouds", - "icon": "03d" - } - ], - "clouds": 27, - "pop": 0, - "uvi": 2.36 - }, - { - "dt": 1603468800, - "sunrise": 1603452109, - "sunset": 1603490097, - "temp": { - "day": 12.02, - "min": 6.62, - "max": 17.04, - "night": 15.91, - "eve": 17.04, - "morn": 7.09 - }, - "feels_like": { - "day": 8.48, - "night": 11.82, - "eve": 12.58, - "morn": 3.07 - }, - "pressure": 1022, - "humidity": 72, - "dew_point": 7.29, - "wind_speed": 4.1, - "wind_deg": 147, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "clouds": 99, - "pop": 0.29, - "rain": 0.22, - "uvi": 2.2 - }, - { - "dt": 1603555200, - "sunrise": 1603538592, - "sunset": 1603576400, - "temp": { - "day": 8.39, - "min": 6.83, - "max": 15.86, - "night": 6.83, - "eve": 9.56, - "morn": 12.99 - }, - "feels_like": { - "day": 3.79, - "night": 3.04, - "eve": 6.58, - "morn": 10.39 - }, - "pressure": 1022, - "humidity": 58, - "dew_point": 0.71, - "wind_speed": 3.87, - "wind_deg": 10, - "weather": [ - { - "id": 500, - "main": "Rain", - "description": "light rain", - "icon": "10d" - } - ], - "clouds": 72, - "pop": 0.9, - "rain": 2.54, - "uvi": 2.07 - }, - { - "dt": 1603641600, - "sunrise": 1603625075, - "sunset": 1603662705, - "temp": { - "day": 5.33, - "min": 3.23, - "max": 7.24, - "night": 4.97, - "eve": 6.59, - "morn": 3.97 - }, - "feels_like": { - "day": 1.26, - "night": 0.02, - "eve": 2.58, - "morn": -0.34 - }, - "pressure": 1025, - "humidity": 61, - "dew_point": -5.56, - "wind_speed": 2.67, - "wind_deg": 37, - "weather": [ - { - "id": 803, - "main": "Clouds", - "description": "broken clouds", - "icon": "04d" - } - ], - "clouds": 74, - "pop": 0.08, - "uvi": 2.25 - }, - { - "dt": 1603728000, - "sunrise": 1603711558, - "sunset": 1603749010, - "temp": { - "day": 3.7, - "min": 2.09, - "max": 3.88, - "night": 3.54, - "eve": 3.54, - "morn": 2.09 - }, - "feels_like": { - "day": -0.28, - "night": -0.76, - "eve": -0.86, - "morn": -2.81 - }, - "pressure": 1021, - "humidity": 90, - "dew_point": 2.33, - "wind_speed": 3.35, - "wind_deg": 32, - "weather": [ - { - "id": 502, - "main": "Rain", - "description": "heavy intensity rain", - "icon": "10d" - } - ], - "clouds": 100, - "pop": 1, - "rain": 12.43 - } - ] -} \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/broken-clouds-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/broken-clouds-night.svg deleted file mode 100644 index 8b7fc48..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/broken-clouds-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/broken-clouds.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/broken-clouds.svg deleted file mode 100644 index d42ea59..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/broken-clouds.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/clear-sky-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/clear-sky-night.svg deleted file mode 100644 index 44f096c..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/clear-sky-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/clear-sky.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/clear-sky.svg deleted file mode 100644 index dc82163..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/clear-sky.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/few-clouds-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/few-clouds-night.svg deleted file mode 100644 index 8b7fc48..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/few-clouds-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/few-clouds.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/few-clouds.svg deleted file mode 100644 index d42ea59..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/few-clouds.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/mist-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/mist-night.svg deleted file mode 100644 index 960b07d..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/mist-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/mist.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/mist.svg deleted file mode 100644 index 770f8d7..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/mist.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/rain-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/rain-night.svg deleted file mode 100644 index 11ecf00..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/rain-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/rain.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/rain.svg deleted file mode 100644 index 11ecf00..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/rain.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/scattered-clouds-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/scattered-clouds-night.svg deleted file mode 100644 index 8b7fc48..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/scattered-clouds-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/scattered-clouds.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/scattered-clouds.svg deleted file mode 100644 index d42ea59..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/scattered-clouds.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/shower-rain-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/shower-rain-night.svg deleted file mode 100644 index 4d1897c..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/shower-rain-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/shower-rain.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/shower-rain.svg deleted file mode 100644 index 4d1897c..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/shower-rain.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/snow-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/snow-night.svg deleted file mode 100644 index bee891e..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/snow-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/snow.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/snow.svg deleted file mode 100644 index e2ea140..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/snow.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/thunderstorm-night.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/thunderstorm-night.svg deleted file mode 100644 index 1813197..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/thunderstorm-night.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/thunderstorm.svg b/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/thunderstorm.svg deleted file mode 100644 index 44a733c..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/icons/VitalyGorbachev/thunderstorm.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/broken-clouds-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/broken-clouds-night.png deleted file mode 100644 index 061d1cd..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/broken-clouds-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/broken-clouds.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/broken-clouds.png deleted file mode 100755 index 5967d92..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/broken-clouds.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/clear-sky-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/clear-sky-night.png deleted file mode 100644 index cc40d0f..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/clear-sky-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/clear-sky.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/clear-sky.png deleted file mode 100755 index acf8e5c..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/clear-sky.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/few-clouds-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/few-clouds-night.png deleted file mode 100644 index 9c34fab..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/few-clouds-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/few-clouds.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/few-clouds.png deleted file mode 100755 index 7580fc5..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/few-clouds.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/mist-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/mist-night.png deleted file mode 100755 index 102142a..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/mist-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/mist.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/mist.png deleted file mode 100755 index 102142a..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/mist.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/rain-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/rain-night.png deleted file mode 100755 index 49f0903..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/rain-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/rain.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/rain.png deleted file mode 100755 index 49f0903..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/rain.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/scattered-clouds-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/scattered-clouds-night.png deleted file mode 100755 index 63cb1b2..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/scattered-clouds-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/scattered-clouds.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/scattered-clouds.png deleted file mode 100755 index 63cb1b2..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/scattered-clouds.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/shower-rain-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/shower-rain-night.png deleted file mode 100755 index 49f0903..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/shower-rain-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/shower-rain.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/shower-rain.png deleted file mode 100755 index 49f0903..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/shower-rain.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/snow-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/snow-night.png deleted file mode 100755 index 0a7f006..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/snow-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/snow.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/snow.png deleted file mode 100755 index 0a7f006..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/snow.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/thunderstorm-night.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/thunderstorm-night.png deleted file mode 100755 index 2102104..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/thunderstorm-night.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/thunderstorm.png b/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/thunderstorm.png deleted file mode 100755 index 2102104..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/icons/weather-underground-icons/thunderstorm.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/locale/de.lua b/awesome/awesome-wm-widgets/weather-widget/locale/de.lua deleted file mode 100644 index 2a9236a..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/locale/de.lua +++ /dev/null @@ -1,13 +0,0 @@ -local de = { - warning_title = "Wetter Widget", - parameter_warning = "Folgende benötigte Parameter fehlen: ", - directions = { - "N", "NNO", "NO", "ONO", "O", "OSO", "SO", "SSO", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N" - }, - feels_like = "Gefühlt: ", - wind = "Wind: ", - humidity = "Luftfeuchtigkeit: ", - uv = "UV-Index: " -} - -return de diff --git a/awesome/awesome-wm-widgets/weather-widget/locale/en.lua b/awesome/awesome-wm-widgets/weather-widget/locale/en.lua deleted file mode 100644 index 377dc6f..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/locale/en.lua +++ /dev/null @@ -1,14 +0,0 @@ -local en = { - warning_title = "Weather Widget", - parameter_warning = "Required parameters are not set: ", - directions = { - "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", - "WSW", "W", "WNW", "NW", "NNW", "N" - }, - feels_like = "Feels like ", - wind = "Wind: ", - humidity = "Humidity: ", - uv = "UV: " -} - -return en diff --git a/awesome/awesome-wm-widgets/weather-widget/locale/fr.lua b/awesome/awesome-wm-widgets/weather-widget/locale/fr.lua deleted file mode 100644 index de50814..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/locale/fr.lua +++ /dev/null @@ -1,14 +0,0 @@ -local fr = { - warning_title = "Widget Météo", - parameter_warning = "Les paramètres suivants sont obligatoires : ", - directions = { - "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSO", "SO", - "OSO", "O", "ONO", "NO", "NNO", "N" - }, - feels_like = "ressentie à ", - wind = "Vent : ", - humidity = "Humidité : ", - uv = "Indice UV : " -} - -return fr diff --git a/awesome/awesome-wm-widgets/weather-widget/locale/pt.lua b/awesome/awesome-wm-widgets/weather-widget/locale/pt.lua deleted file mode 100644 index e7f4012..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/locale/pt.lua +++ /dev/null @@ -1,14 +0,0 @@ -local pt = { - warning_title = "Widget do tempo", - parameter_warning = "Parâmetros necessários não definidos: ", - directions = { - "N", "NNE", "NE", "ENE", "L", "ESE", "SE", "SSE", "S", "SSO", "SO", - "OSO", "O", "ONO", "NO", "NNO", "N" - }, - feels_like = "Sensação de ", - wind = "Vento: ", - humidity = "Umidade: ", - uv = "UV: " -} - -return pt diff --git a/awesome/awesome-wm-widgets/weather-widget/negative.png b/awesome/awesome-wm-widgets/weather-widget/negative.png deleted file mode 100644 index afcf567..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/negative.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/weather-widget.png b/awesome/awesome-wm-widgets/weather-widget/weather-widget.png deleted file mode 100644 index c7fc37e..0000000 Binary files a/awesome/awesome-wm-widgets/weather-widget/weather-widget.png and /dev/null differ diff --git a/awesome/awesome-wm-widgets/weather-widget/weather.lua b/awesome/awesome-wm-widgets/weather-widget/weather.lua deleted file mode 100644 index 3ec1c3f..0000000 --- a/awesome/awesome-wm-widgets/weather-widget/weather.lua +++ /dev/null @@ -1,575 +0,0 @@ -------------------------------------------------- --- Weather Widget based on the OpenWeatherMap --- https://openweathermap.org/ --- --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- -local awful = require("awful") -local watch = require("awful.widget.watch") -local json = require("json") -local naughty = require("naughty") -local wibox = require("wibox") -local gears = require("gears") -local beautiful = require("beautiful") - -local HOME_DIR = os.getenv("HOME") -local WIDGET_DIR = HOME_DIR .. '/.config/awesome/awesome-wm-widgets/weather-widget' -local GET_FORECAST_CMD = [[bash -c "curl -s --show-error -X GET '%s'"]] - -local SYS_LANG = os.getenv("LANG"):sub(1, 2) -if SYS_LANG == "C" or SYS_LANG == "C." then - -- C-locale is a common fallback for simple English - SYS_LANG = "en" -end --- default language is ENglish -local LANG = gears.filesystem.file_readable(WIDGET_DIR .. "/" .. "locale/" .. - SYS_LANG .. ".lua") and SYS_LANG or "en" -local LCLE = require("awesome-wm-widgets.weather-widget.locale." .. LANG) - - -local function show_warning(message) - naughty.notify { - preset = naughty.config.presets.critical, - title = LCLE.warning_title, - text = message - } -end - -if SYS_LANG ~= LANG then - show_warning("Your language is not supported yet. Language set to English") -end - -local weather_widget = {} -local warning_shown = false -local tooltip = awful.tooltip { - mode = 'outside', - preferred_positions = {'bottom'} -} - -local weather_popup = awful.popup { - ontop = true, - visible = false, - shape = gears.shape.rounded_rect, - border_width = 1, - border_color = beautiful.bg_focus, - maximum_width = 400, - offset = {y = 5}, - hide_on_right_click = true, - widget = {} -} - ---- Maps openWeatherMap icon name to file name w/o extension -local icon_map = { - ["01d"] = "clear-sky", - ["02d"] = "few-clouds", - ["03d"] = "scattered-clouds", - ["04d"] = "broken-clouds", - ["09d"] = "shower-rain", - ["10d"] = "rain", - ["11d"] = "thunderstorm", - ["13d"] = "snow", - ["50d"] = "mist", - ["01n"] = "clear-sky-night", - ["02n"] = "few-clouds-night", - ["03n"] = "scattered-clouds-night", - ["04n"] = "broken-clouds-night", - ["09n"] = "shower-rain-night", - ["10n"] = "rain-night", - ["11n"] = "thunderstorm-night", - ["13n"] = "snow-night", - ["50n"] = "mist-night" -} - ---- Return wind direction as a string -local function to_direction(degrees) - -- Ref: https://www.campbellsci.eu/blog/convert-wind-directions - if degrees == nil then return "Unknown dir" end - local directions = LCLE.directions - return directions[math.floor((degrees % 360) / 22.5) + 1] -end - ---- Convert degrees Celsius to Fahrenheit -local function celsius_to_fahrenheit(c) return c * 9 / 5 + 32 end - --- Convert degrees Fahrenheit to Celsius -local function fahrenheit_to_celsius(f) return (f - 32) * 5 / 9 end - -local function gen_temperature_str(temp, fmt_str, show_other_units, units) - local temp_str = string.format(fmt_str, temp) - local s = temp_str .. '°' .. (units == 'metric' and 'C' or 'F') - - if (show_other_units) then - local temp_conv, units_conv - if (units == 'metric') then - temp_conv = celsius_to_fahrenheit(temp) - units_conv = 'F' - else - temp_conv = fahrenheit_to_celsius(temp) - units_conv = 'C' - end - - local temp_conv_str = string.format(fmt_str, temp_conv) - s = s .. ' ' .. '(' .. temp_conv_str .. '°' .. units_conv .. ')' - end - return s -end - -local function uvi_index_color(uvi) - local color - if uvi >= 0 and uvi < 3 then color = '#A3BE8C' - elseif uvi >= 3 and uvi < 6 then color = '#EBCB8B' - elseif uvi >= 6 and uvi < 8 then color = '#D08770' - elseif uvi >= 8 and uvi < 11 then color = '#BF616A' - elseif uvi >= 11 then color = '#B48EAD' - end - - return '' .. uvi .. '' -end - -local function worker(user_args) - - local args = user_args or {} - - --- Validate required parameters - if args.coordinates == nil or args.api_key == nil then - show_warning(LCLE.parameter_warning .. - (args.coordinates == nil and 'coordinates' or '') .. - (args.api_key == nil and ', api_key ' or '')) - return - end - - local coordinates = args.coordinates - local api_key = args.api_key - local font_name = args.font_name or beautiful.font:gsub("%s%d+$", "") - local units = args.units or 'metric' - local time_format_12h = args.time_format_12h - local both_units_widget = args.both_units_widget or false - local show_hourly_forecast = args.show_hourly_forecast - local show_daily_forecast = args.show_daily_forecast - local icon_pack_name = args.icons or 'weather-underground-icons' - local icons_extension = args.icons_extension or '.png' - local timeout = args.timeout or 120 - - local ICONS_DIR = WIDGET_DIR .. '/icons/' .. icon_pack_name .. '/' - local owm_one_cal_api = - ('https://api.openweathermap.org/data/2.5/onecall' .. - '?lat=' .. coordinates[1] .. '&lon=' .. coordinates[2] .. '&appid=' .. api_key .. - '&units=' .. units .. '&exclude=minutely' .. - (show_hourly_forecast == false and ',hourly' or '') .. - (show_daily_forecast == false and ',daily' or '') .. - '&lang=' .. LANG) - - weather_widget = wibox.widget { - { - { - { - { - id = 'icon', - resize = true, - widget = wibox.widget.imagebox - }, - valign = 'center', - widget = wibox.container.place, - }, - { - id = 'txt', - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.horizontal, - }, - left = 4, - right = 4, - layout = wibox.container.margin - }, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, 4) - end, - widget = wibox.container.background, - set_image = function(self, path) - self:get_children_by_id('icon')[1].image = path - end, - set_text = function(self, text) - self:get_children_by_id('txt')[1].text = text - end, - is_ok = function(self, is_ok) - if is_ok then - self:get_children_by_id('icon')[1]:set_opacity(1) - self:get_children_by_id('icon')[1]:emit_signal('widget:redraw_needed') - else - self:get_children_by_id('icon')[1]:set_opacity(0.2) - self:get_children_by_id('icon')[1]:emit_signal('widget:redraw_needed') - end - end - } - - local current_weather_widget = wibox.widget { - { - { - { - id = 'icon', - resize = true, - forced_width = 128, - forced_height = 128, - widget = wibox.widget.imagebox - }, - align = 'center', - widget = wibox.container.place - }, - { - id = 'description', - font = font_name .. ' 10', - align = 'center', - widget = wibox.widget.textbox - }, - forced_width = 128, - layout = wibox.layout.align.vertical - }, - { - { - { - id = 'temp', - font = font_name .. ' 36', - widget = wibox.widget.textbox - }, - { - id = 'feels_like_temp', - align = 'center', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.vertical - }, - { - { - id = 'wind', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }, - { - id = 'humidity', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }, - { - id = 'uv', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }, - expand = 'inside', - layout = wibox.layout.align.vertical - }, - spacing = 16, - forced_width = 150, - layout = wibox.layout.fixed.vertical - }, - forced_width = 300, - layout = wibox.layout.flex.horizontal, - update = function(self, weather) - self:get_children_by_id('icon')[1]:set_image( - ICONS_DIR .. icon_map[weather.weather[1].icon] .. icons_extension) - self:get_children_by_id('temp')[1]:set_text(gen_temperature_str(weather.temp, '%.0f', false, units)) - self:get_children_by_id('feels_like_temp')[1]:set_text( - LCLE.feels_like .. gen_temperature_str(weather.feels_like, '%.0f', false, units)) - self:get_children_by_id('description')[1]:set_text(weather.weather[1].description) - self:get_children_by_id('wind')[1]:set_markup( - LCLE.wind .. '' .. weather.wind_speed .. 'm/s (' .. to_direction(weather.wind_deg) .. ')') - self:get_children_by_id('humidity')[1]:set_markup(LCLE.humidity .. '' .. weather.humidity .. '%') - self:get_children_by_id('uv')[1]:set_markup(LCLE.uv .. uvi_index_color(weather.uvi)) - end - } - - - local daily_forecast_widget = { - forced_width = 300, - layout = wibox.layout.flex.horizontal, - update = function(self, forecast, timezone_offset) - local count = #self - for i = 0, count do self[i]=nil end - for i, day in ipairs(forecast) do - if i > 5 then break end - local day_forecast = wibox.widget { - { - text = os.date('%a', tonumber(day.dt) + tonumber(timezone_offset)), - align = 'center', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }, - { - { - { - image = ICONS_DIR .. icon_map[day.weather[1].icon] .. icons_extension, - resize = true, - forced_width = 48, - forced_height = 48, - widget = wibox.widget.imagebox - }, - align = 'center', - layout = wibox.container.place - }, - { - text = day.weather[1].description, - font = font_name .. ' 8', - align = 'center', - forced_height = 50, - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.vertical - }, - { - { - text = gen_temperature_str(day.temp.day, '%.0f', false, units), - align = 'center', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }, - { - text = gen_temperature_str(day.temp.night, '%.0f', false, units), - align = 'center', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.vertical - }, - spacing = 8, - layout = wibox.layout.fixed.vertical - } - table.insert(self, day_forecast) - end - end - } - - local hourly_forecast_graph = wibox.widget { - step_width = 12, - color = '#EBCB8B', - background_color = beautiful.bg_normal, - forced_height = 100, - forced_width = 300, - widget = wibox.widget.graph, - set_max_value = function(self, new_max_value) - self.max_value = new_max_value - end, - set_min_value = function(self, new_min_value) - self.min_value = new_min_value - end - } - local hourly_forecast_negative_graph = wibox.widget { - step_width = 12, - color = '#5E81AC', - background_color = beautiful.bg_normal, - forced_height = 100, - forced_width = 300, - widget = wibox.widget.graph, - set_max_value = function(self, new_max_value) - self.max_value = new_max_value - end, - set_min_value = function(self, new_min_value) - self.min_value = new_min_value - end - } - - local hourly_forecast_widget = { - layout = wibox.layout.fixed.vertical, - update = function(self, hourly) - local hours_below = { - id = 'hours', - forced_width = 300, - layout = wibox.layout.flex.horizontal - } - local temp_below = { - id = 'temp', - forced_width = 300, - layout = wibox.layout.flex.horizontal - } - - local max_temp = -1000 - local min_temp = 1000 - local values = {} - for i, hour in ipairs(hourly) do - if i > 25 then break end - values[i] = hour.temp - if max_temp < hour.temp then max_temp = hour.temp end - if min_temp > hour.temp then min_temp = hour.temp end - if (i - 1) % 5 == 0 then - table.insert(hours_below, wibox.widget { - text = os.date(time_format_12h and '%I%p' or '%H:00', tonumber(hour.dt)), - align = 'center', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }) - table.insert(temp_below, wibox.widget { - markup = '' - .. string.format('%.0f', hour.temp) .. '°' .. '', - align = 'center', - font = font_name .. ' 9', - widget = wibox.widget.textbox - }) - end - end - - hourly_forecast_graph:set_max_value(math.max(max_temp, math.abs(min_temp))) - hourly_forecast_graph:set_min_value(min_temp > 0 and min_temp * 0.7 or 0) -- move graph a bit up - - hourly_forecast_negative_graph:set_max_value(math.abs(min_temp)) - hourly_forecast_negative_graph:set_min_value(max_temp < 0 and math.abs(max_temp) * 0.7 or 0) - - for _, value in ipairs(values) do - if value >= 0 then - hourly_forecast_graph:add_value(value) - hourly_forecast_negative_graph:add_value(0) - else - hourly_forecast_graph:add_value(0) - hourly_forecast_negative_graph:add_value(math.abs(value)) - end - end - - local count = #self - for i = 0, count do self[i]=nil end - - -- all temperatures are positive - if min_temp > 0 then - table.insert(self, wibox.widget{ - { - hourly_forecast_graph, - reflection = {horizontal = true}, - widget = wibox.container.mirror - }, - { - temp_below, - valign = 'bottom', - widget = wibox.container.place - }, - id = 'graph', - layout = wibox.layout.stack - }) - table.insert(self, hours_below) - - -- all temperatures are negative - elseif max_temp < 0 then - table.insert(self, hours_below) - table.insert(self, wibox.widget{ - { - hourly_forecast_negative_graph, - reflection = {horizontal = true, vertical = true}, - widget = wibox.container.mirror - }, - { - temp_below, - valign = 'top', - widget = wibox.container.place - }, - id = 'graph', - layout = wibox.layout.stack - }) - - -- there are both negative and positive temperatures - else - table.insert(self, wibox.widget{ - { - hourly_forecast_graph, - reflection = {horizontal = true}, - widget = wibox.container.mirror - }, - { - temp_below, - valign = 'bottom', - widget = wibox.container.place - }, - id = 'graph', - layout = wibox.layout.stack - }) - table.insert(self, wibox.widget{ - { - hourly_forecast_negative_graph, - reflection = {horizontal = true, vertical = true}, - widget = wibox.container.mirror - }, - { - hours_below, - valign = 'top', - widget = wibox.container.place - }, - id = 'graph', - layout = wibox.layout.stack - }) - end - end - } - - local function update_widget(widget, stdout, stderr) - if stderr ~= '' then - if not warning_shown then - if (stderr ~= 'curl: (52) Empty reply from server' - and stderr ~= 'curl: (28) Failed to connect to api.openweathermap.org port 443: Connection timed out' - and stderr:find('^curl: %(18%) transfer closed with %d+ bytes remaining to read$') ~= nil - ) then - show_warning(stderr) - end - warning_shown = true - widget:is_ok(false) - tooltip:add_to_object(widget) - - widget:connect_signal('mouse::enter', function() tooltip.text = stderr end) - end - return - end - - warning_shown = false - tooltip:remove_from_object(widget) - widget:is_ok(true) - - local result = json.decode(stdout) - - widget:set_image(ICONS_DIR .. icon_map[result.current.weather[1].icon] .. icons_extension) - widget:set_text(gen_temperature_str(result.current.temp, '%.0f', both_units_widget, units)) - - current_weather_widget:update(result.current) - - local final_widget = { - current_weather_widget, - spacing = 16, - layout = wibox.layout.fixed.vertical - } - - if show_hourly_forecast then - hourly_forecast_widget:update(result.hourly) - table.insert(final_widget, hourly_forecast_widget) - end - - if show_daily_forecast then - daily_forecast_widget:update(result.daily, result.timezone_offset) - table.insert(final_widget, daily_forecast_widget) - end - - weather_popup:setup({ - { - final_widget, - margins = 10, - widget = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - }) - end - - weather_widget:buttons(gears.table.join(awful.button({}, 1, function() - if weather_popup.visible then - weather_widget:set_bg('#00000000') - weather_popup.visible = not weather_popup.visible - else - weather_widget:set_bg(beautiful.bg_focus) - weather_popup:move_next_to(mouse.current_widget_geometry) - end - end))) - - watch( - string.format(GET_FORECAST_CMD, owm_one_cal_api), - timeout, -- API limit is 1k req/day; day has 1440 min; every 2 min is good - update_widget, weather_widget - ) - - return weather_widget -end - -return setmetatable(weather_widget, {__call = function(_, ...) return worker(...) end}) diff --git a/awesome/binding/clientkeys.lua b/awesome/binding/clientkeys.lua index f15a14f..b4fbec2 100644 --- a/awesome/binding/clientkeys.lua +++ b/awesome/binding/clientkeys.lua @@ -7,6 +7,8 @@ local awful = require("awful") local _M = {} local modkey = RC.vars.modkey +local cyclefocus = require('cyclefocus') + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- function _M.get() @@ -51,7 +53,11 @@ function _M.get() c.maximized_horizontal = not c.maximized_horizontal c:raise() end , - {description = "(un)maximize horizontally", group = "client"}) + {description = "(un)maximize horizontally", group = "client"}), + + cyclefocus.key({modkey, }, "Tab", { + cycle_filters = { cyclefocus.filters.same_screen, cyclefocus.filters.common_tag }}, + {description = "cycle through clients from the same screen and tag", group = "client"}) ) return clientkeys diff --git a/awesome/binding/globalkeys.lua b/awesome/binding/globalkeys.lua index 3df49dc..501d20f 100644 --- a/awesome/binding/globalkeys.lua +++ b/awesome/binding/globalkeys.lua @@ -12,8 +12,6 @@ local terminal = RC.vars.terminal local _M = {} --- reading --- https://awesomewm.org/wiki/Global_Keybindings -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- @@ -58,14 +56,14 @@ function _M.get() {description = "focus the previous screen", group = "screen"}), awful.key({ modkey, }, "u", awful.client.urgent.jumpto, {description = "jump to urgent client", group = "client"}), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end - end, - {description = "go back", group = "client"}), + -- awful.key({ modkey, }, "Tab", + -- function () + -- awful.client.focus.history.previous() + -- if client.focus then + -- client.focus:raise() + -- end + -- end, + -- {description = "go back", group = "client"}), -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Standard program @@ -90,10 +88,6 @@ function _M.get() {description = "increase the number of columns", group = "layout"}), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, {description = "decrease the number of columns", group = "layout"}), - awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, - {description = "select next", group = "layout"}), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, - {description = "select previous", group = "layout"}), awful.key({ modkey, "Control" }, "n", function () diff --git a/awesome/deco/statusbar.lua b/awesome/deco/statusbar.lua index 59a80b4..e19374e 100644 --- a/awesome/deco/statusbar.lua +++ b/awesome/deco/statusbar.lua @@ -73,8 +73,7 @@ awful.screen.connect_for_each_screen(function(s) s.mytasklist, -- Middle widget { -- Right widgets layout = wibox.layout.fixed.horizontal, --- mykeyboardlayout, --- wibox.widget.systray(), + wibox.widget.systray(), volume_widget{ widget_type = 'arc', tooltip = 'true' diff --git a/awesome/main/menu.lua b/awesome/main/menu.lua index b53a0e1..8a4af52 100644 --- a/awesome/main/menu.lua +++ b/awesome/main/menu.lua @@ -13,7 +13,6 @@ local _M = {} -- module -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- This is used later as the default terminal and editor to run. --- local terminal = "xfce4-terminal" local terminal = RC.vars.terminal -- Variable definitions @@ -23,6 +22,13 @@ local editor_cmd = terminal .. " -e " .. editor -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- this is an attempt to make it harder to quit awesome accidentally. +-- my hand likes to twitch sometimes so i've accidentally quit on more +-- than one occasion +M.quitmenu = { + { "i mean it!", function() awesome.quit() end } +} + M.awesome = { { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) @@ -31,7 +37,7 @@ M.awesome = { { "edit config", editor_cmd .. " " .. awesome.conffile }, { "terminal", terminal }, { "restart", awesome.restart }, - { "quit", function() awesome.quit() end } + { "quit", M.quitmenu } } M.network = { @@ -53,23 +59,37 @@ M.develop = { M.emulators = { { "citra", "flatpak run org.citra_emu.citra" }, { "dolphin", "flatpak run org.DolphinEmu.dolphin-emu" }, - { "yuzu", "flatpak run org.yuzu_emu.yuzu"} + { "yuzu", "flatpak run org.yuzu_emu.yuzu" }, + { "duckstation", "flatpak run org.duckstation.DuckStation" }, + { "PPSSPP", "flatpak run org.ppsspp.PPSSPP" } +} + +M.vtgstry = { + { "latest", "mono /home/nu/ApplicationData/vintagestory/Vintagestory.exe" }, + { "flatpak", "flatpak run at.vintagestory.VintageStory" } } M.games = { { "emulators", M.emulators }, - { "vintage story", "flatpak run at.vintagestory.VintageStory" }, - { "osu!", "flatpak run sh.ppy.osu" } + { "vintage story", M.vtgstry }, + { "team fortress 2", "steam steam://rungameid/440" }, + { "ballisticNG", "steam steam://rungameid/473770" }, + { "them's fightin' herds", "steam steam://rungameid/574980"}, + { "osu!", "flatpak run sh.ppy.osu" }, + { "minecraft", "flatpak run org.prismlauncher.PrismLauncher" }, } M.utils = { { "catfish", "catfish" }, + { "anki", "flatpak run net.ankiweb.Anki" }, { "text pieces", "flatpak run com.github.liferooter.textpieces" }, + { "menulibre", "menulibre" }, { "flatseal", "flatpak run com.github.tchx84.Flatseal" }, { "piper", "piper" } } M.media = { + { "hydrus", "flatpak run io.github.hydrusnetwork.hydrus" }, { "youtube", "/usr/lib64/chromium-browser/chromium-browser.sh --profile-directory=Default --app-id=agimnkijcaahngcdmfeangaknmldooml"}, { "spotify", "flatpak run com.spotify.Client" } } @@ -86,8 +106,7 @@ function _M.get() { "media", M.media }, { "dev", M.develop }, { "games", M.games }, - { "utils", M.utils }, --- { "maim (select)", "maim -s $(HOME)$(date +%s)" }, + { "utils", M.utils } } return menu_items diff --git a/awesome/main/rules.lua b/awesome/main/rules.lua index 9a039a4..1f242f3 100644 --- a/awesome/main/rules.lua +++ b/awesome/main/rules.lua @@ -30,26 +30,20 @@ function _M.get(clientkeys, clientbuttons) -- Floating clients. { rule_any = { instance = { - "DTA", -- Firefox addon DownThemAll. "copyq", -- Includes session name in class. "pinentry", }, class = { - "Arandr", - "Blueman-manager", - "Gpick", - "Kruler", "MessageWin", -- kalarm. - "Sxiv", "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. - "Wpa_gui", - "veromix", - "xtightvncviewer"}, + }, -- Note that the name property shown in xprop might be set slightly after creation of the client -- and the name shown there might not match defined rules here. name = { "Event Tester", -- xev. + "Steam", + "infinitefusion", -- Pokémon Infinite Fusion }, role = { "AlarmWindow", -- Thunderbird's calendar. diff --git a/awesome/main/startup.lua b/awesome/main/startup.lua index a6f328c..666521b 100644 --- a/awesome/main/startup.lua +++ b/awesome/main/startup.lua @@ -1,5 +1,3 @@ local awful = require("awful") -local os = require("os") -awful.spawn.single_instance("picom --config /home/nu/.config/picom/picom.conf") --- awful.spawn.once("redshift -O 3800") +awful.spawn.single_instance("picom --config /home/nu/.config/picom/picom.conf") \ No newline at end of file diff --git a/awesome/main/user-variables.lua b/awesome/main/user-variables.lua index c2d0cbf..2f2c592 100644 --- a/awesome/main/user-variables.lua +++ b/awesome/main/user-variables.lua @@ -6,19 +6,13 @@ local home = os.getenv("HOME") local _M = { -- This is used later as the default terminal and editor to run. - -- terminal = "xterm", terminal = "alacritty", -- Default modkey. - -- Usually, Mod4 is the key with a logo between Control and Alt. - -- If you do not like this or do not have such a key, - -- I suggest you to remap Mod4 to another key using xmodmap or other tools. - -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4", -- user defined wallpaper wallpaper = "/usr/share/backgrounds/custom/space_station.jpg", - --wallpaper = home .. "/Pictures/your-wallpaper-here.jpg", } return _M