From f0a920d30db3255f00ae52538f08718a2003bd94 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 | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 1051865..9c0edfd 100644 --- a/README.rst +++ b/README.rst @@ -131,8 +131,8 @@ Otherwise, if you want to be synced with upstream, modify ``theme_path`` variabl .. 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