From 5dba69affa21df64bb0197ed67bbd487c003a150 Mon Sep 17 00:00:00 2001 From: Andrew Naguib Date: Wed, 1 May 2019 22:43:46 +0200 Subject: [PATCH] Update README.rst fixing old line configuration for the `theme-personal.lua` and adding information for how to customize the weather city and how to get the correct city id from the `openweathermap` api used by `lain`. --- README.rst | 26 +++++++++++++++++++++++--- lain | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 1051865..ae7fe1a 100644 --- a/README.rst +++ b/README.rst @@ -127,12 +127,12 @@ Then, set the variable ``chosen_theme`` in ``rc.lua`` to your preferred theme, d To customize a theme, head over to ``themes/$chosen_theme/theme.lua``. -Otherwise, if you want to be synced with upstream, modify ``theme_path`` variable in ``rc.lua`` like this: +Otherwise, if you want to be synced with upstream, modify the theme path in ``rc.lua`` like this: .. code-block:: diff - -local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme) - +local theme_path = string.format("%s/.config/awesome/themes/%s/theme-personal.lua", os.getenv("HOME"), chosen_theme) + -beautiful.init(string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)) + +beautiful.init(string.format("%s/.config/awesome/themes/%s/theme-personal.lua", os.getenv("HOME"), chosen_theme)) then, copy ``theme.lua`` to ``theme-personal.lua`` and do your customizations there. @@ -149,6 +149,25 @@ Every theme has a colorscheme_. Blackburn and Dremora use Icons_, Vertex uses FontAwesome_: be sure to have bitmaps enabled if running under Debian or Ubuntu_. +You can also configure the ``city_id`` in the following snippet in ``/.config/awesome/themes/<>/theme.lua`` to get the correct weather information (we suggest doing it in your ``theme-personal.lua``): + +.. code-block:: + + -- Weather + local weathericon = wibox.widget.imagebox(theme.widget_weather) + theme.weather = lain.widget.weather({ + city_id = 2643743, -- placeholder (London) + notification_preset = { font = "xos4 Terminus 10", fg = theme.fg_normal }, + weather_na_markup = markup.fontfg(theme.font, "#eca4c4", "N/A "), + settings = function() + descr = weather_now["weather"][1]["description"]:lower() + units = math.floor(weather_now["main"]["temp"]) + widget:set_markup(markup.fontfg(theme.font, "#eca4c4", descr .. " @ " .. units .. "°C ")) + end + }) + +You can find your ``city_id`` in city.list.json.gz_ after you extract it. + Additional default software used: :: unclutter firefox scrot mpd mpc dmenu xsel slock @@ -173,3 +192,4 @@ Additional default software used: :: .. _Ubuntu: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts .. _FontAwesome: https://github.com/FortAwesome/Font-Awesome .. _branches: https://github.com/lcpz/awesome-copycats/branches +.. _city.list.json.gz: http://bulk.openweathermap.org/sample/city.list.json.gz diff --git a/lain b/lain index 85db468..724c7b9 160000 --- a/lain +++ b/lain @@ -1 +1 @@ -Subproject commit 85db468376ff1d554127df1f0335c8a2f8c8c2be +Subproject commit 724c7b9a3a27e5de2077f388832167ae91e9f29c