Duskwm config
This commit is contained in:
parent
54aece76f2
commit
8733e2d1bc
17 changed files with 843 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
key.txt
|
key.txt
|
||||||
|
|
||||||
|
__pycache__/
|
||||||
|
|
8
duskwm/.Xresources
Normal file
8
duskwm/.Xresources
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
! osc-52 support
|
||||||
|
*.allowWindowOps: true
|
||||||
|
|
||||||
|
#include "/home/jleechpe/.config/dusk/themes/dark/zenburn.res"
|
||||||
|
#include "/home/jleechpe/.config/dusk/themes/template.txt"
|
||||||
|
|
||||||
|
dusk.font: FiraCode Nerd Font:size=12
|
||||||
|
*.font: FiraCode Nerd Font:size=10
|
96
duskwm/.config/dusk/status_scripts/duskwm_status.py
Executable file
96
duskwm/.config/dusk/status_scripts/duskwm_status.py
Executable file
|
@ -0,0 +1,96 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
import os
|
||||||
|
import runpy
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
from distutils.util import strtobool
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
import psutil
|
||||||
|
|
||||||
|
# Configs
|
||||||
|
main_dir = Path(sys.argv[0]).parent.resolve()
|
||||||
|
debug = strtobool(os.getenv("STATUS_DEBUG", "False"))
|
||||||
|
|
||||||
|
# Scripts by interval
|
||||||
|
statuses = {
|
||||||
|
5: [(2, "./scripts/get_volume.py")],
|
||||||
|
60: [
|
||||||
|
(0, "./scripts/clock.py"),
|
||||||
|
(4, "./scripts/get_battery.py"),
|
||||||
|
(3, "./scripts/get_wifi.py"),
|
||||||
|
(7, "./scripts/get_uptime.py"),
|
||||||
|
(1, "./scripts/unread_mail.py"),
|
||||||
|
],
|
||||||
|
# 300: [],
|
||||||
|
3600: [(5, "./scripts/get_publicip.py"), (6, "./scripts/get_weather.py")],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def list_statuses():
|
||||||
|
print("Status scripts being processed")
|
||||||
|
for interval, status in statuses.items():
|
||||||
|
period = "second" if interval == 1 else "seconds"
|
||||||
|
print(f" Updating every {interval} {period}")
|
||||||
|
for location, script in status:
|
||||||
|
print(f" {location}: {script}")
|
||||||
|
|
||||||
|
|
||||||
|
def kill_existing_instances():
|
||||||
|
current_pid = os.getpid()
|
||||||
|
for proc in psutil.process_iter(["pid", "name"]):
|
||||||
|
if proc.info["name"].startswith("duskwm_status"):
|
||||||
|
pid = proc.info["pid"]
|
||||||
|
if pid != current_pid:
|
||||||
|
os.kill(pid, 9)
|
||||||
|
print(f"Killing existing instance (PID {pid})")
|
||||||
|
|
||||||
|
|
||||||
|
def update_status(status: Optional[int], content: Optional[str]):
|
||||||
|
status = status if status is not None else 99
|
||||||
|
content = content if content is not None else ""
|
||||||
|
if debug:
|
||||||
|
print(f"{status:>3} : {content}")
|
||||||
|
else:
|
||||||
|
subprocess.run(
|
||||||
|
[
|
||||||
|
"duskc",
|
||||||
|
"--ignore-reply",
|
||||||
|
"run_command",
|
||||||
|
"setstatus",
|
||||||
|
f"{status}",
|
||||||
|
f"{content}",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def get_status_data(scriptpath: str) -> Optional[str]:
|
||||||
|
path = main_dir.joinpath(scriptpath).as_posix()
|
||||||
|
result = runpy.run_path(path)
|
||||||
|
content: Optional[str] = result.get("content", None)
|
||||||
|
return content
|
||||||
|
|
||||||
|
|
||||||
|
# Run at startup
|
||||||
|
print(f"Running in Debug mode: {debug}")
|
||||||
|
print(f"Root script found at: {main_dir}")
|
||||||
|
kill_existing_instances()
|
||||||
|
list_statuses()
|
||||||
|
|
||||||
|
seconds = 0
|
||||||
|
while True:
|
||||||
|
# Run on loop
|
||||||
|
for interval, scripts in statuses.items():
|
||||||
|
if seconds % interval == 0:
|
||||||
|
for status, script in scripts:
|
||||||
|
# try:
|
||||||
|
data = get_status_data(script)
|
||||||
|
# except Exception:
|
||||||
|
# data = f"Err: {script}"
|
||||||
|
update_status(status, data)
|
||||||
|
|
||||||
|
# Increment count and sleep for loop
|
||||||
|
seconds += 1
|
||||||
|
time.sleep(1)
|
12
duskwm/.config/dusk/status_scripts/scripts/clock.py
Normal file
12
duskwm/.config/dusk/status_scripts/scripts/clock.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
from theme import current_theme, default
|
||||||
|
|
||||||
|
if current_theme.fg == current_theme.fg_alt:
|
||||||
|
current_theme.fg_alt = current_theme.base7
|
||||||
|
|
||||||
|
frame = f"^v^^c{current_theme.yellow}^"
|
||||||
|
date = f"^c{current_theme.fg}^"
|
||||||
|
time = f"^c{current_theme.fg_alt}^"
|
||||||
|
data = datetime.now().strftime(f"{date}%Y-%m-%d {time}%H:%M")
|
||||||
|
content = f"{frame}[^v^{data}^t^]^t^"
|
14
duskwm/.config/dusk/status_scripts/scripts/get_battery.py
Normal file
14
duskwm/.config/dusk/status_scripts/scripts/get_battery.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
from theme import current_theme, default
|
||||||
|
|
||||||
|
try:
|
||||||
|
charge = open("/sys/class/power_supply/BAT1/capacity").read().strip()
|
||||||
|
status = open("/sys/class/power_supply/BAT1/status").read().strip()
|
||||||
|
|
||||||
|
if status == "Discharging":
|
||||||
|
icon = ""
|
||||||
|
else:
|
||||||
|
icon = ""
|
||||||
|
|
||||||
|
content = f"{icon}{status}%"
|
||||||
|
except Exception:
|
||||||
|
content = None
|
|
@ -0,0 +1,8 @@
|
||||||
|
import requests
|
||||||
|
from theme import current_theme, default
|
||||||
|
|
||||||
|
ip = requests.get("https://api64.ipify.org").text.strip()
|
||||||
|
|
||||||
|
bright = f"^v^^c{current_theme.dark_cyan}^"
|
||||||
|
icon = f"^v^^c{current_theme.cyan}^"
|
||||||
|
content = f"{icon} {bright}{ip}^t^"
|
46
duskwm/.config/dusk/status_scripts/scripts/get_uptime.py
Normal file
46
duskwm/.config/dusk/status_scripts/scripts/get_uptime.py
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
import subprocess
|
||||||
|
import time
|
||||||
|
|
||||||
|
from theme import current_theme, default
|
||||||
|
|
||||||
|
raw_seconds = time.clock_gettime(time.CLOCK_BOOTTIME)
|
||||||
|
|
||||||
|
MINUTE = 60
|
||||||
|
HOUR = 60 * MINUTE
|
||||||
|
DAY = 24 * HOUR
|
||||||
|
|
||||||
|
days = int(raw_seconds / DAY)
|
||||||
|
hours = int((raw_seconds % DAY) / HOUR)
|
||||||
|
minutes = int((raw_seconds % HOUR / MINUTE))
|
||||||
|
|
||||||
|
data = ""
|
||||||
|
if days > 0:
|
||||||
|
data += f"{days}d "
|
||||||
|
data += f"{hours:02}:"
|
||||||
|
data += f"{minutes:02}"
|
||||||
|
|
||||||
|
# Check for pending reboot
|
||||||
|
color = f"^c{current_theme.cyan}^"
|
||||||
|
time_color = f"^c{current_theme.teal}^"
|
||||||
|
|
||||||
|
warn_color = f"^c{current_theme.orange}^"
|
||||||
|
warn_time_color = f"^c{current_theme.red}^"
|
||||||
|
prefix = ""
|
||||||
|
|
||||||
|
|
||||||
|
if days > 10:
|
||||||
|
color = warn_color
|
||||||
|
time_color = warn_time_color
|
||||||
|
|
||||||
|
try:
|
||||||
|
reboot = subprocess.run(
|
||||||
|
["please", "longoverdue"], stdout=subprocess.PIPE, encoding="utf-8"
|
||||||
|
).stdout.split("\n")
|
||||||
|
if len(reboot) > 1:
|
||||||
|
color = warn_color
|
||||||
|
time_color = warn_time_color
|
||||||
|
prefix = ""
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
content = f"^v^{color}{prefix} {time_color}{data}^t^"
|
21
duskwm/.config/dusk/status_scripts/scripts/get_volume.py
Normal file
21
duskwm/.config/dusk/status_scripts/scripts/get_volume.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from theme import current_theme, default
|
||||||
|
|
||||||
|
data = subprocess.run(
|
||||||
|
["wpctl", "get-volume", "@DEFAULT_AUDIO_SINK@"],
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
encoding="utf-8",
|
||||||
|
).stdout.strip()
|
||||||
|
|
||||||
|
_, decimal, *muted = data.split(" ")
|
||||||
|
|
||||||
|
decimal = float(decimal)
|
||||||
|
muted = muted[0] if muted else ""
|
||||||
|
|
||||||
|
icon = "" if muted == "[MUTED]" else ""
|
||||||
|
color = (
|
||||||
|
f"^c{current_theme.base7}^" if muted == "[MUTED]" else f"^c{current_theme.base8}^"
|
||||||
|
)
|
||||||
|
vol_string = f"{decimal:.0%}"
|
||||||
|
content = f"^v^{color}{icon} {vol_string:>4}^t^"
|
43
duskwm/.config/dusk/status_scripts/scripts/get_weather.py
Normal file
43
duskwm/.config/dusk/status_scripts/scripts/get_weather.py
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
import requests
|
||||||
|
from theme import current_theme, default
|
||||||
|
|
||||||
|
# WHO values
|
||||||
|
# 1-2: Low
|
||||||
|
# 3-5: Moderate
|
||||||
|
# 6-7: High
|
||||||
|
# 8-10: Very High
|
||||||
|
# 11+: Extreme
|
||||||
|
uv_index = {
|
||||||
|
0: current_theme.green,
|
||||||
|
2: current_theme.yellow,
|
||||||
|
5: current_theme.orange,
|
||||||
|
7: current_theme.red,
|
||||||
|
10: current_theme.magenta,
|
||||||
|
}
|
||||||
|
|
||||||
|
geodata = requests.get("https://ipinfo.io/json").json()
|
||||||
|
|
||||||
|
location = geodata["loc"]
|
||||||
|
city = geodata["city"]
|
||||||
|
region = geodata["region"]
|
||||||
|
|
||||||
|
weather = requests.get(
|
||||||
|
f"https://wttr.in/{location}?format=+%c+%t+%f+%h+%w+%P+%p+%u"
|
||||||
|
).text
|
||||||
|
|
||||||
|
icon, temp, feels_like, humidity, wind, pressure, precip, uv = weather.split()
|
||||||
|
|
||||||
|
bright = f"^v^^c{current_theme.base8}^"
|
||||||
|
uv_color = [color for index, color in uv_index.items() if int(uv) > index][-1]
|
||||||
|
uv_color = f"^v^^c{uv_color}^"
|
||||||
|
humid_color = f"^v^^c{current_theme.blue}^"
|
||||||
|
precip_color = f"^v^^c{current_theme.teal}^"
|
||||||
|
|
||||||
|
# c_templ = t"{i}{t} {w} {h} {p}"
|
||||||
|
content = (
|
||||||
|
f"{bright}{icon} "
|
||||||
|
+ f"{uv_color}{temp}({feels_like})^t^ "
|
||||||
|
+ f"{wind} "
|
||||||
|
+ f"{humid_color} {humidity} "
|
||||||
|
+ f"{precip_color}{precip}^t^"
|
||||||
|
)
|
48
duskwm/.config/dusk/status_scripts/scripts/get_wifi.py
Normal file
48
duskwm/.config/dusk/status_scripts/scripts/get_wifi.py
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from theme import current_theme, default
|
||||||
|
|
||||||
|
dbmRange = {(-10, ""), (-70, ""), (-80, ""), (-90, "")}
|
||||||
|
|
||||||
|
# full data
|
||||||
|
try:
|
||||||
|
data = subprocess.run(
|
||||||
|
["iwd", "station", "wlan0", "show"], stdout=subprocess.PIPE, encoding="utf-8"
|
||||||
|
).stdout.split("\n")
|
||||||
|
|
||||||
|
status = {}
|
||||||
|
for line in data:
|
||||||
|
line = line.strip()
|
||||||
|
if not line:
|
||||||
|
continue
|
||||||
|
|
||||||
|
match line:
|
||||||
|
case l if l.startswith("State"):
|
||||||
|
status["state"] = l.split()[1]
|
||||||
|
case l if l.startswith("Connected network"):
|
||||||
|
status["SSID"] = l.split()[2:]
|
||||||
|
case l if l.startswith("Frequency"):
|
||||||
|
f = int(l.split()[1])
|
||||||
|
if f >= 5925:
|
||||||
|
status["frequency"] = "6G"
|
||||||
|
elif f >= 5000:
|
||||||
|
status["frequency"] = "5G"
|
||||||
|
elif f >= 2400:
|
||||||
|
status["frequency"] = "2.4G"
|
||||||
|
else:
|
||||||
|
f = f / 1000
|
||||||
|
status["frequency"] = f"{f}GHz"
|
||||||
|
case l if l.startswith("RSSI"):
|
||||||
|
dbm = int(l.split()[1])
|
||||||
|
for value, icon in dbmRange:
|
||||||
|
if dbm < value:
|
||||||
|
status["icon"] = icon
|
||||||
|
|
||||||
|
status["strength"] = dbm
|
||||||
|
|
||||||
|
if status["state"] == "connected":
|
||||||
|
content = f"{status['icon']} {status['SSID']}({status['frequency']})"
|
||||||
|
else:
|
||||||
|
content = ""
|
||||||
|
except Exception:
|
||||||
|
content = None
|
13
duskwm/.config/dusk/status_scripts/scripts/unread_mail.py
Normal file
13
duskwm/.config/dusk/status_scripts/scripts/unread_mail.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from theme import current_theme, default
|
||||||
|
|
||||||
|
icon = ""
|
||||||
|
count = subprocess.run(
|
||||||
|
["mu", "msgs-count", "--", "--query=flag:unread AND maildir:/Inbox/"],
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
encoding="utf-8",
|
||||||
|
).stdout.strip()
|
||||||
|
|
||||||
|
bright = f"^v^^c{current_theme.base8}^"
|
||||||
|
content = f"{bright}{icon} {count}^t^"
|
66
duskwm/.config/dusk/status_scripts/theme.py
Normal file
66
duskwm/.config/dusk/status_scripts/theme.py
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
class Theme:
|
||||||
|
def __init__(self, **colors):
|
||||||
|
for name, value in colors.items():
|
||||||
|
setattr(self, name, value)
|
||||||
|
|
||||||
|
|
||||||
|
themes = {
|
||||||
|
"spacegray": Theme(
|
||||||
|
bg="#2b303b",
|
||||||
|
bg_alt="#232830",
|
||||||
|
base0="#1B2229",
|
||||||
|
base1="#1c1f24",
|
||||||
|
base2="#202328",
|
||||||
|
base3="#2F3237",
|
||||||
|
base4="#4f5b66",
|
||||||
|
base5="#65737E",
|
||||||
|
base6="#73797e",
|
||||||
|
base7="#9ca0a4",
|
||||||
|
base8="#DFDFDF",
|
||||||
|
fg="#c0c5ce",
|
||||||
|
fg_alt="#c0c5ce",
|
||||||
|
grey="#4f5b66",
|
||||||
|
red="#BF616A",
|
||||||
|
orange="#D08770",
|
||||||
|
green="#A3BE8C",
|
||||||
|
blue="#8FA1B3",
|
||||||
|
violet="#b48ead",
|
||||||
|
teal="#4db5bd",
|
||||||
|
yellow="#ECBE7B",
|
||||||
|
dark_blue="#2257A0",
|
||||||
|
magenta="#c678dd",
|
||||||
|
cyan="#46D9FF",
|
||||||
|
dark_cyan="#5699AF",
|
||||||
|
),
|
||||||
|
"zenburn": Theme(
|
||||||
|
bg="#3F3F3F",
|
||||||
|
bg_alt="#383838",
|
||||||
|
base0="#000000",
|
||||||
|
base1="#2B2B2B",
|
||||||
|
base2="#303030",
|
||||||
|
base3="#383838",
|
||||||
|
base4="#494949",
|
||||||
|
base5="#4F4F4F",
|
||||||
|
base6="#5F5F5F",
|
||||||
|
base7="#6F6F6F",
|
||||||
|
base8="#FFFFEF",
|
||||||
|
fg="#DCDCDC",
|
||||||
|
fg_alt="#989890",
|
||||||
|
grey="#494949",
|
||||||
|
red="#CC9393",
|
||||||
|
orange="#DFAF8F",
|
||||||
|
green="#7F9F7F",
|
||||||
|
teal="#4db5bd",
|
||||||
|
yellow="#F0DFAF",
|
||||||
|
blue="#8CD0D3",
|
||||||
|
dark_blue="#2257A0",
|
||||||
|
magenta="#DC8CC3",
|
||||||
|
violet="#a9a1e1",
|
||||||
|
cyan="#93E0E3",
|
||||||
|
dark_cyan="#5699AF",
|
||||||
|
),
|
||||||
|
"default": Theme(),
|
||||||
|
}
|
||||||
|
|
||||||
|
current_theme = themes["spacegray"]
|
||||||
|
default = themes["default"]
|
39
duskwm/.config/dusk/themes/dark/spacegray.res
Normal file
39
duskwm/.config/dusk/themes/dark/spacegray.res
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#define COLOR0 #000000
|
||||||
|
#define COLOR1 #b04b57
|
||||||
|
#define COLOR2 #87b379
|
||||||
|
#define COLOR3 #e5c179
|
||||||
|
#define COLOR4 #7d8fa4
|
||||||
|
#define COLOR5 #a47996
|
||||||
|
#define COLOR6 #85a7a5
|
||||||
|
#define COLOR7 #b3b8c3
|
||||||
|
#define COLOR8 #000000
|
||||||
|
#define COLOR9 #b04b57
|
||||||
|
#define COLOR10 #87b379
|
||||||
|
#define COLOR11 #e5c179
|
||||||
|
#define COLOR12 #7d8fa4
|
||||||
|
#define COLOR13 #a47996
|
||||||
|
#define COLOR14 #85a7a5
|
||||||
|
#define COLOR15 #ffffff
|
||||||
|
#define BASE_BACKGROUND #20242d
|
||||||
|
#define BASE_FOREGROUND #b3b8c3
|
||||||
|
#define CURSOR #b3b8c3
|
||||||
|
|
||||||
|
#define SELECTED_FOREGROUND COLOR15
|
||||||
|
#define SELECTED_BACKGROUND COLOR1
|
||||||
|
#define SCRATCHNORM BASE_BACKGROUND
|
||||||
|
#define SCRATCHSEL SELECTED_BACKGROUND
|
||||||
|
#define HID_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#define HID_NORM_BG_COLOR BASE_BACKGROUND
|
||||||
|
#define HID_SEL_FG_COLOR COLOR3
|
||||||
|
#define HID_SEL_BG_COLOR BASE_BACKGROUND
|
||||||
|
#define WS_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#define WS_NORM_BG_COLOR BASE_BACKGROUND
|
||||||
|
#define WS_SEL_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#define WS_SEL_BG_COLOR SELECTED_BACKGROUND
|
||||||
|
#define MARKED_FG_COLOR COLOR0
|
||||||
|
#define MARKED_BG_COLOR COLOR3
|
||||||
|
#define BORDER COLOR0
|
||||||
|
#define WARNING_FG_COLOR COLOR0
|
||||||
|
#define WARNING_BG_COLOR COLOR4
|
||||||
|
#define URGENT_FG_COLOR COLOR0
|
||||||
|
#define URGENT_BG_COLOR COLOR2
|
39
duskwm/.config/dusk/themes/dark/zenburn.res
Normal file
39
duskwm/.config/dusk/themes/dark/zenburn.res
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#define COLOR0 #383838
|
||||||
|
#define COLOR1 #404040
|
||||||
|
#define COLOR2 #606060
|
||||||
|
#define COLOR3 #6f6f6f
|
||||||
|
#define COLOR4 #808080
|
||||||
|
#define COLOR5 #dcdccc
|
||||||
|
#define COLOR6 #c0c0c0
|
||||||
|
#define COLOR7 #ffffff
|
||||||
|
#define COLOR8 #dca3a3
|
||||||
|
#define COLOR9 #dfaf8f
|
||||||
|
#define COLOR10 #e0cf9f
|
||||||
|
#define COLOR11 #5f7f5f
|
||||||
|
#define COLOR12 #93e0e3
|
||||||
|
#define COLOR13 #7cb8bb
|
||||||
|
#define COLOR14 #dc8cc3
|
||||||
|
#define COLOR15 #000000
|
||||||
|
#define BASE_BACKGROUND COLOR0
|
||||||
|
#define BASE_FOREGROUND COLOR5
|
||||||
|
#define CURSOR COLOR6
|
||||||
|
|
||||||
|
#define SELECTED_FOREGROUND COLOR15
|
||||||
|
#define SELECTED_BACKGROUND COLOR1
|
||||||
|
#define SCRATCHNORM BASE_BACKGROUND
|
||||||
|
#define SCRATCHSEL SELECTED_BACKGROUND
|
||||||
|
#define HID_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#define HID_NORM_BG_COLOR BASE_BACKGROUND
|
||||||
|
#define HID_SEL_FG_COLOR COLOR3
|
||||||
|
#define HID_SEL_BG_COLOR BASE_BACKGROUND
|
||||||
|
#define WS_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#define WS_NORM_BG_COLOR BASE_BACKGROUND
|
||||||
|
#define WS_SEL_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#define WS_SEL_BG_COLOR SELECTED_BACKGROUND
|
||||||
|
#define MARKED_FG_COLOR COLOR6
|
||||||
|
#define MARKED_BG_COLOR COLOR3
|
||||||
|
#define BORDER COLOR15
|
||||||
|
#define WARNING_FG_COLOR COLOR6
|
||||||
|
#define WARNING_BG_COLOR COLOR4
|
||||||
|
#define URGENT_FG_COLOR COLOR6
|
||||||
|
#define URGENT_BG_COLOR COLOR2
|
206
duskwm/.config/dusk/themes/defaults.txt
Normal file
206
duskwm/.config/dusk/themes/defaults.txt
Normal file
|
@ -0,0 +1,206 @@
|
||||||
|
#ifndef NORM_FG_COLOR
|
||||||
|
#define NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef SEL_FG_COLOR
|
||||||
|
#define SEL_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef TITLE_NORM_FG_COLOR
|
||||||
|
#define TITLE_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef TITLE_SEL_FG_COLOR
|
||||||
|
#define TITLE_SEL_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef WS_NORM_FG_COLOR
|
||||||
|
#define WS_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef WS_OCC_FG_COLOR
|
||||||
|
#define WS_OCC_FG_COLOR WS_NORM_FG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifndef WS_VIS_FG_COLOR
|
||||||
|
#define WS_VIS_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef WS_SEL_FG_COLOR
|
||||||
|
#define WS_SEL_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef HID_NORM_FG_COLOR
|
||||||
|
#define HID_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef HID_SEL_FG_COLOR
|
||||||
|
#define HID_SEL_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef URGENT_FG_COLOR
|
||||||
|
#define URGENT_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef WARNING_FG_COLOR
|
||||||
|
#ifdef WARNING
|
||||||
|
#define WARNING_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef MARKED_FG_COLOR
|
||||||
|
#define MARKED_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef SCRATCH_NORM_FG_COLOR
|
||||||
|
#define SCRATCH_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef SCRATCH_SEL_FG_COLOR
|
||||||
|
#define SCRATCH_SEL_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NORM_BG_COLOR
|
||||||
|
#define NORM_BG_COLOR BASE_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef SEL_BG_COLOR
|
||||||
|
#define SEL_BG_COLOR SELECTED_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#ifndef TITLE_NORM_BG_COLOR
|
||||||
|
#ifdef TITLENORM
|
||||||
|
#define TITLE_NORM_BG_COLOR TITLENORM
|
||||||
|
#else
|
||||||
|
#define TITLE_NORM_BG_COLOR BASE_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef TITLE_SEL_BG_COLOR
|
||||||
|
#ifdef TITLESEL
|
||||||
|
#define TITLE_SEL_BG_COLOR TITLESEL
|
||||||
|
#else
|
||||||
|
#define TITLE_SEL_BG_COLOR SELECTED_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef WS_NORM_BG_COLOR
|
||||||
|
#ifdef WSNORM
|
||||||
|
#define WS_NORM_BG_COLOR WSNORM
|
||||||
|
#else
|
||||||
|
#define WS_NORM_BG_COLOR BASE_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef WS_OCC_BG_COLOR
|
||||||
|
#ifdef WSOCC
|
||||||
|
#define WS_OCC_BG_COLOR WSOCC
|
||||||
|
#else
|
||||||
|
#define WS_OCC_BG_COLOR WS_NORM_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef WS_SEL_BG_COLOR
|
||||||
|
#ifdef WSSEL
|
||||||
|
#define WS_SEL_BG_COLOR WSSEL
|
||||||
|
#else
|
||||||
|
#define WS_SEL_BG_COLOR SELECTED_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef WS_VIS_BG_COLOR
|
||||||
|
#ifdef WSVIS
|
||||||
|
#define WS_VIS_BG_COLOR WSVIS
|
||||||
|
#else
|
||||||
|
#define WS_VIS_BG_COLOR WS_SEL_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef HID_NORM_BG_COLOR
|
||||||
|
#ifdef HIDNORM
|
||||||
|
#define HID_NORM_BG_COLOR HIDNORM
|
||||||
|
#else
|
||||||
|
#define HID_NORM_BG_COLOR BASE_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef HID_SEL_BG_COLOR
|
||||||
|
#ifdef HIDSEL
|
||||||
|
#define HID_SEL_BG_COLOR HIDSEL
|
||||||
|
#else
|
||||||
|
#define HID_SEL_BG_COLOR SELECTED_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef URGENT_BG_COLOR
|
||||||
|
#ifdef URGENT
|
||||||
|
#define URGENT_BG_COLOR URGENT
|
||||||
|
#else
|
||||||
|
#define URGENT_BG_COLOR BASE_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef WARNING_BG_COLOR
|
||||||
|
#ifdef WARNING
|
||||||
|
#define WARNING_BG_COLOR WARNING
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef MARKED_BG_COLOR
|
||||||
|
#ifdef MARKED
|
||||||
|
#define MARKED_BG_COLOR MARKED
|
||||||
|
#else
|
||||||
|
#define MARKED_BG_COLOR BASE_BACKGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef SCRATCH_NORM_BG_COLOR
|
||||||
|
#ifdef SCRATCHNORM
|
||||||
|
#define SCRATCH_NORM_BG_COLOR SCRATCHNORM
|
||||||
|
#else
|
||||||
|
#define SCRATCH_NORM_BG_COLOR TITLE_NORM_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef SCRATCH_SEL_BG_COLOR
|
||||||
|
#ifdef SCRATCHSEL
|
||||||
|
#define SCRATCH_SEL_BG_COLOR SCRATCHSEL
|
||||||
|
#else
|
||||||
|
#define SCRATCH_SEL_BG_COLOR TITLE_SEL_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FLOAT_NORM_BG_COLOR
|
||||||
|
#ifdef FLOATNORM
|
||||||
|
#define FLOAT_NORM_BG_COLOR FLOATNORM
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef FLOAT_SEL_BG_COLOR
|
||||||
|
#ifdef FLOATSEL
|
||||||
|
#define FLOAT_SEL_BG_COLOR FLOATSEL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FLOAT_NORM_FG_COLOR
|
||||||
|
#ifdef FLOAT_SEL_BG_COLOR
|
||||||
|
#define FLOAT_NORM_FG_COLOR BASE_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef FLOAT_SEL_FG_COLOR
|
||||||
|
#ifdef FLOAT_NORM_BG_COLOR
|
||||||
|
#define FLOAT_SEL_FG_COLOR SELECTED_FOREGROUND
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NORM_BORDER_COLOR
|
||||||
|
#define NORM_BORDER_COLOR BORDER
|
||||||
|
#endif
|
||||||
|
#ifndef SEL_BORDER_COLOR
|
||||||
|
#define SEL_BORDER_COLOR SEL_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifndef TITLE_NORM_BORDER_COLOR
|
||||||
|
#define TITLE_NORM_BORDER_COLOR TITLE_NORM_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifndef TITLE_SEL_BORDER_COLOR
|
||||||
|
#define TITLE_SEL_BORDER_COLOR TITLE_SEL_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifndef SCRATCH_NORM_BORDER_COLOR
|
||||||
|
#define SCRATCH_NORM_BORDER_COLOR SCRATCH_NORM_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifndef SCRATCH_SEL_BORDER_COLOR
|
||||||
|
#define SCRATCH_SEL_BORDER_COLOR SCRATCH_SEL_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifndef URGENT_BORDER_COLOR
|
||||||
|
#define URGENT_BORDER_COLOR URGENT_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifndef MARKED_BORDER_COLOR
|
||||||
|
#define MARKED_BORDER_COLOR MARKED_BG_COLOR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef FLOAT_NORM_BG_COLOR
|
||||||
|
#ifndef FLOAT_NORM_BORDER_COLOR
|
||||||
|
#define FLOAT_NORM_BORDER_COLOR FLOAT_NORM_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef FLOAT_SEL_BG_COLOR
|
||||||
|
#ifndef FLOAT_SEL_BORDER_COLOR
|
||||||
|
#define FLOAT_SEL_BORDER_COLOR FLOAT_SEL_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef BORDER
|
||||||
|
#define BORDER NORM_BG_COLOR
|
||||||
|
#endif
|
169
duskwm/.config/dusk/themes/template.txt
Normal file
169
duskwm/.config/dusk/themes/template.txt
Normal file
|
@ -0,0 +1,169 @@
|
||||||
|
#include "defaults.txt"
|
||||||
|
|
||||||
|
! === terminal colors ===
|
||||||
|
! Change the scope to "dusk" if you do not want the template
|
||||||
|
! to interfere with global colors (e.g. terminals).
|
||||||
|
#define COLOR_SCOPE *
|
||||||
|
!#define COLOR_SCOPE dusk
|
||||||
|
|
||||||
|
#ifdef COLOR0
|
||||||
|
COLOR_SCOPE.color0: COLOR0
|
||||||
|
COLOR_SCOPE.color1: COLOR1
|
||||||
|
COLOR_SCOPE.color2: COLOR2
|
||||||
|
COLOR_SCOPE.color3: COLOR3
|
||||||
|
COLOR_SCOPE.color4: COLOR4
|
||||||
|
COLOR_SCOPE.color5: COLOR5
|
||||||
|
COLOR_SCOPE.color6: COLOR6
|
||||||
|
COLOR_SCOPE.color7: COLOR7
|
||||||
|
COLOR_SCOPE.color8: COLOR8
|
||||||
|
COLOR_SCOPE.color9: COLOR9
|
||||||
|
COLOR_SCOPE.color10: COLOR10
|
||||||
|
COLOR_SCOPE.color11: COLOR11
|
||||||
|
COLOR_SCOPE.color12: COLOR12
|
||||||
|
COLOR_SCOPE.color13: COLOR13
|
||||||
|
COLOR_SCOPE.color14: COLOR14
|
||||||
|
COLOR_SCOPE.color15: COLOR15
|
||||||
|
#endif
|
||||||
|
|
||||||
|
! === general colors ===
|
||||||
|
*.foreground: BASE_FOREGROUND
|
||||||
|
*.background: BASE_BACKGROUND
|
||||||
|
#ifdef CURSOR
|
||||||
|
*.cursor: CURSOR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
! === dusk foreground colors ===
|
||||||
|
dusk.norm.fg.color: NORM_FG_COLOR
|
||||||
|
dusk.titlenorm.fg.color: TITLE_NORM_FG_COLOR
|
||||||
|
dusk.titlesel.fg.color: TITLE_SEL_FG_COLOR
|
||||||
|
dusk.scratchnorm.fg.color: SCRATCH_NORM_FG_COLOR
|
||||||
|
dusk.scratchsel.fg.color: SCRATCH_SEL_FG_COLOR
|
||||||
|
dusk.hidnorm.fg.color: HID_NORM_FG_COLOR
|
||||||
|
dusk.hidsel.fg.color: HID_SEL_FG_COLOR
|
||||||
|
dusk.urg.fg.color: URGENT_FG_COLOR
|
||||||
|
dusk.marked.fg.color: MARKED_FG_COLOR
|
||||||
|
dusk.wsnorm.fg.color: WS_NORM_FG_COLOR
|
||||||
|
dusk.wsvis.fg.color: WS_VIS_FG_COLOR
|
||||||
|
dusk.wssel.fg.color: WS_SEL_FG_COLOR
|
||||||
|
dusk.wsocc.fg.color: WS_OCC_FG_COLOR
|
||||||
|
|
||||||
|
#ifdef FLOAT_NORM_FG_COLOR
|
||||||
|
dusk.norm.float.fg.color: FLOAT_NORM_FG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifdef FLOAT_SEL_FG_COLOR
|
||||||
|
dusk.sel.float.fg.color: FLOAT_SEL_FG_COLOR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
! === dusk background colors ===
|
||||||
|
dusk.norm.bg.color: NORM_BG_COLOR
|
||||||
|
dusk.titlenorm.bg.color: TITLE_NORM_BG_COLOR
|
||||||
|
dusk.titlesel.bg.color: TITLE_SEL_BG_COLOR
|
||||||
|
dusk.scratchnorm.bg.color: SCRATCH_NORM_BG_COLOR
|
||||||
|
dusk.scratchsel.bg.color: SCRATCH_SEL_BG_COLOR
|
||||||
|
dusk.hidnorm.bg.color: HID_NORM_BG_COLOR
|
||||||
|
dusk.hidsel.bg.color: HID_SEL_BG_COLOR
|
||||||
|
dusk.urg.bg.color: URGENT_BG_COLOR
|
||||||
|
dusk.marked.bg.color: MARKED_BG_COLOR
|
||||||
|
dusk.wsnorm.bg.color: WS_NORM_BG_COLOR
|
||||||
|
dusk.wsvis.bg.color: WS_VIS_BG_COLOR
|
||||||
|
dusk.wssel.bg.color: WS_SEL_BG_COLOR
|
||||||
|
dusk.wsocc.bg.color: WS_OCC_BG_COLOR
|
||||||
|
|
||||||
|
! === dusk border colors ===
|
||||||
|
dusk.norm.border.color: NORM_BORDER_COLOR
|
||||||
|
dusk.titlenorm.border.color: TITLE_NORM_BORDER_COLOR
|
||||||
|
dusk.titlesel.border.color: TITLE_SEL_BORDER_COLOR
|
||||||
|
dusk.scratchnorm.border.color: SCRATCH_NORM_BORDER_COLOR
|
||||||
|
dusk.scratchsel.border.color: SCRATCH_SEL_BORDER_COLOR
|
||||||
|
dusk.urg.border.color: URGENT_BORDER_COLOR
|
||||||
|
dusk.marked.border.color: MARKED_BORDER_COLOR
|
||||||
|
|
||||||
|
#ifdef FLOAT_NORM_BG_COLOR
|
||||||
|
dusk.norm.float.bg.color: FLOAT_NORM_BG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifdef FLOAT_SEL_BG_COLOR
|
||||||
|
dusk.sel.float.bg.color: FLOAT_SEL_BG_COLOR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
! === dmenu colors ===
|
||||||
|
dmenu.norm.fg.color: BASE_FOREGROUND
|
||||||
|
dmenu.norm.bg.color: BASE_BACKGROUND
|
||||||
|
dmenu.sel.fg.color: SELECTED_FOREGROUND
|
||||||
|
dmenu.sel.bg.color: SELECTED_BACKGROUND
|
||||||
|
dmenu.border.bg.color: BORDER
|
||||||
|
dmenu.out.fg.color: MARKED_FG_COLOR
|
||||||
|
dmenu.out.bg.color: MARKED_BG_COLOR
|
||||||
|
dmenu.prompt.fg.color: TITLE_NORM_FG_COLOR
|
||||||
|
dmenu.prompt.bg.color: TITLE_NORM_BG_COLOR
|
||||||
|
dmenu.adjacent.fg.color: SELECTED_FOREGROUND
|
||||||
|
dmenu.adjacent.bg.color: SELECTED_BACKGROUND
|
||||||
|
dmenu.selhl.fg.color: URGENT_FG_COLOR
|
||||||
|
dmenu.selhl.bg.color: URGENT_BG_COLOR
|
||||||
|
dmenu.normhl.fg.color: MARKED_FG_COLOR
|
||||||
|
dmenu.normhl.bg.color: MARKED_BG_COLOR
|
||||||
|
#ifdef WARNING_FG_COLOR
|
||||||
|
dmenu.hp.fg.color: WARNING_FG_COLOR
|
||||||
|
#endif
|
||||||
|
#ifdef WARNING_BG_COLOR
|
||||||
|
dmenu.hp.bg.color: WARNING_BG_COLOR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef FLOAT_NORM_BORDER_COLOR
|
||||||
|
dusk.norm.float.border.color: FLOAT_NORM_BORDER_COLOR
|
||||||
|
#endif
|
||||||
|
#ifdef FLOAT_SEL_BORDER_COLOR
|
||||||
|
dusk.sel.float.border.color: FLOAT_SEL_BORDER_COLOR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
! === xmenu colors ===
|
||||||
|
xmenu.background_color: BASE_BACKGROUND
|
||||||
|
xmenu.foreground_color: BASE_FOREGROUND
|
||||||
|
xmenu.selforeground: SELECTED_FOREGROUND
|
||||||
|
xmenu.selbackground: SELECTED_BACKGROUND
|
||||||
|
xmenu.border: BORDER
|
||||||
|
xmenu.separator: BASE_FOREGROUND
|
||||||
|
|
||||||
|
! === slock colors ===
|
||||||
|
slock.background: BASE_BACKGROUND
|
||||||
|
slock.locked: BASE_BACKGROUND
|
||||||
|
slock.input: SELECTED_BACKGROUND
|
||||||
|
slock.failed: URGENT_BG_COLOR
|
||||||
|
#ifdef WARNING_BG_COLOR
|
||||||
|
slock.capslock: WARNING_BG_COLOR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
! === sxiv colors ===
|
||||||
|
Sxiv.mark: MARKED_BG_COLOR
|
||||||
|
Sxiv.barforeground: SELECTED_FOREGROUND
|
||||||
|
Sxiv.barbackground: SELECTED_BACKGROUND
|
||||||
|
|
||||||
|
! === nsxiv colors ===
|
||||||
|
|
||||||
|
Nsxiv.mark.foreground: MARKED_BG_COLOR
|
||||||
|
Nsxiv.window.foreground: BASE_FOREGROUND
|
||||||
|
Nsxiv.window.background: BASE_BACKGROUND
|
||||||
|
Nsxiv.bar.foreground: SELECTED_FOREGROUND
|
||||||
|
Nsxiv.bar.background: SELECTED_BACKGROUND
|
||||||
|
|
||||||
|
! === pmenu colors ===
|
||||||
|
pmenu.foreground: BASE_FOREGROUND
|
||||||
|
pmenu.background: BASE_BACKGROUND
|
||||||
|
pmenu.selbackground: SELECTED_BACKGROUND
|
||||||
|
pmenu.selforeground: SELECTED_FOREGROUND
|
||||||
|
pmenu.border: BORDER
|
||||||
|
pmenu.separator: SELECTED_BACKGROUND
|
||||||
|
|
||||||
|
! === dunst colors ===
|
||||||
|
dunst.colors.low.fg: SELECTED_FOREGROUND
|
||||||
|
dunst.colors.low.bg: SELECTED_BACKGROUND
|
||||||
|
dunst.colors.low.frame: BORDER
|
||||||
|
dunst.colors.low.highlight: MARKED_BG_COLOR
|
||||||
|
dunst.colors.norm.fg: BASE_FOREGROUND
|
||||||
|
dunst.colors.norm.bg: BASE_BACKGROUND
|
||||||
|
dunst.colors.norm.frame: BORDER
|
||||||
|
dunst.colors.norm.highlight: MARKED_BG_COLOR
|
||||||
|
dunst.colors.crit.fg: URGENT_FG_COLOR
|
||||||
|
dunst.colors.crit.bg: URGENT_BG_COLOR
|
||||||
|
dunst.colors.crit.frame: BORDER
|
||||||
|
dunst.colors.crit.highlight: MARKED_BG_COLOR
|
||||||
|
dunst.colors.frame_color: BORDER
|
13
duskwm/bin/test-dusk.sh
Executable file
13
duskwm/bin/test-dusk.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
Xephyr :1 -ac -dpi 107 -fullscreen -resizeable & # -dpi 180 -screen 1920x1080 &
|
||||||
|
# sleep 2
|
||||||
|
DISPLAY=:1 tym --daemon &
|
||||||
|
sleep 1
|
||||||
|
DISPLAY=:1 xrdb -load $HOME/.Xresources
|
||||||
|
DISPLAY=:1 ~/sources/duskwm/dusk/dusk &
|
||||||
|
# sleep 1
|
||||||
|
# DISPLAY=:1 duskc run_command xrdb
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
pkill Xephyr
|
Loading…
Add table
Reference in a new issue