From f78d5d47785a59196a479a38be1fa2c097192e2e Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Sat, 8 Nov 2025 11:41:25 -0500 Subject: [PATCH] Fixed df error about swap, fixed user instructions for which dependencies are required and scripts require executable permissions --- conf | 28 ++++++++++++++-------------- devices/get_device_info.lua | 8 ++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/conf b/conf index 27bc0fa..e516297 100644 --- a/conf +++ b/conf @@ -15,10 +15,11 @@ -- !!!IMPORTANT!!! THE FOLLOWING ARE REQUIREMENTS FOR THIS SCRIPT TO WORK PROPERLY: -- (1) DEPENDENCIES. -- Install the following software, if not already installed: --- "Conky" sudo apt-get install conky-all (or use software manager) --- "Jq" sudo apt-get install jq (or use software manager) --- "Curl" sudo apt-get install curl (or use software manager) --- "Wget" sudo apt-get install wget (or use software manager) +-- "Conky" sudo apt-get install conky-all +-- "Jq" sudo apt-get install jq +-- "Curl" sudo apt-get install curl +-- "Wget" sudo apt-get install wget +-- "python3" sudo apt-get install python3 -- (2) FONTS. -- Install the following custom fonts: -- "Neuropolitical" Place .ttf file in ~/.fonts/ https://www.dafont.com/font-comment.php?file=neuropolitical @@ -28,8 +29,8 @@ -- chmod +x ~/.conky/mgconky/weather/get_weather.sh -- chmod +x ~/.conky/mgconky/weather/parse_weather.sh -- chmod +x ~/.conky/mgconky/weather/parse_forecast.sh --- chmod +x ~/.conky/mgconky/weather/parse_forecast.sh --- chmod +x ~/.conky/mgconky/stocks/get_stocks.py (Requires python3, which is usually pre-installed on your OS) +-- chmod +x ~/.conky/mgconky/stocks/get_stocks_alphavantage.py +-- chmod +x ~/.conky/mgconky/stocks/get_stocks_finnhub.py -- (4) WEATHER. -- Make a free account at https://openweathermap.org/ -- Write down your API key, which is found on the "API keys" tab after you log in. (https://home.openweathermap.org/api_key @@ -91,16 +92,16 @@ conky.config = { color7 = "#FF0000", -- Bad values (red) -- Weather variables - template0 = "YOUR_OPENWEATHERMAP_API_KEY_HERE", -- OpenWeatherMap API key (https://home.openweathermap.org/api_keys) - template1 = "YOUR_OPENWEATHERMAP_CITY_ID_HERE", -- OpenWeatherMap City ID (the number in the URL of your city, for example: https://openweathermap.org/city/5128581) + template0 = "", -- OpenWeatherMap API key (https://home.openweathermap.org/api_keys) + template1 = "4467657", -- OpenWeatherMap City ID (the number in the URL of your city, for example: https://openweathermap.org/city/5128581) template2 = "imperial", -- Temp unit ("default" for Kelvin, "metric" for Celsius, "imperial" for Fahrenheit) template3 = "", -- Locale (e.g., "es_ES.UTF-8") # Leave empty for default -- Stock variables - template4 = "YOUR_FINNHUB_API_KEY_HERE", -- FinnHub API key (https://finnhub.io/) - template5 = "YOUR_ALPHAVANTAGE_API_KEY_HERE", -- Alpha Vantage API key (https://www.alphavantage.co/) - template6 = "goog,amzn,aapl,msft,meta,tsla,avgo,tsm,brk.a,pg,nvda", -- Stock symbols for FinnHub (comma separated, no spaces, i.e. goog,amzn,aapl) - template7 = "nvda", -- Stock symbols for Alpha Vantage (keep to a minimum unless you have a paid API key) + template4 = "", -- FinnHub API key (https://finnhub.io/) + template5 = " 0 then output = output .. '${voffset 0}${color0}${font Neuropolitical:size=8:bold}DRIVE${font Courier:size=9} /dev/' .. drive .. '${color} ${color1}${hr 2}${color}\n' for _, mount in ipairs(data.mountpoints) do + + -- Skip entries that are not real mountpoints like [SWAP] + if mount:sub(1, 1) ~= "/" then + goto continue + end + -- Use df to get the size and used space for the mount local handle = io.popen("df -h --output=target,size,used " .. mount .. " | tail -n 1") local df_result = handle:read("*a") @@ -182,6 +188,8 @@ function conky_get_drives_and_volumes() output = output .. '${voffset 2}' .. target .. ': ${alignr}${color3}' .. used .. 'B${color} of ${color3}' .. size .. 'B${color}\n' output = output .. '${voffset -2}${color5}${fs_bar ' .. target .. '}${color}\n' end + + ::continue:: end output = output .. '\n' -- Add a blank line after the last mount point of the current drive end