- commit
- 844af60
- parent
- 5b6b68c
- author
- xxwhirlpool
- date
- 2025-06-06 10:15:15 -0400 EDT
add laptop conky config; minor edit to starship prompt
12 files changed,
+166,
-0
+3,
-0
1@@ -20,6 +20,9 @@ format = '[$user](bold lavender)[@](bold green)'
2 [directory]
3 style = "bold green"
4
5+[[battery.display]]
6+threshold = 0
7+
8 [palettes.catppuccin_frappe]
9 rosewater = "#f2d5cf"
10 flamingo = "#eebebe"
+3,
-0
1@@ -0,0 +1,3 @@
2+# laptop conky widget
3+
4+this widget is adapted from an existing widget on github, [now clocking](https://github.com/foxfirecodes/now-clocking), but with both widgets displayed at once using two systemd services (provided in this directory), and the music widget backend swapped to a custom script that leverages the lastFM API.
+5,
-0
1@@ -0,0 +1,5 @@
2+#!/bin/bash
3+
4+cd /home/kat/now-clocking
5+
6+conky -c /home/kat/now-clocking/widgets/np.lua
+5,
-0
1@@ -0,0 +1,5 @@
2+#!/bin/bash
3+
4+cd /home/kat/now-clocking
5+
6+conky -c /home/kat/now-clocking/widgets/npart.lua
+42,
-0
1@@ -0,0 +1,42 @@
2+#!/bin/bash
3+
4+URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${USER}&api_key=${API_KEY}&format=json&limit=1"
5+
6+artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"')
7+track=$(curl -s ${URL} | jq -r '.recenttracks.track[0].name')
8+art=$(curl -s $URL | jq -r '.recenttracks.track[0].image[2]."#text"')
9+
10+tmp="/tmp"
11+img_path="$tmp/lastfm-conky.png"
12+
13+getimg() {
14+ if [ -n "$art" ]; then
15+ if [[ "$art" = http* ]] || [[ "$art" = file:* ]]; then
16+ curl -s "$art" -o "$img_path"
17+ elif [ -f "$art" ]; then
18+ cp "$art" "$img_path"
19+ else
20+ echo "something wrong with art"
21+ exit 1
22+ fi
23+ fi
24+}
25+
26+showimg() {
27+ getimg
28+ if [ -f "$img_path" ] && [ "$(wc -c "$img_path" | awk '{print $1}')" -gt 0 ]; then
29+ echo "\${image $img_path -p 0,0 -s 125x125 -n}"
30+ else
31+ echo "\${image ./placeholder.png -p 0,0 -s 125x125}"
32+ fi
33+}
34+
35+if [ "$1" == "artist" ]; then
36+ echo $artist
37+elif [ "$1" == "track" ]; then
38+ echo $track
39+elif [ "$1" == "art" ]; then
40+ showimg
41+else
42+ exit 1
43+fi
+0,
-0
1@@ -0,0 +1,15 @@
2+[Unit]
3+Description=Conky
4+After=network.target
5+
6+[Service]
7+Type=simple
8+User=kat
9+Group=kat
10+Environment="DISPLAY=:0"
11+ExecStart=/usr/bin/conky-start.sh
12+Restart=always
13+RuntimeMaxSec=30m
14+
15+[Install]
16+WantedBy=multi-user.target
1@@ -0,0 +1,15 @@
2+[Unit]
3+Description=Conky
4+After=network.target
5+
6+[Service]
7+Type=simple
8+User=kat
9+Group=kat
10+Environment="DISPLAY=:0"
11+ExecStart=/usr/bin/conky-start2.sh
12+Restart=always
13+RuntimeMaxSec=30m
14+
15+[Install]
16+WantedBy=multi-user.target
1@@ -0,0 +1,39 @@
2+local M = {}
3+
4+---extends the base config with the given overrides
5+---@param overrides table
6+function M.extend_config(overrides)
7+ local config = {
8+ -- load common funcs
9+ lua_load = './widgets/lib/funcs.lua',
10+
11+ -- run settings
12+ total_run_times = 0,
13+ update_interval = 1,
14+
15+ -- positioning
16+ alignment = 'bottom_left',
17+ xinerama_head = tonumber(os.getenv("NOW_CLOCKING_DISPLAY") or 0),
18+
19+ -- draw settings
20+ double_buffer = true,
21+ draw_shades = false,
22+ draw_blended = false,
23+
24+ -- compositor settings
25+ own_window = true,
26+ own_window_argb_visual = true,
27+ own_window_argb_value = 0,
28+ own_window_transparent = true,
29+ own_window_type = 'desktop',
30+ own_window_hints = 'undecorated,below,skip_taskbar,sticky,skip_pager',
31+ }
32+
33+ for k, v in pairs(overrides) do
34+ config[k] = v
35+ end
36+
37+ return config
38+end
39+
40+return M
1@@ -0,0 +1,10 @@
2+function conky_now()
3+ -- current day of month
4+ local day_of_month = os.date("*t").day
5+ local suffix = day_of_month == 1 and "st" or day_of_month == 2 and "nd" or day_of_month == 3 and "rd" or "th"
6+ return os.date("%B " .. tostring(day_of_month) .. suffix .. " %Y")
7+end
8+
9+function conky_textcolor()
10+ return "${color " .. (os.getenv("NOW_CLOCKING_TEXT_COLOR") or "#ffffff") .. "}"
11+end
+18,
-0
1@@ -0,0 +1,18 @@
2+conky.config = require("widgets.lib.common").extend_config {
3+ -- positioning
4+ gap_x = 50 + tonumber(os.getenv("NOW_CLOCKING_OFFSET_X") or 0),
5+ gap_y = 85 + tonumber(os.getenv("NOW_CLOCKING_OFFSET_Y") or 0),
6+ minimum_height = 200,
7+
8+ -- text settings
9+ uppercase = true,
10+ use_xft = true,
11+ override_utf8_locale = true,
12+};
13+
14+conky.text = [[
15+${eval ${lua textcolor}}${font JetBrains Mono:pixelsize=80}${time %H:%M:%S}${font JetBrains Mono:pixelsize=65}
16+${eval ${lua textcolor}}${font JetBrains Mono:pixelsize=35}${lua now}
17+${eval ${lua textcolor}}${font JetBrains Mono:pixelsize=44} ${font JetBrains Mono:style=bold:pixelsize=46}${exec ../lastfm.sh artist}${font Gotham:style=bold:pixelsize=10}
18+${eval ${lua textcolor}}${font JetBrains Mono:pixelsize=44} ${font JetBrains Mono:pixelsize=23}${exec ../lastfm.sh track}
19+]];
+11,
-0
1@@ -0,0 +1,11 @@
2+conky.config = require("widgets.lib.common").extend_config {
3+ -- positioning
4+ gap_x = 50 + tonumber(os.getenv("NOW_CLOCKING_OFFSET_X") or 0),
5+ gap_y = 115 + tonumber(os.getenv("NOW_CLOCKING_OFFSET_Y") or 0),
6+ minimum_width = 100,
7+ minimum_height = 100,
8+};
9+
10+conky.text = [[
11+${execp ../lastfm.sh art}
12+]];