Compare commits
51
Commits
d0684b5200
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be065bef95
|
||
|
|
9e2b6d52bb
|
||
|
|
85796d4c39
|
||
|
|
6e587622f0
|
||
|
|
5fa637ef79
|
||
|
|
a5f7d9507f
|
||
|
|
394e1d4d58
|
||
|
|
108f71e711
|
||
|
|
7e8328bf60
|
||
|
|
49141ef177
|
||
|
|
478e4d391e
|
||
|
|
e2fd3e4aa9
|
||
|
|
4a96319bb2
|
||
|
|
faad434dad
|
||
|
|
9896d9bb21
|
||
|
|
248a9b7d1f
|
||
|
|
216e1bff0f
|
||
|
|
472bf7246b
|
||
|
|
0d1cb6cf2a
|
||
|
|
96903a4d22
|
||
|
|
ce1cd479df
|
||
|
|
c103510786
|
||
|
|
3053b35f26
|
||
|
|
a260a42352
|
||
|
|
566ac562bd
|
||
|
|
3bb25669ea
|
||
|
|
84eec8c855
|
||
|
|
f6015f8d98
|
||
|
|
7aa423b6d6
|
||
|
|
b5c268ae7d
|
||
|
|
0ec1272df6
|
||
|
|
6f4aa3806f
|
||
|
|
9da7cc8105
|
||
|
|
93b5bcbf30
|
||
|
|
4c5ca29f6e
|
||
|
|
8bfd577b20
|
||
|
|
3a2d2b7c37
|
||
|
|
51b2bbeff8
|
||
|
|
b76ae5c3f6
|
||
|
|
90a81ea960
|
||
|
|
5b6e381c89
|
||
|
|
10bfc025c3
|
||
|
|
831238e040
|
||
|
|
cc8eaebd5f
|
||
|
|
a41afe4983
|
||
|
|
4e431d6710
|
||
|
|
68bbcaeb82
|
||
|
|
efea899ccb
|
||
|
|
15e6dfebb7
|
||
|
|
5d8620560a
|
||
|
|
496c16ab07
|
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
Xcursor.theme: Dracula
|
Xcursor.theme: Dracula-cursors
|
||||||
|
|
||||||
*.Dialog.bodyFont: Jetbrains Mono Nerd Font
|
*.Dialog.bodyFont: Jetbrains Mono Nerd Font
|
||||||
*.Dialog.headingFont: Jetbrains Mono Nerd Font
|
*.Dialog.headingFont: Jetbrains Mono Nerd Font
|
||||||
+1
-3
@@ -1,6 +1,5 @@
|
|||||||
# Aliases
|
# Aliases
|
||||||
alias cat='bat'
|
alias cat='bat'
|
||||||
alias clean-aurutils-cache='find ~/.cache/aurutils/sync -type d -name .git -execdir git clean -xi \;'
|
|
||||||
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
||||||
alias cookie='fortune /usr/share/fortune/asoiaf /usr/share/fortune/startrek | cowthink | lolcat -p 2.0 -F 0.3 -a -d 1'
|
alias cookie='fortune /usr/share/fortune/asoiaf /usr/share/fortune/startrek | cowthink | lolcat -p 2.0 -F 0.3 -a -d 1'
|
||||||
alias fastfetch='hyfetch --distro=arch'
|
alias fastfetch='hyfetch --distro=arch'
|
||||||
@@ -15,8 +14,7 @@ alias sort='sort -n'
|
|||||||
alias scrcpy='scrcpy --disable-screensaver'
|
alias scrcpy='scrcpy --disable-screensaver'
|
||||||
alias ssh='kitten ssh'
|
alias ssh='kitten ssh'
|
||||||
alias sudo='doas'
|
alias sudo='doas'
|
||||||
#alias trayer='trayer -l --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --transparent true --tint 0x232634 --height 18 --monitor 1'
|
alias trayer='trayer -l --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --transparent true --alpha 0 --tint 0x24283b --height 24 --monitor 1'
|
||||||
alias trayer='trayer -l --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --tint 0x232634 --height 18 --monitor 1'
|
|
||||||
alias trc='trash-empty'
|
alias trc='trash-empty'
|
||||||
alias trl='trash-list'
|
alias trl='trash-list'
|
||||||
alias trm='trash-rm'
|
alias trm='trash-rm'
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Thermal-focused overlay; starts hidden, Shift_R+F12 toggles it.
|
||||||
|
no_display
|
||||||
|
toggle_hud=Shift_R+F12
|
||||||
|
position=top-left
|
||||||
|
font_size=20
|
||||||
|
background_alpha=0.4
|
||||||
|
|
||||||
|
# Divisors of 60 Hz only; Shift_L+F1 cycles 60 -> 30 -> unlimited.
|
||||||
|
fps_limit=60,30,0
|
||||||
|
toggle_fps_limit=Shift_L+F1
|
||||||
|
fps_limit_method=late
|
||||||
|
|
||||||
|
# GPU0 is the Intel iGPU (no temp, power or VRAM); only show the NVIDIA one.
|
||||||
|
gpu_list=1
|
||||||
|
gpu_stats
|
||||||
|
gpu_temp
|
||||||
|
gpu_core_clock
|
||||||
|
throttling_status
|
||||||
|
|
||||||
|
cpu_stats
|
||||||
|
cpu_temp
|
||||||
|
cpu_mhz
|
||||||
|
|
||||||
|
vram
|
||||||
|
ram
|
||||||
|
|
||||||
|
fps
|
||||||
|
frametime
|
||||||
|
frame_timing
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
# Here rather than in LDFLAGS: old libtool (<2.4.7) drops -fuse-ld=lld, and these then reach GNU ld.
|
# Here rather than in LDFLAGS: old libtool (<2.4.7) drops -fuse-ld=lld, and these then reach GNU ld.
|
||||||
-fuse-ld=lld
|
-fuse-ld=lld
|
||||||
-Wl,--thinlto-cache-dir=/home/fuxino/.cache/thinlto
|
-Wl,--thinlto-cache-dir=/home/fuxino/.cache/thinlto
|
||||||
-Wl,--thinlto-cache-policy=cache_size_bytes=10g
|
-Wl,--thinlto-cache-policy=cache_size_bytes=10g:prune_after=0s
|
||||||
@@ -20,7 +20,7 @@ format.notifytime=%T
|
|||||||
format.appointmenttime=%H:%M
|
format.appointmenttime=%H:%M
|
||||||
format.outputdate=%F
|
format.outputdate=%F
|
||||||
format.dayheading=%B %e, %Y
|
format.dayheading=%B %e, %Y
|
||||||
general.autogc=no
|
general.autogc=yes
|
||||||
general.autosave=yes
|
general.autosave=yes
|
||||||
general.confirmdelete=yes
|
general.confirmdelete=yes
|
||||||
general.confirmquit=yes
|
general.confirmquit=yes
|
||||||
@@ -28,6 +28,6 @@ general.firstdayofweek=monday
|
|||||||
general.multipledays=yes
|
general.multipledays=yes
|
||||||
general.periodicsave=0
|
general.periodicsave=0
|
||||||
general.systemevents=yes
|
general.systemevents=yes
|
||||||
notification.command=calcurse --next | xargs -0 notify-send "Appointment"
|
notification.command=calcurse --next | xargs -0 notify-send -a calcurse -i x-office-calendar "Appointment"
|
||||||
notification.notifyall=all
|
notification.notifyall=all
|
||||||
notification.warning=3600
|
notification.warning=3600
|
||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Sync the UI's saved changes once it exits (syncing while it runs would change files under it).
|
||||||
|
[ "$(ps -o args= -p "$PPID")" = calcurse ] && [ "$(ps -o tty= -p "$PPID" | tr -d ' ')" != '?' ] || exit 0
|
||||||
|
# shellcheck disable=SC2016 # $1 expands in the inner shell
|
||||||
|
setsid -f sh -c 'while kill -0 "$1" 2>/dev/null; do sleep 1; done; systemctl --user start calcurse-sync.service' \
|
||||||
|
sh "$PPID" >/dev/null 2>&1
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Sync with Google before the UI loads. Non-interactive calls (-Q, -d, -i, calcurse-caldav's own) run this hook
|
||||||
|
# too, so act only for the UI: a bare "calcurse" with a terminal (the daemon is bare too, but has none).
|
||||||
|
[ "$(ps -o args= -p "$PPID")" = calcurse ] && [ "$(ps -o tty= -p "$PPID" | tr -d ' ')" != '?' ] || exit 0
|
||||||
|
calcurse-sync --now 2>&1 | systemd-cat -t calcurse-sync
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
# Always-on Remote Control
|
||||||
|
|
||||||
|
Reference copy of a machine setup: Claude Code Remote Control running as its own system user `claude-rc`, so my
|
||||||
|
projects' read-only MCP servers (now: negsplit, ens-forecast) can be used from the Claude app on the phone. One user and one
|
||||||
|
session (`data`) for all projects. The user holds only read-only database logins; Bash runs sandboxed without
|
||||||
|
network and can't read them (only the MCP servers, which run outside the sandbox, do). Nothing secret in this
|
||||||
|
folder: the ntfy topic lives only in `/etc/claude-rc-notify.env`.
|
||||||
|
|
||||||
|
Needs `claude-code`, `bubblewrap`, `socat` and each project's MCP server installed. Per project:
|
||||||
|
|
||||||
|
- negsplit: the installed `negsplit` (with `python-mcp`) and the `garmin_ro` grants from its
|
||||||
|
`sql/garmin_ro_grants.sql`. A per-user query limit is a useful safety net (the session can lift it):
|
||||||
|
|
||||||
|
```
|
||||||
|
mariadb -u root -p -e "ALTER USER 'garmin_ro'@'localhost' WITH MAX_STATEMENT_TIME 30;"
|
||||||
|
```
|
||||||
|
- ens-forecast: the installed `ens-forecast-mcp` (with `python-mcp` and `python-mysqlclient`) and the `weather_ro`
|
||||||
|
grant from its `sql/weather_grants.sql`; the same safety net:
|
||||||
|
|
||||||
|
```
|
||||||
|
mariadb -u root -p -e "ALTER USER 'weather_ro'@'localhost' WITH MAX_STATEMENT_TIME 30;"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
Run from this folder. User and folders:
|
||||||
|
|
||||||
|
```
|
||||||
|
doas useradd --system --create-home --home-dir /var/lib/claude-rc --shell /usr/bin/nologin claude-rc
|
||||||
|
doas chmod 700 /var/lib/claude-rc
|
||||||
|
doas install -d -o claude-rc -g claude-rc -m 700 /var/lib/claude-rc/.config /var/lib/claude-rc/.claude /var/lib/claude-rc/data /var/lib/claude-rc/data/.claude
|
||||||
|
doas install -o claude-rc -g claude-rc -m 644 mcp.json /var/lib/claude-rc/data/.mcp.json
|
||||||
|
doas install -o claude-rc -g claude-rc -m 644 project-settings.json /var/lib/claude-rc/data/.claude/settings.json
|
||||||
|
doas install -o claude-rc -g claude-rc -m 644 user-settings.json /var/lib/claude-rc/.claude/settings.json
|
||||||
|
```
|
||||||
|
|
||||||
|
`strictAllowlist` must stay in the user settings: in project settings it has no effect.
|
||||||
|
|
||||||
|
Each project's config holds only a `[readonly]` section. negsplit (`garmin_ro`):
|
||||||
|
|
||||||
|
```
|
||||||
|
doas install -d -o claude-rc -g claude-rc -m 700 /var/lib/claude-rc/.config/negsplit
|
||||||
|
doas install -o claude-rc -g claude-rc -m 600 config.toml /var/lib/claude-rc/.config/negsplit/config.toml
|
||||||
|
```
|
||||||
|
|
||||||
|
ens-forecast (`weather_ro`): only the `[readonly]` section of my own config, so the password never shows:
|
||||||
|
|
||||||
|
```
|
||||||
|
doas install -d -o claude-rc -g claude-rc -m 700 /var/lib/claude-rc/.config/ens-forecast
|
||||||
|
awk '/^\[/ { keep = ($0 == "[readonly]") } keep' ~/.config/ens-forecast/config.toml | doas install -o claude-rc -g claude-rc -m 600 /dev/stdin /var/lib/claude-rc/.config/ens-forecast/config.toml
|
||||||
|
```
|
||||||
|
|
||||||
|
Log in, trust the folder and enable Remote Control once, interactively:
|
||||||
|
|
||||||
|
```
|
||||||
|
doas -u claude-rc sh -c 'cd /var/lib/claude-rc/data && exec claude auth login'
|
||||||
|
doas -u claude-rc sh -c 'cd /var/lib/claude-rc/data && exec claude'
|
||||||
|
doas -u claude-rc sh -c 'cd /var/lib/claude-rc/data && exec claude remote-control --name data --spawn session'
|
||||||
|
```
|
||||||
|
|
||||||
|
ntfy topic for the failure alert (subscribe to it on ntfy.sh), then the units:
|
||||||
|
|
||||||
|
```
|
||||||
|
doas sh -c 'umask 077; printf "NTFY_TOPIC=claude-rc-%s\n" "$(openssl rand -hex 16)" > /etc/claude-rc-notify.env'
|
||||||
|
doas install -m 644 claude-rc.service claude-rc-notify.service claude-rc-recover.service claude-rc-recover.timer -t /etc/systemd/system/
|
||||||
|
doas systemctl daemon-reload
|
||||||
|
doas systemctl enable --now claude-rc.service claude-rc-recover.timer
|
||||||
|
```
|
||||||
|
|
||||||
|
The service restarts with a growing delay (30 s to 10 min); after about 50 minutes of failures it gives up and
|
||||||
|
sends the alert. The timer restarts it every 3 hours if it gave up, so a long network outage doesn't stop it for
|
||||||
|
good. After upgrading a project's MCP server, or changing `mcp.json` or the settings, restart `claude-rc.service`
|
||||||
|
so phone sessions use the new version.
|
||||||
|
|
||||||
|
## Adding a project
|
||||||
|
|
||||||
|
Add its server to `mcp.json` and `mcp__<server>` to the `allow` list in `project-settings.json` (plus a `Read` rule
|
||||||
|
for its chart folder, if any), install its `[readonly]` config as above, reinstall the changed files and restart
|
||||||
|
the service.
|
||||||
|
|
||||||
|
## Dead login
|
||||||
|
|
||||||
|
```
|
||||||
|
doas systemctl stop claude-rc.service
|
||||||
|
doas -u claude-rc sh -c 'cd /var/lib/claude-rc/data && exec claude auth login'
|
||||||
|
doas systemctl reset-failed claude-rc.service
|
||||||
|
doas systemctl start claude-rc.service
|
||||||
|
```
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Notify via ntfy that Claude Remote Control stopped
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
DynamicUser=yes
|
||||||
|
# NTFY_TOPIC=...: root-only (0600), the topic is the only secret
|
||||||
|
EnvironmentFile=/etc/claude-rc-notify.env
|
||||||
|
TimeoutStartSec=10min
|
||||||
|
ExecStart=/usr/bin/curl -fsS -m 30 --retry 5 --retry-delay 60 --retry-all-errors \
|
||||||
|
-H "Title: Claude Remote Control stopped" -H "Tags: warning" \
|
||||||
|
-d "%H: claude-rc.service keeps failing (dead login?). Retried every 3 h; fix at home: claude auth login as claude-rc." \
|
||||||
|
https://ntfy.sh/${NTFY_TOPIC}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Restart Claude Remote Control if it gave up (e.g. after a long network outage)
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecCondition=/usr/bin/systemctl is-failed --quiet claude-rc.service
|
||||||
|
ExecStart=/usr/bin/systemctl reset-failed claude-rc.service
|
||||||
|
ExecStart=/usr/bin/systemctl start --no-block claude-rc.service
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Every 3 h, restart Claude Remote Control if it gave up
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=1h
|
||||||
|
OnUnitActiveSec=3h
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Claude Code Remote Control (read-only MCP servers)
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target mariadb.service
|
||||||
|
# about 50 min of failed starts (back-off below): give up and notify
|
||||||
|
StartLimitIntervalSec=1h
|
||||||
|
StartLimitBurst=8
|
||||||
|
OnFailure=claude-rc-notify.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=claude-rc
|
||||||
|
Group=claude-rc
|
||||||
|
WorkingDirectory=/var/lib/claude-rc/data
|
||||||
|
# strips credentials from subprocess environments; on Linux also sandboxes ! shell commands
|
||||||
|
Environment=CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1
|
||||||
|
ExecStart=/usr/bin/claude remote-control --name data --spawn session
|
||||||
|
Restart=always
|
||||||
|
RestartSec=30s
|
||||||
|
RestartSteps=4
|
||||||
|
RestartMaxDelaySec=10min
|
||||||
|
ProtectSystem=strict
|
||||||
|
ProtectHome=yes
|
||||||
|
ReadWritePaths=/var/lib/claude-rc
|
||||||
|
PrivateTmp=yes
|
||||||
|
NoNewPrivileges=yes
|
||||||
|
ProtectKernelTunables=yes
|
||||||
|
ProtectKernelModules=yes
|
||||||
|
ProtectControlGroups=yes
|
||||||
|
ProtectKernelLogs=yes
|
||||||
|
ProtectClock=yes
|
||||||
|
ProtectHostname=yes
|
||||||
|
CapabilityBoundingSet=
|
||||||
|
RestrictSUIDSGID=yes
|
||||||
|
RestrictRealtime=yes
|
||||||
|
LockPersonality=yes
|
||||||
|
# no RestrictNamespaces/MemoryDenyWriteExecute: the Bash sandbox (bubblewrap) needs user namespaces
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"negsplit": {
|
||||||
|
"command": "negsplit",
|
||||||
|
"args": ["mcp"]
|
||||||
|
},
|
||||||
|
"ens-forecast": {
|
||||||
|
"command": "ens-forecast-mcp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"defaultMode": "default",
|
||||||
|
"disableBypassPermissionsMode": "disable",
|
||||||
|
"disableAutoMode": "disable",
|
||||||
|
"allow": [
|
||||||
|
"mcp__negsplit",
|
||||||
|
"mcp__ens-forecast",
|
||||||
|
"Read(~/.local/share/negsplit/charts/**)"
|
||||||
|
],
|
||||||
|
"deny": [
|
||||||
|
"Read(~/.config/**)",
|
||||||
|
"Read(~/.claude/**)",
|
||||||
|
"Read(~/.claude.json)",
|
||||||
|
"Edit(~/.config/**)",
|
||||||
|
"Edit(~/.claude/**)",
|
||||||
|
"Edit(~/.claude.json)",
|
||||||
|
"Edit(./.claude/**)",
|
||||||
|
"Edit(./.mcp.json)",
|
||||||
|
"WebFetch",
|
||||||
|
"WebSearch"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sandbox": {
|
||||||
|
"enabled": true,
|
||||||
|
"failIfUnavailable": true,
|
||||||
|
"allowUnsandboxedCommands": false,
|
||||||
|
"autoAllowBashIfSandboxed": true,
|
||||||
|
"filesystem": {
|
||||||
|
"denyRead": ["~/.config", "~/.claude", "~/.claude.json"],
|
||||||
|
"denyWrite": ["./.claude", "./.mcp.json"]
|
||||||
|
},
|
||||||
|
"network": {
|
||||||
|
"allowedDomains": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"theme": "dark",
|
||||||
|
"sandbox": {
|
||||||
|
"network": {
|
||||||
|
"strictAllowlist": true,
|
||||||
|
"allowedDomains": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
width = (300, 500)
|
width = (300, 500)
|
||||||
|
|
||||||
# The maximum height of a single notification, excluding the frame.
|
# The maximum height of a single notification, excluding the frame.
|
||||||
height = (0, 300)
|
height = (0, 600)
|
||||||
|
|
||||||
# Position the notification in the top right corner
|
# Position the notification in the top right corner
|
||||||
origin = top-right
|
origin = top-right
|
||||||
@@ -300,7 +300,7 @@
|
|||||||
# * context_all: Open context menu for all notifications.
|
# * context_all: Open context menu for all notifications.
|
||||||
# These values can be strung together for each mouse event, and
|
# These values can be strung together for each mouse event, and
|
||||||
# will be executed in sequence.
|
# will be executed in sequence.
|
||||||
mouse_left_click = close_current
|
mouse_left_click = do_action, close_current
|
||||||
mouse_middle_click = do_action, close_current
|
mouse_middle_click = do_action, close_current
|
||||||
mouse_right_click = close_all
|
mouse_right_click = close_all
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ if status is-interactive
|
|||||||
|
|
||||||
fastfetch
|
fastfetch
|
||||||
|
|
||||||
cookie
|
|
||||||
|
|
||||||
calcurse -d 7
|
|
||||||
|
|
||||||
starship init fish | source
|
starship init fish | source
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[general]
|
||||||
|
inhibit_screensaver=1
|
||||||
|
renice=10
|
||||||
|
; performance gave no gain: the CPU is heat-limited at 95 °C either way
|
||||||
|
desiredgov=powersave
|
||||||
@@ -13,4 +13,4 @@ gtk-enable-event-sounds=1
|
|||||||
gtk-enable-input-feedback-sounds=1
|
gtk-enable-input-feedback-sounds=1
|
||||||
gtk-xft-antialias=1
|
gtk-xft-antialias=1
|
||||||
gtk-xft-hinting=1
|
gtk-xft-hinting=1
|
||||||
gtk-xft-hintstyle=hintfull
|
gtk-xft-hintstyle=hintmedium
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -36,6 +36,7 @@ set cleaner ~/.config/lf/lf_kitty_clean
|
|||||||
# text files and a file opener for the rest.
|
# text files and a file opener for the rest.
|
||||||
cmd open &{{
|
cmd open &{{
|
||||||
case $(file --mime-type -Lb $f) in
|
case $(file --mime-type -Lb $f) in
|
||||||
|
text/html) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;;
|
||||||
text/*) lf -remote "send $id \$$EDITOR \$fx";;
|
text/*) lf -remote "send $id \$$EDITOR \$fx";;
|
||||||
application/json) lf -remote "send $id \$$EDITOR \$fx";;
|
application/json) lf -remote "send $id \$$EDITOR \$fx";;
|
||||||
video/*) movie $fx > /dev/null 2> /dev/null;;
|
video/*) movie $fx > /dev/null 2> /dev/null;;
|
||||||
|
|||||||
+3
-399
@@ -1,425 +1,29 @@
|
|||||||
# An example configuration file for MPD.
|
|
||||||
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
|
|
||||||
|
|
||||||
|
|
||||||
# Files and directories #######################################################
|
|
||||||
#
|
|
||||||
# This setting controls the top directory which MPD will search to discover the
|
|
||||||
# available audio files and add them to the daemon's online database. This
|
|
||||||
# setting defaults to the XDG directory, otherwise the music directory will be
|
|
||||||
# be disabled and audio files will only be accepted over ipc socket (using
|
|
||||||
# file:// protocol) or streaming files over an accepted protocol.
|
|
||||||
#
|
|
||||||
music_directory "~/Music"
|
music_directory "~/Music"
|
||||||
#
|
|
||||||
# This setting sets the MPD internal playlist directory. The purpose of this
|
|
||||||
# directory is storage for playlists created by MPD. The server will use
|
|
||||||
# playlist files not created by the server but only if they are in the MPD
|
|
||||||
# format. This setting defaults to playlist saving being disabled.
|
|
||||||
#
|
|
||||||
playlist_directory "~/.local/share/mpd/playlists"
|
playlist_directory "~/.local/share/mpd/playlists"
|
||||||
#
|
|
||||||
# This setting sets the location of the MPD database. This file is used to
|
|
||||||
# load the database at server start up and store the database while the
|
|
||||||
# server is not up. This setting defaults to disabled which will allow
|
|
||||||
# MPD to accept files over ipc socket (using file:// protocol) or streaming
|
|
||||||
# files over an accepted protocol.
|
|
||||||
#
|
|
||||||
db_file "~/.local/share/mpd/database"
|
db_file "~/.local/share/mpd/database"
|
||||||
#
|
|
||||||
# These settings are the locations for the daemon log files for the daemon.
|
|
||||||
# These logs are great for troubleshooting, depending on your log_level
|
|
||||||
# settings.
|
|
||||||
#
|
|
||||||
# The special value "syslog" makes MPD use the local syslog daemon. This
|
|
||||||
# setting defaults to logging to syslog, otherwise logging is disabled.
|
|
||||||
#
|
|
||||||
#log_file "~/.config/mpd/log"
|
|
||||||
#
|
|
||||||
# This setting sets the location of the file which stores the process ID
|
|
||||||
# for use of mpd --kill and some init scripts. This setting is disabled by
|
|
||||||
# default and the pid file will not be stored.
|
|
||||||
#
|
|
||||||
#pid_file "~/.config/mpd/pid"
|
|
||||||
#
|
|
||||||
# This setting sets the location of the file which contains information about
|
|
||||||
# most variables to get MPD back into the same general shape it was in before
|
|
||||||
# it was brought down. This setting is disabled by default and the server
|
|
||||||
# state will be reset on server start up.
|
|
||||||
#
|
|
||||||
state_file "~/.local/share/mpd/state"
|
state_file "~/.local/share/mpd/state"
|
||||||
#
|
|
||||||
# The location of the sticker database. This is a database which
|
|
||||||
# manages dynamic information attached to songs.
|
|
||||||
#
|
|
||||||
sticker_file "~/.local/share/mpd/sticker.sql"
|
sticker_file "~/.local/share/mpd/sticker.sql"
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
# General music daemon options ################################################
|
|
||||||
#
|
|
||||||
# This setting specifies the user that MPD will run as. MPD should never run as
|
|
||||||
# root and you may use this setting to make MPD change its user ID after
|
|
||||||
# initialization. This setting is disabled by default and MPD is run as the
|
|
||||||
# current user.
|
|
||||||
#
|
|
||||||
#user "nobody"
|
|
||||||
#
|
|
||||||
# This setting specifies the group that MPD will run as. If not specified
|
|
||||||
# primary group of user specified with "user" setting will be used (if set).
|
|
||||||
# This is useful if MPD needs to be a member of group such as "audio" to
|
|
||||||
# have permission to use sound card.
|
|
||||||
#
|
|
||||||
#group "nogroup"
|
|
||||||
#
|
|
||||||
# This setting sets the address for the daemon to listen on. Careful attention
|
|
||||||
# should be paid if this is assigned to anything other then the default, any.
|
|
||||||
# This setting can deny access to control of the daemon.
|
|
||||||
#
|
|
||||||
# For network
|
|
||||||
bind_to_address "127.0.0.1"
|
bind_to_address "127.0.0.1"
|
||||||
#
|
|
||||||
# And for Unix Socket
|
|
||||||
bind_to_address "~/.local/share/mpd/socket"
|
bind_to_address "~/.local/share/mpd/socket"
|
||||||
#
|
|
||||||
# This setting is the TCP port that is desired for the daemon to get assigned
|
|
||||||
# to.
|
|
||||||
#
|
|
||||||
#port "6600"
|
|
||||||
#
|
|
||||||
# This setting controls the type of information which is logged. Available
|
|
||||||
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
|
|
||||||
# argument is recommended for troubleshooting, though can quickly stretch
|
|
||||||
# available resources on limited hardware storage.
|
|
||||||
#
|
|
||||||
#log_level "default"
|
|
||||||
#
|
|
||||||
# If you have a problem with your MP3s ending abruptly it is recommended that
|
|
||||||
# you set this argument to "no" to attempt to fix the problem. If this solves
|
|
||||||
# the problem, it is highly recommended to fix the MP3 files with vbrfix
|
|
||||||
# (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
|
|
||||||
# point gapless MP3 playback can be enabled.
|
|
||||||
#
|
|
||||||
#gapless_mp3_playback "yes"
|
|
||||||
#
|
|
||||||
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
|
|
||||||
# of starting playback after startup.
|
|
||||||
#
|
|
||||||
restore_paused "yes"
|
restore_paused "yes"
|
||||||
#
|
|
||||||
# This setting enables MPD to create playlists in a format usable by other
|
|
||||||
# music players.
|
|
||||||
#
|
|
||||||
#save_absolute_paths_in_playlists "no"
|
|
||||||
#
|
|
||||||
# This setting defines a list of tag types that will be extracted during the
|
|
||||||
# audio file discovery process. The complete list of possible values can be
|
|
||||||
# found in the mpd.conf man page.
|
|
||||||
#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
|
|
||||||
#
|
|
||||||
# This setting enables automatic update of MPD's database when files in
|
|
||||||
# music_directory are changed.
|
|
||||||
#
|
|
||||||
auto_update "yes"
|
auto_update "yes"
|
||||||
#
|
replaygain "auto"
|
||||||
# Limit the depth of the directories being watched, 0 means only watch
|
|
||||||
# the music directory itself. There is no limit by default.
|
|
||||||
#
|
|
||||||
#auto_update_depth "3"
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
# Symbolic link behavior ######################################################
|
|
||||||
#
|
|
||||||
# If this setting is set to "yes", MPD will discover audio files by following
|
|
||||||
# symbolic links outside of the configured music_directory.
|
|
||||||
#
|
|
||||||
#follow_outside_symlinks "yes"
|
|
||||||
#
|
|
||||||
# If this setting is set to "yes", MPD will discover audio files by following
|
|
||||||
# symbolic links inside of the configured music_directory.
|
|
||||||
#
|
|
||||||
#follow_inside_symlinks "yes"
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
# Zeroconf / Avahi Service Discovery ##########################################
|
|
||||||
#
|
|
||||||
# If this setting is set to "yes", service information will be published with
|
|
||||||
# Zeroconf / Avahi.
|
|
||||||
#
|
|
||||||
#zeroconf_enabled "yes"
|
|
||||||
#
|
|
||||||
# The argument to this setting will be the Zeroconf / Avahi unique name for
|
|
||||||
# this MPD server on the network.
|
|
||||||
#
|
|
||||||
#zeroconf_name "Music Player"
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
# Permissions #################################################################
|
|
||||||
#
|
|
||||||
# If this setting is set, MPD will require password authorization. The password
|
|
||||||
# can setting can be specified multiple times for different password profiles.
|
|
||||||
#
|
|
||||||
#password "password@read,add,control,admin"
|
|
||||||
#
|
|
||||||
# This setting specifies the permissions a user has who has not yet logged in.
|
|
||||||
#
|
|
||||||
#default_permissions "read,add,control,admin"
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
# Database #######################################################################
|
|
||||||
#
|
|
||||||
|
|
||||||
#database {
|
|
||||||
# plugin "proxy"
|
|
||||||
# host "other.mpd.host"
|
|
||||||
# port "6600"
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Input #######################################################################
|
|
||||||
#
|
|
||||||
|
|
||||||
input {
|
input {
|
||||||
plugin "curl"
|
plugin "curl"
|
||||||
# proxy "proxy.isp.com:8080"
|
|
||||||
# proxy_user "user"
|
|
||||||
# proxy_password "password"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Audio Output ################################################################
|
|
||||||
#
|
|
||||||
# MPD supports various audio output types, as well as playing through multiple
|
|
||||||
# audio outputs at the same time, through multiple audio_output settings
|
|
||||||
# blocks. Setting this block is optional, though the server will only attempt
|
|
||||||
# autodetection for one sound card.
|
|
||||||
#
|
|
||||||
# An example of an ALSA output:
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "alsa"
|
|
||||||
# name "My ALSA Device"
|
|
||||||
# device "hw:0,0" # optional
|
|
||||||
# mixer_type "software" # optional
|
|
||||||
## mixer_device "default" # optional
|
|
||||||
## mixer_control "PCM" # optional
|
|
||||||
## mixer_index "0" # optional
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
audio_output {
|
audio_output {
|
||||||
type "pipewire"
|
type "pipewire"
|
||||||
name "Pipewire MPD"
|
name "Pipewire MPD"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Feeds ncmpcpp's visualizer
|
||||||
audio_output {
|
audio_output {
|
||||||
type "fifo"
|
type "fifo"
|
||||||
name "my_fifo"
|
name "my_fifo"
|
||||||
path "/tmp/mpd.fifo"
|
path "/tmp/mpd.fifo"
|
||||||
format "44100:16:2"
|
format "44100:16:2"
|
||||||
}
|
}
|
||||||
#
|
|
||||||
# An example of an OSS output:
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "oss"
|
|
||||||
# name "My OSS Device"
|
|
||||||
## device "/dev/dsp" # optional
|
|
||||||
## mixer_type "hardware" # optional
|
|
||||||
## mixer_device "/dev/mixer" # optional
|
|
||||||
## mixer_control "PCM" # optional
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# An example of a shout output (for streaming to Icecast):
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "shout"
|
|
||||||
# encoding "ogg" # optional
|
|
||||||
# name "My Shout Stream"
|
|
||||||
# host "localhost"
|
|
||||||
# port "8000"
|
|
||||||
# mount "/mpd.ogg"
|
|
||||||
# password "hackme"
|
|
||||||
# quality "5.0"
|
|
||||||
# bitrate "128"
|
|
||||||
# format "44100:16:1"
|
|
||||||
## protocol "icecast2" # optional
|
|
||||||
## user "source" # optional
|
|
||||||
## description "My Stream Description" # optional
|
|
||||||
## url "http://example.com" # optional
|
|
||||||
## genre "jazz" # optional
|
|
||||||
## public "no" # optional
|
|
||||||
## timeout "2" # optional
|
|
||||||
## mixer_type "software" # optional
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# An example of a recorder output:
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "recorder"
|
|
||||||
# name "My recorder"
|
|
||||||
# encoder "vorbis" # optional, vorbis or lame
|
|
||||||
# path "/var/lib/mpd/recorder/mpd.ogg"
|
|
||||||
## quality "5.0" # do not define if bitrate is defined
|
|
||||||
# bitrate "128" # do not define if quality is defined
|
|
||||||
# format "44100:16:1"
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# An example of a httpd output (built-in HTTP streaming server):
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "httpd"
|
|
||||||
# name "My HTTP Stream"
|
|
||||||
# encoder "vorbis" # optional, vorbis or lame
|
|
||||||
# port "8000"
|
|
||||||
# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
|
|
||||||
## quality "5.0" # do not define if bitrate is defined
|
|
||||||
# bitrate "128" # do not define if quality is defined
|
|
||||||
# format "44100:16:1"
|
|
||||||
# max_clients "0" # optional 0=no limit
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# An example of a pulseaudio output (streaming to a remote pulseaudio server)
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "pulse"
|
|
||||||
# name "My Pulse Output"
|
|
||||||
## server "remote_server" # optional
|
|
||||||
## sink "remote_server_sink" # optional
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# An example of a winmm output (Windows multimedia API).
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "winmm"
|
|
||||||
# name "My WinMM output"
|
|
||||||
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
|
|
||||||
# or
|
|
||||||
## device "0" # optional
|
|
||||||
## mixer_type "hardware" # optional
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# An example of an openal output.
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "openal"
|
|
||||||
# name "My OpenAL output"
|
|
||||||
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
## Example "pipe" output:
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "pipe"
|
|
||||||
# name "my pipe"
|
|
||||||
# command "aplay -f cd 2>/dev/null"
|
|
||||||
## Or if you're want to use AudioCompress
|
|
||||||
# command "AudioCompress -m | aplay -f cd 2>/dev/null"
|
|
||||||
## Or to send raw PCM stream through PCM:
|
|
||||||
# command "nc example.org 8765"
|
|
||||||
# format "44100:16:2"
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
## An example of a null output (for no audio output):
|
|
||||||
#
|
|
||||||
#audio_output {
|
|
||||||
# type "null"
|
|
||||||
# name "My Null Output"
|
|
||||||
# mixer_type "none" # optional
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# If MPD has been compiled with libsamplerate support, this setting specifies
|
|
||||||
# the sample rate converter to use. Possible values can be found in the
|
|
||||||
# mpd.conf man page or the libsamplerate documentation. By default, this is
|
|
||||||
# setting is disabled.
|
|
||||||
#
|
|
||||||
#samplerate_converter "Fastest Sinc Interpolator"
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
# Normalization automatic volume adjustments ##################################
|
|
||||||
#
|
|
||||||
# This setting specifies the type of ReplayGain to use. This setting can have
|
|
||||||
# the argument "off", "album", "track" or "auto". "auto" is a special mode that
|
|
||||||
# chooses between "track" and "album" depending on the current state of
|
|
||||||
# random playback. If random playback is enabled then "track" mode is used.
|
|
||||||
# See <http://www.replaygain.org> for more details about ReplayGain.
|
|
||||||
# This setting is off by default.
|
|
||||||
#
|
|
||||||
replaygain "auto"
|
|
||||||
#
|
|
||||||
# This setting sets the pre-amp used for files that have ReplayGain tags. By
|
|
||||||
# default this setting is disabled.
|
|
||||||
#
|
|
||||||
#replaygain_preamp "0"
|
|
||||||
#
|
|
||||||
# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
|
|
||||||
# By default this setting is disabled.
|
|
||||||
#
|
|
||||||
#replaygain_missing_preamp "0"
|
|
||||||
#
|
|
||||||
# This setting enables or disables ReplayGain limiting.
|
|
||||||
# MPD calculates actual amplification based on the ReplayGain tags
|
|
||||||
# and replaygain_preamp / replaygain_missing_preamp setting.
|
|
||||||
# If replaygain_limit is enabled MPD will never amplify audio signal
|
|
||||||
# above its original level. If replaygain_limit is disabled such amplification
|
|
||||||
# might occur. By default this setting is enabled.
|
|
||||||
#
|
|
||||||
#replaygain_limit "yes"
|
|
||||||
#
|
|
||||||
# This setting enables on-the-fly normalization volume adjustment. This will
|
|
||||||
# result in the volume of all playing audio to be adjusted so the output has
|
|
||||||
# equal "loudness". This setting is disabled by default.
|
|
||||||
#
|
|
||||||
#volume_normalization "no"
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Character Encoding ##########################################################
|
|
||||||
#
|
|
||||||
# If file or directory names do not display correctly for your locale then you
|
|
||||||
# may need to modify this setting.
|
|
||||||
#
|
|
||||||
#filesystem_charset "UTF-8"
|
|
||||||
#
|
|
||||||
# This setting controls the encoding that ID3v1 tags should be converted from.
|
|
||||||
#
|
|
||||||
#id3v1_encoding "ISO-8859-1"
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
|
|
||||||
# SIDPlay decoder #############################################################
|
|
||||||
#
|
|
||||||
# songlength_database:
|
|
||||||
# Location of your songlengths file, as distributed with the HVSC.
|
|
||||||
# The sidplay plugin checks this for matching MD5 fingerprints.
|
|
||||||
# See http://www.c64.org/HVSC/DOCUMENTS/Songlengths.faq
|
|
||||||
#
|
|
||||||
# default_songlength:
|
|
||||||
# This is the default playing time in seconds for songs not in the
|
|
||||||
# songlength database, or in case you're not using a database.
|
|
||||||
# A value of 0 means play indefinitely.
|
|
||||||
#
|
|
||||||
# filter:
|
|
||||||
# Turns the SID filter emulation on or off.
|
|
||||||
#
|
|
||||||
#decoder {
|
|
||||||
# plugin "sidplay"
|
|
||||||
# songlength_database "/media/C64Music/DOCUMENTS/Songlengths.txt"
|
|
||||||
# default_songlength "120"
|
|
||||||
# filter "true"
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
+5
-139
@@ -1,148 +1,14 @@
|
|||||||
#
|
# Video
|
||||||
# Example mpv configuration file
|
|
||||||
#
|
|
||||||
# Warning:
|
|
||||||
#
|
|
||||||
# The commented example options usually do _not_ set the default values. Call
|
|
||||||
# mpv with --list-options to see the default values for most options. There is
|
|
||||||
# no builtin or example mpv.conf with all the defaults.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Configuration files are read system-wide from /usr/local/etc/mpv.conf
|
|
||||||
# and per-user from ~/.config/mpv/mpv.conf, where per-user settings override
|
|
||||||
# system-wide settings, all of which are overridden by the command line.
|
|
||||||
#
|
|
||||||
# Configuration file settings and the command line options use the same
|
|
||||||
# underlying mechanisms. Most options can be put into the configuration file
|
|
||||||
# by dropping the preceding '--'. See the man page for a complete list of
|
|
||||||
# options.
|
|
||||||
#
|
|
||||||
# Lines starting with '#' are comments and are ignored.
|
|
||||||
#
|
|
||||||
# See the CONFIGURATION FILES section in the man page
|
|
||||||
# for a detailed description of the syntax.
|
|
||||||
#
|
|
||||||
# Profiles should be placed at the bottom of the configuration file to ensure
|
|
||||||
# that settings wanted as defaults are not restricted to specific profiles.
|
|
||||||
|
|
||||||
##################
|
|
||||||
# video settings #
|
|
||||||
##################
|
|
||||||
|
|
||||||
# Start in fullscreen mode by default.
|
|
||||||
fs=yes
|
fs=yes
|
||||||
|
profile=high-quality
|
||||||
|
hwdec=auto-safe
|
||||||
|
|
||||||
# force starting with centered window
|
# Smooth playback: match video speed to the display refresh rate and blend frames
|
||||||
#geometry=50%:50%
|
|
||||||
|
|
||||||
# don't allow a new window to have a size larger than 90% of the screen size
|
|
||||||
#autofit-larger=90%x90%
|
|
||||||
|
|
||||||
# Do not close the window on exit.
|
|
||||||
#keep-open=yes
|
|
||||||
|
|
||||||
# Do not wait with showing the video window until it has loaded. (This will
|
|
||||||
# resize the window once video is loaded. Also always shows a window with
|
|
||||||
# audio.)
|
|
||||||
#force-window=immediate
|
|
||||||
|
|
||||||
# Disable the On Screen Controller (OSC).
|
|
||||||
#osc=no
|
|
||||||
|
|
||||||
# Keep the player window on top of all other windows.
|
|
||||||
#ontop=yes
|
|
||||||
|
|
||||||
# Specify high quality video rendering preset (for --vo=gpu only)
|
|
||||||
# Can cause performance problems with some drivers and GPUs.
|
|
||||||
profile=gpu-hq
|
|
||||||
scale=ewa_lanczossharp
|
|
||||||
cscale=ewa_lanczossharp
|
|
||||||
video-sync=display-resample
|
video-sync=display-resample
|
||||||
interpolation
|
interpolation
|
||||||
tscale=oversample
|
tscale=oversample
|
||||||
|
|
||||||
# Force video to lock on the display's refresh rate, and change video and audio
|
|
||||||
# speed to some degree to ensure synchronous playback - can cause problems
|
|
||||||
# with some drivers and desktop environments.
|
|
||||||
#video-sync=display-resample
|
|
||||||
|
|
||||||
# Enable hardware decoding if available. Often, this does not work with all
|
|
||||||
# video outputs, but should work well with default settings on most systems.
|
|
||||||
# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs
|
|
||||||
# may or may not help.
|
|
||||||
hwdec=auto
|
|
||||||
|
|
||||||
ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080]
|
ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080]
|
||||||
|
|
||||||
##################
|
# Audio
|
||||||
# audio settings #
|
|
||||||
##################
|
|
||||||
|
|
||||||
#ao=alsa
|
|
||||||
volume=100
|
volume=100
|
||||||
|
|
||||||
# Specify default audio device. You can list devices with: --audio-device=help
|
|
||||||
# The option takes the device string (the stuff between the '...').
|
|
||||||
#audio-device=alsa/default
|
|
||||||
|
|
||||||
# Do not filter audio to keep pitch when changing playback speed.
|
|
||||||
#audio-pitch-correction=no
|
|
||||||
|
|
||||||
# Output 5.1 audio natively, and upmix/downmix audio with a different format.
|
|
||||||
#audio-channels=5.1
|
|
||||||
# Disable any automatic remix, _if_ the audio output accepts the audio format.
|
|
||||||
# of the currently played file. See caveats mentioned in the manpage.
|
|
||||||
# (The default is "auto-safe", see manpage.)
|
|
||||||
#audio-channels=auto
|
|
||||||
|
|
||||||
##################
|
|
||||||
# other settings #
|
|
||||||
##################
|
|
||||||
|
|
||||||
# Pretend to be a web browser. Might fix playback with some streaming sites,
|
|
||||||
# but also will break with shoutcast streams.
|
|
||||||
#user-agent="Mozilla/5.0"
|
|
||||||
|
|
||||||
# cache settings
|
|
||||||
#
|
|
||||||
# Use a large seekable RAM cache even for local input.
|
|
||||||
#cache=yes
|
|
||||||
#
|
|
||||||
# Use extra large RAM cache (needs cache=yes to make it useful).
|
|
||||||
#demuxer-max-bytes=500M
|
|
||||||
#demuxer-max-back-bytes=100M
|
|
||||||
#
|
|
||||||
# Disable the behavior that the player will pause if the cache goes below a
|
|
||||||
# certain fill size.
|
|
||||||
#cache-pause=no
|
|
||||||
#
|
|
||||||
# Store cache payload on the hard disk instead of in RAM. (This may negatively
|
|
||||||
# impact performance unless used for slow input such as network.)
|
|
||||||
#cache-dir=~/.cache/
|
|
||||||
#cache-on-disk=yes
|
|
||||||
|
|
||||||
# Display English subtitles if available.
|
|
||||||
#slang=en
|
|
||||||
|
|
||||||
# Play Finnish audio if available, fall back to English otherwise.
|
|
||||||
#alang=fi,en
|
|
||||||
|
|
||||||
# Change subtitle encoding. For Arabic subtitles use 'cp1256'.
|
|
||||||
# If the file seems to be valid UTF-8, prefer UTF-8.
|
|
||||||
# (You can add '+' in front of the codepage to force it.)
|
|
||||||
#sub-codepage=cp1256
|
|
||||||
|
|
||||||
# You can also include other configuration files.
|
|
||||||
#include=/path/to/the/file/you/want/to/include
|
|
||||||
|
|
||||||
############
|
|
||||||
# Profiles #
|
|
||||||
############
|
|
||||||
|
|
||||||
# The options declared as part of profiles override global default settings,
|
|
||||||
# but only take effect when the profile is active.
|
|
||||||
|
|
||||||
# The following profile can be enabled on the command line with: --profile=eye-cancer
|
|
||||||
|
|
||||||
#[eye-cancer]
|
|
||||||
#sharpen=5
|
|
||||||
@@ -1,114 +1,15 @@
|
|||||||
# -*-muttrc-*-
|
# -*-muttrc-*-
|
||||||
#
|
|
||||||
# Command formats for gpg.
|
|
||||||
#
|
|
||||||
# Some of the older commented-out versions of the commands use gpg-2comp from:
|
|
||||||
# http://70t.de/download/gpg-2comp.tar.gz
|
|
||||||
#
|
|
||||||
# %p The empty string when no passphrase is needed,
|
|
||||||
# the string "PGPPASSFD=0" if one is needed.
|
|
||||||
#
|
|
||||||
# This is mostly used in conditional % sequences.
|
|
||||||
#
|
|
||||||
# %f Most PGP commands operate on a single file or a file
|
|
||||||
# containing a message. %f expands to this file's name.
|
|
||||||
#
|
|
||||||
# %s When verifying signatures, there is another temporary file
|
|
||||||
# containing the detached signature. %s expands to this
|
|
||||||
# file's name.
|
|
||||||
#
|
|
||||||
# %a In "signing" contexts, this expands to the value of the
|
|
||||||
# configuration variable $pgp_sign_as, if set, otherwise
|
|
||||||
# $pgp_default_key. You probably need to
|
|
||||||
# use this within a conditional % sequence.
|
|
||||||
#
|
|
||||||
# %r In many contexts, mutt passes key IDs to pgp. %r expands to
|
|
||||||
# a list of key IDs.
|
|
||||||
|
|
||||||
|
|
||||||
# Section A: Key Management
|
|
||||||
|
|
||||||
# The default key for encryption (used by $pgp_self_encrypt and
|
|
||||||
# $postpone_encrypt).
|
|
||||||
#
|
|
||||||
# It will also be used for signing unless $pgp_sign_as is set to a
|
|
||||||
# key.
|
|
||||||
#
|
|
||||||
# Unless your key does not have encryption capability, uncomment this
|
|
||||||
# line and replace the keyid with your own.
|
|
||||||
#
|
|
||||||
# set pgp_default_key="0x12345678"
|
|
||||||
|
|
||||||
# If you have a separate signing key, or your key _only_ has signing
|
|
||||||
# capability, uncomment this line and replace the keyid with your
|
|
||||||
# signing keyid.
|
|
||||||
#
|
|
||||||
# set pgp_sign_as="0x87654321"
|
|
||||||
|
|
||||||
|
|
||||||
# Section B: Commands
|
|
||||||
|
|
||||||
# Note that we explicitly set the comment armor header since GnuPG, when used
|
|
||||||
# in some localiaztion environments, generates 8bit data in that header, thereby
|
|
||||||
# breaking PGP/MIME.
|
|
||||||
|
|
||||||
# decode application/pgp
|
|
||||||
set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
|
set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
|
||||||
|
|
||||||
# verify a pgp/mime signature
|
|
||||||
set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f"
|
set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f"
|
||||||
|
|
||||||
# decrypt a pgp/mime attachment
|
|
||||||
set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
|
set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
|
||||||
|
|
||||||
# create a pgp/mime signed attachment
|
|
||||||
# set pgp_sign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
|
|
||||||
set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
|
set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
|
||||||
|
|
||||||
# create a application/pgp signed (old-style) message
|
|
||||||
# set pgp_clearsign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
|
|
||||||
set pgp_clearsign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
|
set pgp_clearsign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
|
||||||
|
|
||||||
# create a pgp/mime encrypted attachment
|
|
||||||
# set pgp_encrypt_only_command="pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
|
|
||||||
set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
|
set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
|
||||||
|
|
||||||
# create a pgp/mime encrypted and signed attachment
|
|
||||||
# set pgp_encrypt_sign_command="pgpewrap gpg-2comp %?p?--passphrase-fd 0? -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
|
|
||||||
set pgp_encrypt_sign_command="pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
|
set pgp_encrypt_sign_command="pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
|
||||||
|
|
||||||
# import a key into the public key ring
|
|
||||||
set pgp_import_command="gpg --no-verbose --import %f"
|
set pgp_import_command="gpg --no-verbose --import %f"
|
||||||
|
|
||||||
# export a key from the public key ring
|
|
||||||
set pgp_export_command="gpg --no-verbose --export --armor %r"
|
set pgp_export_command="gpg --no-verbose --export --armor %r"
|
||||||
|
|
||||||
# verify a key
|
|
||||||
set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r"
|
set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r"
|
||||||
|
|
||||||
# read in the public key ring
|
|
||||||
# note: the second --with-fingerprint adds fingerprints to subkeys
|
|
||||||
set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r"
|
set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r"
|
||||||
|
|
||||||
# read in the secret key ring
|
|
||||||
# note: the second --with-fingerprint adds fingerprints to subkeys
|
|
||||||
set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r"
|
set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r"
|
||||||
|
|
||||||
# fetch keys
|
|
||||||
# set pgp_getkeys_command="pkspxycwrap %r"
|
|
||||||
|
|
||||||
# pattern for good signature - may need to be adapted to locale!
|
|
||||||
|
|
||||||
# set pgp_good_sign="^gpgv?: Good signature from "
|
|
||||||
|
|
||||||
# OK, here's a version which uses gnupg's message catalog:
|
|
||||||
# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`"
|
|
||||||
|
|
||||||
# This version uses --status-fd messages
|
|
||||||
set pgp_good_sign="^\\[GNUPG:\\] GOODSIG"
|
set pgp_good_sign="^\\[GNUPG:\\] GOODSIG"
|
||||||
|
|
||||||
# pattern to verify a decryption occurred
|
|
||||||
# This is now deprecated by pgp_check_gpg_decrypt_status_fd:
|
|
||||||
# set pgp_decryption_okay="^\\[GNUPG:\\] DECRYPTION_OKAY"
|
|
||||||
set pgp_check_gpg_decrypt_status_fd
|
set pgp_check_gpg_decrypt_status_fd
|
||||||
|
|
||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
macro pager \cb <pipe-entry>'urlscan'<enter> 'Follow links with urlview'
|
macro index,pager \cb "<pipe-message>urlscan<enter>" "Follow links with urlscan"
|
||||||
macro index,pager a "<pipe-message>abook --add-email-quiet<return>" "Add this sender to Abook"
|
macro index,pager a "<pipe-message>abook --add-email-quiet<return>" "Add this sender to Abook"
|
||||||
macro attach V "<pipe-entry>iconv -c --to-code=UTF8 > ~/.cache/mutt/mail.html<enter><shell-escape>vivaldi-stable ~/.cache/mutt/mail.html<enter>"
|
macro attach V "<pipe-entry>iconv -c --to-code=UTF8 > ~/.cache/mutt/html/mail.html<enter><shell-escape>zen-browser ~/.cache/mutt/html/mail.html >/dev/null 2>&1<enter>" "Open attachment in Zen"
|
||||||
@@ -29,6 +29,7 @@ bind editor <Tab> complete-query
|
|||||||
# Other settings
|
# Other settings
|
||||||
set header_cache = "~/.cache/mutt"
|
set header_cache = "~/.cache/mutt"
|
||||||
set message_cachedir = "~/.cache/mutt"
|
set message_cachedir = "~/.cache/mutt"
|
||||||
|
set message_cache_clean = yes
|
||||||
|
|
||||||
set timeout = 30
|
set timeout = 30
|
||||||
set editor = "vim"
|
set editor = "vim"
|
||||||
|
|||||||
@@ -1,116 +1,29 @@
|
|||||||
# This is a complete list of sidebar-related configuration.
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# VARIABLES - shown with their default values
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Should the Sidebar be shown?
|
|
||||||
set sidebar_visible = yes
|
set sidebar_visible = yes
|
||||||
|
|
||||||
# How wide should the Sidebar be in screen columns?
|
|
||||||
# Note: Some characters, e.g. Chinese, take up two columns each.
|
|
||||||
set sidebar_width = 20
|
set sidebar_width = 20
|
||||||
|
|
||||||
# Should the mailbox paths be abbreviated?
|
|
||||||
set sidebar_short_path = yes
|
set sidebar_short_path = yes
|
||||||
|
|
||||||
# When abbreviating mailbox path names, use any of these characters as path
|
|
||||||
# separators. Only the part after the last separators will be shown.
|
|
||||||
# For file folders '/' is good. For IMAP folders, often '.' is useful.
|
|
||||||
set sidebar_delim_chars = '/.'
|
set sidebar_delim_chars = '/.'
|
||||||
|
|
||||||
# If the mailbox path is abbreviated, should it be indented?
|
|
||||||
set sidebar_folder_indent = no
|
set sidebar_folder_indent = no
|
||||||
|
|
||||||
# Indent mailbox paths with this string.
|
|
||||||
set sidebar_indent_string = ' '
|
set sidebar_indent_string = ' '
|
||||||
|
|
||||||
# Make the Sidebar only display mailboxes that contain new, or flagged,
|
|
||||||
# mail.
|
|
||||||
set sidebar_new_mail_only = no
|
set sidebar_new_mail_only = no
|
||||||
|
|
||||||
# Any mailboxes that are whitelisted will always be visible, even if the
|
|
||||||
# sidebar_new_mail_only option is enabled.
|
|
||||||
sidebar_whitelist '/home/user/mailbox1'
|
sidebar_whitelist '/home/user/mailbox1'
|
||||||
sidebar_whitelist '/home/user/mailbox2'
|
sidebar_whitelist '/home/user/mailbox2'
|
||||||
|
|
||||||
# When searching for mailboxes containing new mail, should the search wrap
|
|
||||||
# around when it reaches the end of the list?
|
|
||||||
set sidebar_next_new_wrap = no
|
set sidebar_next_new_wrap = no
|
||||||
|
|
||||||
# The character to use as the divider between the Sidebar and the other Mutt
|
|
||||||
# panels.
|
|
||||||
# Note: Only the first character of this string is used.
|
|
||||||
set sidebar_divider_char = '|'
|
set sidebar_divider_char = '|'
|
||||||
|
|
||||||
# Enable extended buffy mode to calculate total, new, and flagged
|
|
||||||
# message counts for each mailbox.
|
|
||||||
set mail_check_stats
|
set mail_check_stats
|
||||||
|
|
||||||
# Display the Sidebar mailboxes using this format string.
|
|
||||||
set sidebar_format = '%B%?F? [%F]?%* %?N?%N/?%S'
|
set sidebar_format = '%B%?F? [%F]?%* %?N?%N/?%S'
|
||||||
|
|
||||||
# Sort the mailboxes in the Sidebar using this method:
|
|
||||||
# count - total number of messages
|
|
||||||
# flagged - number of flagged messages
|
|
||||||
# new - number of new messages
|
|
||||||
# path - mailbox path
|
|
||||||
# unsorted - do not sort the mailboxes
|
|
||||||
set sidebar_sort_method = 'unsorted'
|
set sidebar_sort_method = 'unsorted'
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# FUNCTIONS - shown with an example mapping
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Move the highlight to the previous mailbox
|
|
||||||
bind index,pager \Cp sidebar-prev
|
bind index,pager \Cp sidebar-prev
|
||||||
|
|
||||||
# Move the highlight to the next mailbox
|
|
||||||
bind index,pager \Cn sidebar-next
|
bind index,pager \Cn sidebar-next
|
||||||
|
|
||||||
# Open the highlighted mailbox
|
|
||||||
bind index,pager \Co sidebar-open
|
bind index,pager \Co sidebar-open
|
||||||
|
|
||||||
# Move the highlight to the previous page
|
|
||||||
# This is useful if you have a LOT of mailboxes.
|
|
||||||
bind index,pager <F3> sidebar-page-up
|
bind index,pager <F3> sidebar-page-up
|
||||||
|
|
||||||
# Move the highlight to the next page
|
|
||||||
# This is useful if you have a LOT of mailboxes.
|
|
||||||
bind index,pager <F4> sidebar-page-down
|
bind index,pager <F4> sidebar-page-down
|
||||||
|
|
||||||
# Move the highlight to the previous mailbox containing new, or flagged,
|
|
||||||
# mail.
|
|
||||||
bind index,pager <F5> sidebar-prev-new
|
bind index,pager <F5> sidebar-prev-new
|
||||||
|
|
||||||
# Move the highlight to the next mailbox containing new, or flagged, mail.
|
|
||||||
bind index,pager <F6> sidebar-next-new
|
bind index,pager <F6> sidebar-next-new
|
||||||
|
|
||||||
# Toggle the visibility of the Sidebar.
|
|
||||||
bind index,pager B sidebar-toggle-visible
|
bind index,pager B sidebar-toggle-visible
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# COLORS - some unpleasant examples are given
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Note: All color operations are of the form:
|
|
||||||
# color OBJECT FOREGROUND BACKGROUND
|
|
||||||
|
|
||||||
# Color of the current, open, mailbox
|
|
||||||
# Note: This is a general Mutt option which colors all selected items.
|
|
||||||
color indicator cyan black
|
color indicator cyan black
|
||||||
|
|
||||||
# Color of the highlighted, but not open, mailbox.
|
|
||||||
color sidebar_highlight black color8
|
color sidebar_highlight black color8
|
||||||
|
|
||||||
# Color of the divider separating the Sidebar from Mutt panels
|
|
||||||
color sidebar_divider color8 black
|
color sidebar_divider color8 black
|
||||||
|
|
||||||
# Color to give mailboxes containing flagged mail
|
|
||||||
color sidebar_flagged red black
|
color sidebar_flagged red black
|
||||||
|
|
||||||
# Color to give mailboxes containing new mail
|
|
||||||
color sidebar_new green black
|
color sidebar_new green black
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# vim: syntax=muttrc
|
|
||||||
+8
-574
@@ -1,598 +1,32 @@
|
|||||||
##############################################################
|
|
||||||
## This is an example configuration file. Copy it to ##
|
|
||||||
## $XDG_CONFIG_HOME/ncmpcpp/config or $HOME/.ncmpcpp/config ##
|
|
||||||
## and set up your preferences. ##
|
|
||||||
##############################################################
|
|
||||||
#
|
|
||||||
##### directories ######
|
|
||||||
##
|
|
||||||
## Directory for storing ncmpcpp related files. Changing it is useful if you
|
|
||||||
## want to store everything somewhere else and provide command line setting for
|
|
||||||
## alternative location to config file which defines that while launching
|
|
||||||
## ncmpcpp.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
ncmpcpp_directory = ~/.config/ncmpcpp
|
ncmpcpp_directory = ~/.config/ncmpcpp
|
||||||
#
|
|
||||||
##
|
|
||||||
## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other
|
|
||||||
## MPD clients (eg. ncmpc) also use that location.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
lyrics_directory = ~/.local/share/mpd/lyrics
|
lyrics_directory = ~/.local/share/mpd/lyrics
|
||||||
#
|
|
||||||
##### connection settings #####
|
# MPD
|
||||||
#
|
|
||||||
mpd_host = localhost
|
mpd_host = localhost
|
||||||
#
|
|
||||||
mpd_port = 6600
|
mpd_port = 6600
|
||||||
#
|
|
||||||
#mpd_connection_timeout = 5
|
|
||||||
#
|
|
||||||
## Needed for tag editor and file operations to work.
|
|
||||||
##
|
|
||||||
mpd_music_dir = ~/Music
|
mpd_music_dir = ~/Music
|
||||||
#
|
|
||||||
mpd_crossfade_time = 10
|
mpd_crossfade_time = 10
|
||||||
#
|
|
||||||
# Exclude pattern for random song action
|
# Visualizer (reads mpd's "my_fifo" output)
|
||||||
# http://www.boost.org/doc/libs/1_46_1/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
|
|
||||||
#random_exclude_pattern = "^(temp|midi_songs).*"
|
|
||||||
#
|
|
||||||
##### music visualizer #####
|
|
||||||
##
|
|
||||||
## In order to make music visualizer work with MPD you need to use the fifo
|
|
||||||
## output. Its format parameter has to be set to 44100:16:1 for mono
|
|
||||||
## visualization or 44100:16:2 for stereo visualization. As an example here is
|
|
||||||
## the relevant section for mpd.conf:
|
|
||||||
##
|
|
||||||
## audio_output {
|
|
||||||
## type "fifo"
|
|
||||||
## name "Visualizer feed"
|
|
||||||
## path "/tmp/mpd.fifo"
|
|
||||||
## format "44100:16:2"
|
|
||||||
## }
|
|
||||||
##
|
|
||||||
## If the visualization on occasion diverges from the audio output, please set
|
|
||||||
## 'buffer_time' parameter of your audio output in mpd.conf to '100000' (100ms)
|
|
||||||
## or less to prevent that from happening.
|
|
||||||
##
|
|
||||||
## Note: If you're using Mopidy, an address of a udpsink gstreamer's output is
|
|
||||||
## also accepted. For example, the following section in mopidy.conf:
|
|
||||||
##
|
|
||||||
## [audio]
|
|
||||||
## output = tee name=t ! queue ! autoaudiosink t.
|
|
||||||
## ! queue ! audio/x-raw,rate=44100,channels=2,format=S16LE
|
|
||||||
## ! udpsink host=localhost port=5555
|
|
||||||
##
|
|
||||||
## will make localhost:5555 available as a source of data for the stereo
|
|
||||||
## visualizer.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
visualizer_data_source = /tmp/mpd.fifo
|
visualizer_data_source = /tmp/mpd.fifo
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: Below parameter is needed for ncmpcpp to determine which output
|
|
||||||
## provides data for visualizer and reset it at the beginning of visualization
|
|
||||||
## to synchronize with audio.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
visualizer_output_name = "my_fifo"
|
visualizer_output_name = "my_fifo"
|
||||||
#
|
|
||||||
##
|
|
||||||
## If you set format to 44100:16:2, make it 'yes'.
|
|
||||||
##
|
|
||||||
visualizer_in_stereo = yes
|
visualizer_in_stereo = yes
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: set below to >=10 only if you have synchronization issues with
|
|
||||||
## visualization and audio.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
#visualizer_sync_interval = 0
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: To enable spectrum frequency visualization you need to compile ncmpcpp
|
|
||||||
## with fftw3 support.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
## Available values: spectrum, wave, wave_filled, ellipse.
|
|
||||||
##
|
|
||||||
visualizer_type = spectrum
|
visualizer_type = spectrum
|
||||||
#
|
|
||||||
#visualizer_fps = 60
|
|
||||||
#
|
|
||||||
#visualizer_autoscale = no
|
|
||||||
#
|
|
||||||
visualizer_look = ●▮
|
visualizer_look = ●▮
|
||||||
#
|
|
||||||
#visualizer_color = blue, cyan, green, yellow, magenta, red
|
# Interface
|
||||||
#
|
|
||||||
## Alternative subset of 256 colors for terminals that support it.
|
|
||||||
##
|
|
||||||
#visualizer_color = 47, 83, 119, 155, 191, 227, 221, 215, 209, 203, 197, 161
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: The next few visualization options apply to the spectrum visualizer.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
## Use unicode block characters for a smoother, more continuous look.
|
|
||||||
## This will override the visualizer_look option. With transparent terminals
|
|
||||||
## and visualizer_in_stereo set, artifacts may be visible on the bottom half of
|
|
||||||
## the visualization.
|
|
||||||
#
|
|
||||||
#visualizer_spectrum_smooth_look = yes
|
|
||||||
#
|
|
||||||
## A value between 1 and 5 inclusive. Specifying a larger value makes the
|
|
||||||
## visualizer look at a larger slice of time, which results in less jumpy
|
|
||||||
## visualizer output.
|
|
||||||
#
|
|
||||||
#visualizer_spectrum_dft_size = 2
|
|
||||||
#
|
|
||||||
#visualizer_spectrum_gain = 10
|
|
||||||
#
|
|
||||||
## Left-most frequency of visualizer in Hz, must be less than HZ MAX
|
|
||||||
#
|
|
||||||
#visualizer_spectrum_hz_min = 20
|
|
||||||
#
|
|
||||||
## Right-most frequency of visualizer in Hz, must be greater than HZ MIN
|
|
||||||
#
|
|
||||||
#visualizer_spectrum_hz_max = 20000
|
|
||||||
#
|
|
||||||
##### system encoding #####
|
|
||||||
##
|
|
||||||
## ncmpcpp should detect your charset encoding but if it failed to do so, you
|
|
||||||
## can specify charset encoding you are using here.
|
|
||||||
##
|
|
||||||
## Note: You can see whether your ncmpcpp build supports charset detection by
|
|
||||||
## checking output of `ncmpcpp --version`.
|
|
||||||
##
|
|
||||||
## Note: Since MPD uses UTF-8 by default, setting this option makes sense only
|
|
||||||
## if your encoding is different.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
#system_encoding = ""
|
|
||||||
#
|
|
||||||
##### delays #####
|
|
||||||
#
|
|
||||||
## Time of inactivity (in seconds) after playlist highlighting will be disabled
|
|
||||||
## (0 = always on).
|
|
||||||
##
|
|
||||||
#playlist_disable_highlight_delay = 5
|
|
||||||
#
|
|
||||||
## Defines how long messages are supposed to be visible.
|
|
||||||
##
|
|
||||||
#message_delay_time = 5
|
|
||||||
#
|
|
||||||
##### song format #####
|
|
||||||
##
|
|
||||||
## For a song format you can use:
|
|
||||||
##
|
|
||||||
## %l - length
|
|
||||||
## %f - filename
|
|
||||||
## %D - directory
|
|
||||||
## %a - artist
|
|
||||||
## %A - album artist
|
|
||||||
## %t - title
|
|
||||||
## %b - album
|
|
||||||
## %y - date
|
|
||||||
## %n - track number (01/12 -> 01)
|
|
||||||
## %N - full track info (01/12 -> 01/12)
|
|
||||||
## %g - genre
|
|
||||||
## %c - composer
|
|
||||||
## %p - performer
|
|
||||||
## %d - disc
|
|
||||||
## %C - comment
|
|
||||||
## %P - priority
|
|
||||||
## $R - begin right alignment
|
|
||||||
##
|
|
||||||
## If you want to make sure that a part of the format is displayed only when
|
|
||||||
## certain tags are present, you can archieve it by grouping them with brackets,
|
|
||||||
## e.g. '{%a - %t}' will be evaluated to 'ARTIST - TITLE' if both tags are
|
|
||||||
## present or '' otherwise. It is also possible to define a list of
|
|
||||||
## alternatives by providing several groups and separating them with '|',
|
|
||||||
## e.g. '{%t}|{%f}' will be evaluated to 'TITLE' or 'FILENAME' if the former is
|
|
||||||
## not present.
|
|
||||||
##
|
|
||||||
## Note: If you want to set limit on maximal length of a tag, just put the
|
|
||||||
## appropriate number between % and character that defines tag type, e.g. to
|
|
||||||
## make album take max. 20 terminal cells, use '%20b'.
|
|
||||||
##
|
|
||||||
## In addition, formats support markers used for text attributes. They are
|
|
||||||
## followed by character '$'. After that you can put:
|
|
||||||
##
|
|
||||||
## - 0 - default window color (discards all other colors)
|
|
||||||
## - 1 - black
|
|
||||||
## - 2 - red
|
|
||||||
## - 3 - green
|
|
||||||
## - 4 - yellow
|
|
||||||
## - 5 - blue
|
|
||||||
## - 6 - magenta
|
|
||||||
## - 7 - cyan
|
|
||||||
## - 8 - white
|
|
||||||
## - 9 - end of current color
|
|
||||||
## - b - bold text
|
|
||||||
## - u - underline text
|
|
||||||
## - r - reverse colors
|
|
||||||
## - a - use alternative character set
|
|
||||||
##
|
|
||||||
## If you don't want to use a non-color attribute anymore, just put it again,
|
|
||||||
## but this time insert character '/' between '$' and attribute character,
|
|
||||||
## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename with
|
|
||||||
## reversed colors.
|
|
||||||
##
|
|
||||||
## If you want to use 256 colors and/or background colors in formats (the naming
|
|
||||||
## scheme is described below in section about color definitions), it can be done
|
|
||||||
## with the syntax $(COLOR), e.g. to set the artist tag to one of the
|
|
||||||
## non-standard colors and make it have yellow background, you need to write
|
|
||||||
## $(197_yellow)%a$(end). Note that for standard colors this is interchangable
|
|
||||||
## with attributes listed above.
|
|
||||||
##
|
|
||||||
## Note: colors can be nested.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
#song_list_format = {%a - }{%t}|{$8%f$9}$R{$3%l$9}
|
|
||||||
#
|
|
||||||
#song_status_format = {{%a{ "%b"{ (%y)}} - }{%t}}|{%f}
|
|
||||||
#
|
|
||||||
#song_library_format = {%n - }{%t}|{%f}
|
|
||||||
#
|
|
||||||
#alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
|
|
||||||
#
|
|
||||||
#alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
|
|
||||||
#
|
|
||||||
#current_item_prefix = $(yellow)$r
|
|
||||||
#
|
|
||||||
#current_item_suffix = $/r$(end)
|
|
||||||
#
|
|
||||||
#current_item_inactive_column_prefix = $(white)$r
|
|
||||||
#
|
|
||||||
#current_item_inactive_column_suffix = $/r$(end)
|
|
||||||
#
|
|
||||||
#now_playing_prefix = $b
|
|
||||||
#
|
|
||||||
#now_playing_suffix = $/b
|
|
||||||
#
|
|
||||||
#browser_playlist_prefix = "$2playlist$9 "
|
|
||||||
#
|
|
||||||
#selected_item_prefix = $6
|
|
||||||
#
|
|
||||||
#selected_item_suffix = $9
|
|
||||||
#
|
|
||||||
#modified_item_prefix = $3> $9
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: attributes are not supported for the following variables.
|
|
||||||
##
|
|
||||||
#song_window_title_format = {%a - }{%t}|{%f}
|
|
||||||
##
|
|
||||||
## Note: Below variables are used for sorting songs in browser. The sort mode
|
|
||||||
## determines how songs are sorted, and can be used in combination with a sort
|
|
||||||
## format to specify a custom sorting format. Available values for
|
|
||||||
## browser_sort_mode are "type", "name", "mtime", "format" and "none".
|
|
||||||
##
|
|
||||||
#
|
|
||||||
#browser_sort_mode = type
|
|
||||||
#
|
|
||||||
#browser_sort_format = {%a - }{%t}|{%f} {%l}
|
|
||||||
#
|
|
||||||
##### columns settings #####
|
|
||||||
##
|
|
||||||
## syntax of song columns list format is "column column etc."
|
|
||||||
##
|
|
||||||
## - syntax for each column is:
|
|
||||||
##
|
|
||||||
## (width of the column)[color of the column]{displayed tag}
|
|
||||||
##
|
|
||||||
## Note: Width is by default in %, if you want a column to have fixed size, add
|
|
||||||
## 'f' after the value, e.g. (10)[white]{a} will be the column that take 10% of
|
|
||||||
## screen (so the real width will depend on actual screen size), whereas
|
|
||||||
## (10f)[white]{a} will take 10 terminal cells, no matter how wide the screen
|
|
||||||
## is.
|
|
||||||
##
|
|
||||||
## - color is optional (if you want the default one, leave the field empty).
|
|
||||||
##
|
|
||||||
## Note: You can give a column additional attributes by putting appropriate
|
|
||||||
## character after displayed tag character. Available attributes are:
|
|
||||||
##
|
|
||||||
## - r - column will be right aligned
|
|
||||||
## - E - if tag is empty, empty tag marker won't be displayed
|
|
||||||
##
|
|
||||||
## You can also:
|
|
||||||
##
|
|
||||||
## - give a column custom name by putting it after attributes, separated with
|
|
||||||
## character ':', e.g. {lr:Length} gives you right aligned column of lengths
|
|
||||||
## named "Length".
|
|
||||||
##
|
|
||||||
## - define sequence of tags, that have to be displayed in case predecessor is
|
|
||||||
## empty in a way similar to the one in classic song format, i.e. using '|'
|
|
||||||
## character, e.g. {a|c|p:Owner} creates column named "Owner" that tries to
|
|
||||||
## display artist tag and then composer and performer if previous ones are not
|
|
||||||
## available.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}
|
|
||||||
#
|
|
||||||
##### various settings #####
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: Custom command that will be executed each time song changes. Useful for
|
|
||||||
## notifications etc.
|
|
||||||
##
|
|
||||||
#execute_on_song_change =
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: Custom command that will be executed each time player state
|
|
||||||
## changes. The environment variable MPD_PLAYER_STATE is set to the current
|
|
||||||
## state (either unknown, play, pause, or stop) for its duration.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
#execute_on_player_state_change =
|
|
||||||
#
|
|
||||||
#playlist_show_mpd_host = no
|
|
||||||
#
|
|
||||||
#playlist_show_remaining_time = no
|
|
||||||
#
|
|
||||||
#playlist_shorten_total_times = no
|
|
||||||
#
|
|
||||||
#playlist_separate_albums = no
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: Possible display modes: classic, columns.
|
|
||||||
##
|
|
||||||
#playlist_display_mode = columns
|
|
||||||
#
|
|
||||||
#browser_display_mode = classic
|
|
||||||
#
|
|
||||||
#search_engine_display_mode = classic
|
|
||||||
#
|
|
||||||
#playlist_editor_display_mode = classic
|
|
||||||
#
|
|
||||||
#discard_colors_if_item_is_selected = yes
|
|
||||||
#
|
|
||||||
#show_duplicate_tags = yes
|
|
||||||
#
|
|
||||||
#incremental_seeking = yes
|
|
||||||
#
|
|
||||||
#seek_time = 1
|
|
||||||
#
|
|
||||||
#volume_change_step = 2
|
|
||||||
#
|
|
||||||
#autocenter_mode = no
|
|
||||||
#
|
|
||||||
#centered_cursor = no
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: You can specify third character which will be used to build 'empty'
|
|
||||||
## part of progressbar.
|
|
||||||
##
|
|
||||||
#progressbar_look = =>
|
|
||||||
#
|
|
||||||
## Available values: database, playlist.
|
|
||||||
##
|
|
||||||
#default_place_to_search_in = database
|
|
||||||
#
|
|
||||||
## Available values: classic, alternative.
|
|
||||||
##
|
|
||||||
user_interface = alternative
|
user_interface = alternative
|
||||||
#
|
|
||||||
#data_fetching_delay = yes
|
|
||||||
#
|
|
||||||
## Available values: artist, album_artist, date, genre, composer, performer.
|
|
||||||
##
|
|
||||||
media_library_primary_tag = album_artist
|
media_library_primary_tag = album_artist
|
||||||
#
|
|
||||||
#media_library_albums_split_by_date = yes
|
|
||||||
#
|
|
||||||
#media_library_hide_album_dates = no
|
|
||||||
#
|
|
||||||
## Available values: wrapped, normal.
|
|
||||||
##
|
|
||||||
#default_find_mode = wrapped
|
|
||||||
#
|
|
||||||
#default_tag_editor_pattern = %n - %t
|
|
||||||
#
|
|
||||||
#header_visibility = yes
|
|
||||||
#
|
|
||||||
#statusbar_visibility = yes
|
|
||||||
#
|
|
||||||
## Show the "Connected to ..." message on startup
|
|
||||||
#connected_message_on_startup = yes
|
|
||||||
#
|
|
||||||
#titles_visibility = yes
|
|
||||||
#
|
|
||||||
#header_text_scrolling = yes
|
|
||||||
#
|
|
||||||
#cyclic_scrolling = no
|
|
||||||
#
|
|
||||||
lyrics_fetchers = musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, genius, azlyrics, internet
|
lyrics_fetchers = musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, genius, azlyrics, internet
|
||||||
#
|
|
||||||
#follow_now_playing_lyrics = no
|
|
||||||
#
|
|
||||||
#fetch_lyrics_for_current_song_in_background = no
|
|
||||||
#
|
|
||||||
#store_lyrics_in_song_dir = no
|
|
||||||
#
|
|
||||||
#generate_win32_compatible_filenames = yes
|
|
||||||
#
|
|
||||||
#allow_for_physical_item_deletion = no
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: If you set this variable, ncmpcpp will try to get info from last.fm in
|
|
||||||
## language you set and if it fails, it will fall back to english. Otherwise it
|
|
||||||
## will use english the first time.
|
|
||||||
##
|
|
||||||
## Note: Language has to be expressed as an ISO 639 alpha-2 code.
|
|
||||||
##
|
|
||||||
#lastfm_preferred_language = en
|
|
||||||
#
|
|
||||||
#space_add_mode = add_remove
|
|
||||||
#
|
|
||||||
#show_hidden_files_in_local_browser = no
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## How shall screen switcher work?
|
|
||||||
##
|
|
||||||
## - "previous" - switch between the current and previous screen.
|
|
||||||
## - "screen1,...,screenN" - switch between given sequence of screens.
|
|
||||||
##
|
|
||||||
## Screens available for use: help, playlist, browser, search_engine,
|
|
||||||
## media_library, playlist_editor, tag_editor, outputs, visualizer, clock,
|
|
||||||
## lyrics, last_fm.
|
|
||||||
##
|
|
||||||
#screen_switcher_mode = playlist, browser
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: You can define startup screen by choosing screen from the list above.
|
|
||||||
##
|
|
||||||
startup_screen = media_library
|
startup_screen = media_library
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: You can define startup slave screen by choosing screen from the list
|
|
||||||
## above or an empty value for no slave screen.
|
|
||||||
##
|
|
||||||
#startup_slave_screen = playlist
|
|
||||||
#
|
|
||||||
#startup_slave_screen_focus = no
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Default width of locked screen (in %). Acceptable values are from 20 to 80.
|
|
||||||
##
|
|
||||||
#
|
|
||||||
#locked_screen_width_part = 60
|
|
||||||
#
|
|
||||||
#ask_for_locked_screen_width_part = yes
|
|
||||||
#
|
|
||||||
#jump_to_now_playing_song_at_start = yes
|
|
||||||
#
|
|
||||||
#ask_before_clearing_playlists = yes
|
|
||||||
#
|
|
||||||
#clock_display_seconds = no
|
|
||||||
#
|
|
||||||
#display_volume_level = yes
|
|
||||||
#
|
|
||||||
#display_bitrate = no
|
|
||||||
#
|
|
||||||
#display_remaining_time = no
|
|
||||||
#
|
|
||||||
## Available values: none, basic, extended, perl.
|
|
||||||
##
|
|
||||||
#regular_expressions = perl
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: if below is enabled, ncmpcpp will ignore leading "The" word while
|
|
||||||
## sorting items in browser, tags in media library, etc.
|
|
||||||
##
|
|
||||||
ignore_leading_the = yes
|
ignore_leading_the = yes
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and
|
|
||||||
## filtering lists. This takes an effect only if boost was compiled with ICU
|
|
||||||
## support.
|
|
||||||
##
|
|
||||||
#ignore_diacritics = no
|
|
||||||
#
|
|
||||||
#block_search_constraints_change_if_items_found = yes
|
|
||||||
#
|
|
||||||
#mouse_support = yes
|
|
||||||
#
|
|
||||||
#mouse_list_scroll_whole_page = no
|
|
||||||
#
|
|
||||||
#lines_scrolled = 5
|
|
||||||
#
|
|
||||||
#empty_tag_marker = <empty>
|
|
||||||
#
|
|
||||||
#tags_separator = " | "
|
|
||||||
#
|
|
||||||
#tag_editor_extended_numeration = no
|
|
||||||
#
|
|
||||||
#media_library_sort_by_mtime = no
|
|
||||||
#
|
|
||||||
#enable_window_title = yes
|
|
||||||
#
|
|
||||||
##
|
|
||||||
## Note: You can choose default search mode for search engine. Available modes
|
|
||||||
## are:
|
|
||||||
##
|
|
||||||
## - 1 - use mpd built-in searching (no regexes, pattern matching)
|
|
||||||
##
|
|
||||||
## - 2 - use ncmpcpp searching (pattern matching with support for regexes, but
|
|
||||||
## if your mpd is on a remote machine, downloading big database to process
|
|
||||||
## it can take a while
|
|
||||||
##
|
|
||||||
## - 3 - match only exact values (this mode uses mpd function for searching in
|
|
||||||
## database and local one for searching in current playlist)
|
|
||||||
##
|
|
||||||
#
|
|
||||||
#search_engine_default_search_mode = 1
|
|
||||||
#
|
|
||||||
external_editor = vim
|
external_editor = vim
|
||||||
#
|
|
||||||
## Note: set to yes if external editor is a console application.
|
|
||||||
##
|
|
||||||
use_console_editor = yes
|
use_console_editor = yes
|
||||||
#
|
|
||||||
##### colors definitions #####
|
# Colors
|
||||||
##
|
|
||||||
## It is possible to set a background color by setting a color value
|
|
||||||
## "<foreground>_<background>", e.g. red_black will set foregound color to red
|
|
||||||
## and background color to black.
|
|
||||||
##
|
|
||||||
## In addition, for terminals that support 256 colors it is possible to set one
|
|
||||||
## of them by using a number in range [1, 256] instead of color name,
|
|
||||||
## e.g. numerical value corresponding to red_black is 2_1. To find out if the
|
|
||||||
## terminal supports 256 colors, run ncmpcpp and check out the bottom of the
|
|
||||||
## help screen for list of available colors and their numerical values.
|
|
||||||
##
|
|
||||||
## What is more, there are two special values for the background color:
|
|
||||||
## "transparent" and "current". The first one explicitly sets the background to
|
|
||||||
## be transparent, while the second one allows you to preserve current
|
|
||||||
## background color and change only the foreground one. It's used implicitly
|
|
||||||
## when background color is not specified.
|
|
||||||
##
|
|
||||||
## Moreover, it is possible to attach format information to selected color
|
|
||||||
## variables by appending to their end a colon followed by one or more format
|
|
||||||
## flags, e.g. black:b or red:ur. The following variables support this syntax:
|
|
||||||
## visualizer_color, color1, color2, empty_tag_color, volume_color,
|
|
||||||
## state_line_color, state_flags_color, progressbar_color,
|
|
||||||
## progressbar_elapsed_color, player_state_color, statusbar_time_color,
|
|
||||||
## alternative_ui_separator_color.
|
|
||||||
##
|
|
||||||
## Note: due to technical limitations of older ncurses version, if 256 colors
|
|
||||||
## are used there is a possibility that you'll be able to use only colors with
|
|
||||||
## transparent background.
|
|
||||||
#
|
|
||||||
colors_enabled = yes
|
colors_enabled = yes
|
||||||
#
|
|
||||||
#empty_tag_color = cyan
|
|
||||||
#
|
|
||||||
header_window_color = 226
|
header_window_color = 226
|
||||||
#
|
|
||||||
#volume_color = default
|
|
||||||
#
|
|
||||||
#state_line_color = default
|
|
||||||
#
|
|
||||||
#state_flags_color = default:b
|
|
||||||
#
|
|
||||||
main_window_color = 160
|
main_window_color = 160
|
||||||
#
|
|
||||||
#color1 = white
|
|
||||||
#
|
|
||||||
#color2 = green
|
|
||||||
#
|
|
||||||
#progressbar_color = black:b
|
|
||||||
#
|
|
||||||
progressbar_elapsed_color = 226:b
|
progressbar_elapsed_color = 226:b
|
||||||
#
|
|
||||||
statusbar_color = 226
|
statusbar_color = 226
|
||||||
#
|
|
||||||
#statusbar_time_color = default:b
|
|
||||||
#
|
|
||||||
#player_state_color = default:b
|
|
||||||
#
|
|
||||||
#alternative_ui_separator_color = black:b
|
|
||||||
#
|
|
||||||
window_border_color = 226
|
window_border_color = 226
|
||||||
#
|
|
||||||
#active_window_border = red
|
|
||||||
#
|
|
||||||
+10
-276
@@ -1,287 +1,26 @@
|
|||||||
#################################
|
backend = "xrender"
|
||||||
# Shadows #
|
dithered-present = false;
|
||||||
#################################
|
use-damage = true;
|
||||||
|
# Fullscreen games bypass picom: less CPU work and latency.
|
||||||
|
unredir-if-possible = true;
|
||||||
|
|
||||||
# Enabled client-side shadows on windows. Note desktop windows
|
|
||||||
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
|
|
||||||
# unless explicitly requested using the wintypes option.
|
|
||||||
#
|
|
||||||
# Can be set per-window using rules.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
shadow = true;
|
shadow = true;
|
||||||
|
|
||||||
# The blur radius for shadows, in pixels.
|
|
||||||
#
|
|
||||||
# Default: 12
|
|
||||||
shadow-radius = 7;
|
shadow-radius = 7;
|
||||||
|
|
||||||
# The opacity of shadows.
|
|
||||||
#
|
|
||||||
# Range: 0.0 - 1.0
|
|
||||||
# Default: 0.75
|
|
||||||
# shadow-opacity = .75
|
|
||||||
|
|
||||||
# The left offset for shadows, in pixels.
|
|
||||||
#
|
|
||||||
# Default: -15
|
|
||||||
shadow-offset-x = -7;
|
shadow-offset-x = -7;
|
||||||
|
|
||||||
# The top offset for shadows, in pixels.
|
|
||||||
#
|
|
||||||
# Default: -15
|
|
||||||
shadow-offset-y = -7;
|
shadow-offset-y = -7;
|
||||||
|
|
||||||
# Hex string color value of shadow. Formatted like "#RRGGBB", e.g. "#C0FFEE".
|
|
||||||
#
|
|
||||||
# Default: #000000
|
|
||||||
# shadow-color = "#000000"
|
|
||||||
|
|
||||||
# Crop shadow of a window fully on a particular monitor to that monitor. This is
|
|
||||||
# currently implemented using the X RandR extension.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# crop-shadow-to-monitor = false
|
|
||||||
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Fading #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
# Fade windows in/out when opening/closing and when opacity changes,
|
|
||||||
# unless no-fading-openclose is used. Can be set per-window using rules.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
fading = true;
|
fading = true;
|
||||||
|
|
||||||
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
|
|
||||||
fade-in-step = 0.03;
|
fade-in-step = 0.03;
|
||||||
|
|
||||||
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
|
|
||||||
fade-out-step = 0.03;
|
fade-out-step = 0.03;
|
||||||
|
|
||||||
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
|
|
||||||
# fade-delta = 10
|
|
||||||
|
|
||||||
# Do not fade on window open/close.
|
|
||||||
# no-fading-openclose = false
|
|
||||||
|
|
||||||
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
|
|
||||||
# no-fading-destroyed-argb = false
|
|
||||||
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Transparency / Opacity #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
# Opacity of window titlebars and borders.
|
|
||||||
#
|
|
||||||
# Range: 0.1 - 1.0
|
|
||||||
# Default: 1.0 (disabled)
|
|
||||||
frame-opacity = 0.9;
|
frame-opacity = 0.9;
|
||||||
|
|
||||||
# Use fixed inactive dim value, instead of adjusting according to window opacity.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# inactive-dim-fixed = true
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Corners #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
# Sets the radius of rounded window corners. When > 0, the compositor will
|
|
||||||
# round the corners of windows. Does not interact well with
|
|
||||||
# `transparent-clipping`.
|
|
||||||
#
|
|
||||||
# Default: 0 (disabled)
|
|
||||||
corner-radius = 0
|
corner-radius = 0
|
||||||
|
|
||||||
#################################
|
|
||||||
# Blur #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
# Parameters for background blurring, see BLUR section in the man page for more information.
|
|
||||||
# blur-method =
|
|
||||||
# blur-size = 12
|
|
||||||
#
|
|
||||||
# blur-deviation = false
|
|
||||||
#
|
|
||||||
# blur-strength = 5
|
|
||||||
|
|
||||||
# Blur background of semi-transparent / ARGB windows.
|
|
||||||
# Can be set per-window using rules.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# blur-background = false
|
|
||||||
|
|
||||||
# Blur background of windows when the window frame is not opaque.
|
|
||||||
# Implies:
|
|
||||||
# blur-background
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# blur-background-frame = false
|
|
||||||
|
|
||||||
# Use fixed blur strength rather than adjusting according to window opacity.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# blur-background-fixed = false
|
|
||||||
|
|
||||||
|
|
||||||
# Specify the blur convolution kernel, with the following format:
|
|
||||||
# example:
|
|
||||||
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
|
|
||||||
# Can also be a pre-defined kernel, see the man page.
|
|
||||||
#
|
|
||||||
# Default: ""
|
|
||||||
blur-kern = "3x3box";
|
blur-kern = "3x3box";
|
||||||
|
|
||||||
#################################
|
|
||||||
# General Settings #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
# Enable remote control via D-Bus. See the man page for more details.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# dbus = true
|
|
||||||
|
|
||||||
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
|
|
||||||
# daemon = false
|
|
||||||
|
|
||||||
# Specify the backend to use: `xrender`, `glx`, or `egl`.
|
|
||||||
#
|
|
||||||
# Default: "xrender"
|
|
||||||
backend = "xrender"
|
|
||||||
|
|
||||||
# Use higher precision during rendering, and apply dither when presenting the
|
|
||||||
# rendered screen. Reduces banding artifacts, but may cause performance
|
|
||||||
# degradation. Only works with OpenGL.
|
|
||||||
dithered-present = false;
|
|
||||||
|
|
||||||
# Enable/disable VSync.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# vsync = true;
|
|
||||||
|
|
||||||
# Try to detect windows with rounded corners and don't consider them
|
|
||||||
# shaped windows. The accuracy is not very high, unfortunately.
|
|
||||||
#
|
|
||||||
# Has nothing to do with `corner-radius`.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
detect-rounded-corners = true;
|
detect-rounded-corners = true;
|
||||||
|
|
||||||
# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
|
|
||||||
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
detect-client-opacity = true;
|
detect-client-opacity = true;
|
||||||
|
|
||||||
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
|
|
||||||
# rather than listening to 'FocusIn'/'FocusOut' event. May be more accurate,
|
|
||||||
# provided that the WM supports it.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# use-ewmh-active-win = false
|
|
||||||
|
|
||||||
# Unredirect all windows if a full-screen opaque window is detected,
|
|
||||||
# to maximize performance for full-screen windows. Known to cause flickering
|
|
||||||
# when redirecting/unredirecting windows.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# unredir-if-possible = false
|
|
||||||
|
|
||||||
# Delay before unredirecting the window, in milliseconds.
|
|
||||||
#
|
|
||||||
# Default: 0.
|
|
||||||
# unredir-if-possible-delay = 0
|
|
||||||
|
|
||||||
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
|
|
||||||
# in the same group focused at the same time.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
detect-transient = true;
|
detect-transient = true;
|
||||||
|
|
||||||
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
|
|
||||||
# group focused at the same time. This usually means windows from the same application
|
|
||||||
# will be considered focused or unfocused at the same time.
|
|
||||||
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# detect-client-leader = false
|
|
||||||
|
|
||||||
# Use of damage information for rendering. This cause the only the part of the
|
|
||||||
# screen that has actually changed to be redrawn, instead of the whole screen
|
|
||||||
# every time. Should improve performance.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
use-damage = true;
|
|
||||||
|
|
||||||
# Use X Sync fence to wait for the completion of rendering of other windows,
|
|
||||||
# before using their content to render the current screen.
|
|
||||||
#
|
|
||||||
# Required for explicit sync drivers, such as nvidia.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# xrender-sync-fence = false
|
|
||||||
|
|
||||||
# GLX backend: Use specified GLSL fragment shader for rendering window
|
|
||||||
# contents. Read the man page for a detailed explanation of the interface.
|
|
||||||
#
|
|
||||||
# Can be set per-window using rules.
|
|
||||||
#
|
|
||||||
# window-shader-fg = "default"
|
|
||||||
|
|
||||||
# Force all windows to be painted with blending. Useful if you
|
|
||||||
# have a `window-shader-fg` that could turn opaque pixels transparent.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# force-win-blend = false
|
|
||||||
|
|
||||||
# Do not use EWMH to detect fullscreen windows.
|
|
||||||
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# no-ewmh-fullscreen = false
|
|
||||||
|
|
||||||
# Dimming bright windows so their brightness doesn't exceed this set value.
|
|
||||||
# Brightness of a window is estimated by averaging all pixels in the window,
|
|
||||||
# so this could comes with a performance hit.
|
|
||||||
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled.
|
|
||||||
#
|
|
||||||
# Default: 1.0 (disabled)
|
|
||||||
# max-brightness = 1.0
|
|
||||||
|
|
||||||
# Make transparent windows clip other windows like non-transparent windows do,
|
|
||||||
# instead of blending on top of them. e.g. placing a transparent window on top
|
|
||||||
# of another window will cut a "hole" in that window, and show the desktop background
|
|
||||||
# underneath.
|
|
||||||
#
|
|
||||||
# Default: false
|
|
||||||
# transparent-clipping = false
|
|
||||||
|
|
||||||
# Set the log level. Possible values are:
|
|
||||||
# "trace", "debug", "info", "warn", "error"
|
|
||||||
# in increasing level of importance. Case insensitive.
|
|
||||||
# If using the "TRACE" log level, it's better to log into a file
|
|
||||||
# using *--log-file*, since it can generate a huge stream of logs.
|
|
||||||
#
|
|
||||||
# Default: "warn"
|
|
||||||
# log-level = "warn";
|
|
||||||
|
|
||||||
# Set the log file.
|
|
||||||
# If *--log-file* is never specified, logs will be written to stderr.
|
|
||||||
# Otherwise, logs will to written to the given file, though some of the early
|
|
||||||
# logs might still be written to the stderr.
|
|
||||||
# When setting this option from the config file, it is recommended to use an absolute path.
|
|
||||||
#
|
|
||||||
# log-file = "/path/to/your/log/file"
|
|
||||||
|
|
||||||
# Write process ID to a file.
|
|
||||||
# write-pid-path = "/path/to/your/log/file"
|
|
||||||
|
|
||||||
# Rule-based per-window options.
|
|
||||||
#
|
|
||||||
# See WINDOW RULES section in the man page for how these work.
|
|
||||||
rules: ({
|
rules: ({
|
||||||
match = "window_type = 'tooltip'";
|
match = "window_type = 'tooltip'";
|
||||||
fade = false;
|
fade = false;
|
||||||
@@ -293,9 +32,6 @@ rules: ({
|
|||||||
"window_type = 'desktop' || "
|
"window_type = 'desktop' || "
|
||||||
"_GTK_FRAME_EXTENTS@";
|
"_GTK_FRAME_EXTENTS@";
|
||||||
blur-background = false;
|
blur-background = false;
|
||||||
}, {
|
|
||||||
match = "window_type != 'dock'";
|
|
||||||
# shader = "my_shader.frag";
|
|
||||||
}, {
|
}, {
|
||||||
match = "window_type = 'dock' || "
|
match = "window_type = 'dock' || "
|
||||||
"window_type = 'desktop'";
|
"window_type = 'desktop'";
|
||||||
@@ -307,11 +43,9 @@ rules: ({
|
|||||||
"class_g = 'Cairo-clock' || "
|
"class_g = 'Cairo-clock' || "
|
||||||
"_GTK_FRAME_EXTENTS@";
|
"_GTK_FRAME_EXTENTS@";
|
||||||
shadow = false;
|
shadow = false;
|
||||||
|
}, {
|
||||||
|
# Unredirecting fullscreen i3lock/mpv left the HDMI output (reverse PRIME sink) black.
|
||||||
|
match = "class_g = 'i3lock' || "
|
||||||
|
"class_g = 'mpv'";
|
||||||
|
unredir = false;
|
||||||
})
|
})
|
||||||
|
|
||||||
# `@include` directive can be used to include additional configuration files.
|
|
||||||
# Relative paths are search either in the parent of this configuration file
|
|
||||||
# (when the configuration is loaded through a symlink, the symlink will be
|
|
||||||
# resolved first). Or in `$XDG_CONFIG_HOME/picom/include`.
|
|
||||||
#
|
|
||||||
# @include "extra.conf"
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Ask to renew the calcurse Google Calendar login
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
# simple: the prompt waits for a click without a start timeout
|
||||||
|
Type=simple
|
||||||
|
ExecStart=%h/.local/bin/calcurse-relogin --prompt
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Sync calcurse with Google Calendar
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=%h/.local/bin/calcurse-sync
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Sync calcurse with Google Calendar hourly
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnActiveSec=1min
|
||||||
|
OnCalendar=hourly
|
||||||
|
Persistent=true
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Notify today's calcurse events
|
||||||
|
After=calcurse-sync.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=%h/.local/bin/calcurse-today
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Notify today's calcurse events every morning
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=*-*-* 09:00
|
||||||
|
Persistent=true
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Dump the Garmin database to ~/.local/share/negsplit/dumps
|
||||||
|
StartLimitIntervalSec=2h
|
||||||
|
StartLimitBurst=4
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=%h/.local/bin/db-dump negsplit Garmin week
|
||||||
|
# MariaDB not up yet (e.g. caught up right after boot)? retry a few times
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5min
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Dump the Garmin database weekly
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=weekly
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
@@ -5,7 +5,7 @@ StartLimitBurst=4
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=%h/.local/bin/library-dump
|
ExecStart=%h/.local/bin/db-dump library_manager Library day
|
||||||
# MariaDB not up yet (e.g. caught up right after boot)? retry a few times
|
# MariaDB not up yet (e.g. caught up right after boot)? retry a few times
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5min
|
RestartSec=5min
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Dump the Weather database to ~/.local/share/ens-forecast/dumps
|
||||||
|
StartLimitIntervalSec=2h
|
||||||
|
StartLimitBurst=4
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=%h/.local/bin/db-dump ens-forecast Weather week
|
||||||
|
# MariaDB not up yet (e.g. caught up right after boot)? retry a few times
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5min
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Dump the Weather database weekly
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=weekly
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
Executable
+42
@@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Next calcurse item for xmobar: pink " 10:15 | " for an appointment later today, a cyan icon for a whole-day
|
||||||
|
# event today, a pink icon alone when the next appointment is tomorrow; empty otherwise.
|
||||||
|
# With "list": show today's and tomorrow's items in a notification (for a click on the bar)
|
||||||
|
set -uo pipefail
|
||||||
|
|
||||||
|
icon=$'\xf3\xb0\x83\xad' # nf-md-calendar, as UTF-8 bytes so the locale doesn't matter
|
||||||
|
today=$(date +%F)
|
||||||
|
|
||||||
|
query() {
|
||||||
|
calcurse -Q --filter-type cal --days 2 --output-datefmt %F "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ${1:-} == list ]]; then
|
||||||
|
tomorrow=$(date -d tomorrow +%F)
|
||||||
|
body=$(query --format-apt '%S–%E %m\n' --format-recur-apt '%S–%E %m\n' \
|
||||||
|
--format-event 'all day %m\n' --format-recur-event 'all day %m\n' |
|
||||||
|
sed -e 's/&/\&/g; s/</\</g; s/>/\>/g' -e "s/^$today:$/Today:/; s/^$tomorrow:$/Tomorrow:/")
|
||||||
|
notify-send -a calcurse -i x-office-calendar "Calendar" "${body:-Nothing today or tomorrow}"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
now=$(date +%s)
|
||||||
|
day="" next="" event=false
|
||||||
|
while read -r kind start; do
|
||||||
|
case $kind in
|
||||||
|
*:) day=${kind%:} ;;
|
||||||
|
A) [[ -z $next ]] && ((start > now)) && next=$start ;;
|
||||||
|
E) [[ $day == "$today" ]] && event=true ;;
|
||||||
|
esac
|
||||||
|
done < <(query --format-apt 'A %s\n' --format-recur-apt 'A %s\n' --format-event 'E\n' --format-recur-event 'E\n')
|
||||||
|
|
||||||
|
if [[ -n $next && $(date -d "@$next" +%F) == "$today" ]]; then
|
||||||
|
text="<fc=#ff79c6>$icon $(date -d "@$next" +%H:%M)</fc>"
|
||||||
|
elif $event; then
|
||||||
|
text="<fc=#8be9fd>$icon</fc>"
|
||||||
|
elif [[ -n $next ]]; then
|
||||||
|
text="<fc=#ff79c6>$icon</fc>"
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "$text | "
|
||||||
@@ -13,7 +13,7 @@ declare -A LABEL=([ncep_gefs025]=GEFS [icon_seamless_eps]=ICON [google_weatherne
|
|||||||
pick() {
|
pick() {
|
||||||
local m l head first="" first_model="" err=""
|
local m l head first="" first_model="" err=""
|
||||||
for m in "${MODELS[@]}"; do
|
for m in "${MODELS[@]}"; do
|
||||||
if ! l=$(ens-forecast --brief "$1" --model "$m" 2>&1); then
|
if ! l=$(ens-forecast brief "$1" --model "$m" 2>&1); then
|
||||||
[[ -z $err ]] && err=$l
|
[[ -z $err ]] && err=$l
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@@ -47,9 +47,11 @@ if [ "$1" = "week" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
pick 1 2>/dev/null || exit 0
|
pick 1 2>/dev/null || exit 0
|
||||||
read -r day temps rain <<< "${line#*: }"
|
read -r day temps rain extra <<< "${line#*: }"
|
||||||
|
# Probabilities as nf-weather icons: frost snowflake_cold, snow, heat hot
|
||||||
|
extra=${extra//frost /$'\xee\x8d\xaf' } extra=${extra//snow /$'\xee\x8c\x9a' } extra=${extra//heat /$'\xee\x8d\xab' }
|
||||||
label=""
|
label=""
|
||||||
[[ $model != "${MODELS[0]}" ]] && label="${LABEL[$model]:-$model} "
|
[[ $model != "${MODELS[0]}" ]] && label="${LABEL[$model]:-$model} "
|
||||||
stale=""
|
stale=""
|
||||||
[[ ${line%%: *} == *STALE* ]] && stale=" <fc=#f7768e>!</fc>"
|
[[ ${line%%: *} == *STALE* ]] && stale=" <fc=#f7768e>!</fc>"
|
||||||
echo "$label$day ${temps%C} "$''" $rain$stale"
|
echo "$label$day ${temps%C} "$''" $rain${extra:+ $extra}$stale"
|
||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# NVIDIA GPU load and temperature for xmobar, e.g. "<icon> 9% 68°C", colored like the CPU ones.
|
||||||
|
# Load 25/75 as MultiCpu; temperature 75/90 (GTX 1050 Ti Mobile: target 94°C, ~65°C driving the HDMI output).
|
||||||
|
|
||||||
|
color() { # value low high
|
||||||
|
if (( $1 > $3 )); then c='#ff5555'; elif (( $1 > $2 )); then c='#ffb86c'; else c='#50fa7b'; fi
|
||||||
|
printf '<fc=%s>%s</fc>' "$c" "$4"
|
||||||
|
}
|
||||||
|
|
||||||
|
icon=$'\U000f08ae'
|
||||||
|
IFS=', ' read -r load temp < <(nvidia-smi --query-gpu=utilization.gpu,temperature.gpu --format=csv,noheader,nounits 2>/dev/null)
|
||||||
|
if [[ ! $load =~ ^[0-9]+$ || ! $temp =~ ^[0-9]+$ ]]; then
|
||||||
|
echo "$icon N/A"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$icon $(color "$load" 25 75 "$load%") $(color "$temp" 75 90 "$temp°C")"
|
||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Cycle keyboard layout it -> us -> sk(qwerty); "prev" cycles backwards.
|
||||||
|
|
||||||
|
current=$(setxkbmap -query | awk '/^layout:/ {split($2, a, ","); print a[1]}')
|
||||||
|
|
||||||
|
if [[ "$1" == "prev" ]]; then
|
||||||
|
case "$current" in
|
||||||
|
it) next=sk ;;
|
||||||
|
us) next=it ;;
|
||||||
|
*) next=us ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
case "$current" in
|
||||||
|
it) next=us ;;
|
||||||
|
us) next=sk ;;
|
||||||
|
*) next=it ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$next" == "sk" ]]; then
|
||||||
|
setxkbmap -layout sk -variant qwerty
|
||||||
|
else
|
||||||
|
setxkbmap -layout "$next" -variant ""
|
||||||
|
fi
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Pending updates for xmobar from update-notify's pending list, e.g. " 15/3 | " (repo/AUR), empty when none
|
# Pending updates for xmobar from update-notify's pending list, e.g. " 15/3 | " (repo/AUR), empty when none
|
||||||
# Entries already installed are dropped, so the count falls right after an upgrade. Orange from the threshold
|
# Entries already installed are dropped, so the count falls right after an upgrade. Orange from the threshold
|
||||||
# on, red "K" when a custom kernel needs a rebuild.
|
# on, red "K" when a custom kernel needs a rebuild, red "R" when a reboot is needed, blue "P" for .pacnew files.
|
||||||
# With "list": show the pending packages in a notification (for a click on the bar)
|
# With "list": show the pending packages in a notification (for a click on the bar)
|
||||||
|
|
||||||
file="${XDG_STATE_HOME:-$HOME/.local/state}/update-notify/pending"
|
file="${XDG_STATE_HOME:-$HOME/.local/state}/update-notify/pending"
|
||||||
@@ -11,7 +11,7 @@ mapfile -t entries < "$file"
|
|||||||
names=()
|
names=()
|
||||||
for e in "${entries[@]}"; do
|
for e in "${entries[@]}"; do
|
||||||
read -r src pkg _ <<< "$e"
|
read -r src pkg _ <<< "$e"
|
||||||
[[ $src != threshold ]] && names+=("$pkg")
|
case $src in repo|aur|kernel) names+=("$pkg") ;; esac
|
||||||
done
|
done
|
||||||
|
|
||||||
declare -A installed
|
declare -A installed
|
||||||
@@ -21,10 +21,15 @@ if (( ${#names[@]} )); then
|
|||||||
done < <(pacman -Q "${names[@]}" 2>/dev/null)
|
done < <(pacman -Q "${names[@]}" 2>/dev/null)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
threshold=0 repo=() aur=() kernel=()
|
threshold=0 repo=() aur=() kernel=() pacnew=() reboot=""
|
||||||
|
running=$(uname -r)
|
||||||
for e in "${entries[@]}"; do
|
for e in "${entries[@]}"; do
|
||||||
read -r src pkg new <<< "$e"
|
read -r src pkg new <<< "$e"
|
||||||
[[ $src == threshold ]] && { threshold=$pkg; continue; }
|
case $src in
|
||||||
|
threshold) threshold=$pkg; continue ;;
|
||||||
|
pacnew) [[ -e ${e#pacnew } ]] && pacnew+=("${e#pacnew }"); continue ;; # gone once merged
|
||||||
|
reboot) [[ $pkg == "$running" ]] && reboot=$pkg; continue ;; # gone after the reboot
|
||||||
|
esac
|
||||||
have=${installed[$pkg]:-}
|
have=${installed[$pkg]:-}
|
||||||
[[ -z $have ]] && continue # removed since the last run
|
[[ -z $have ]] && continue # removed since the last run
|
||||||
case $src in
|
case $src in
|
||||||
@@ -39,14 +44,19 @@ if [[ ${1:-} == list ]]; then
|
|||||||
(( ${#repo[@]} )) && { printf -v l '%s\n' "${repo[@]}"; body+="Repo:"$'\n'"$l"; }
|
(( ${#repo[@]} )) && { printf -v l '%s\n' "${repo[@]}"; body+="Repo:"$'\n'"$l"; }
|
||||||
(( ${#aur[@]} )) && { printf -v l '%s\n' "${aur[@]}"; body+="AUR:"$'\n'"$l"; }
|
(( ${#aur[@]} )) && { printf -v l '%s\n' "${aur[@]}"; body+="AUR:"$'\n'"$l"; }
|
||||||
(( ${#kernel[@]} )) && { printf -v l 'Rebuild %s\n' "${kernel[@]}"; body+="$l"; }
|
(( ${#kernel[@]} )) && { printf -v l 'Rebuild %s\n' "${kernel[@]}"; body+="$l"; }
|
||||||
|
(( ${#pacnew[@]} )) && { printf -v l '%s\n' "${pacnew[@]}"; body+="Merge with pacdiff:"$'\n'"$l"; }
|
||||||
|
[[ -n $reboot ]] && body+="Reboot (running $reboot)"$'\n'
|
||||||
body=${body%$'\n'}
|
body=${body%$'\n'}
|
||||||
notify-send "Pending updates" "${body:-None}"
|
notify-send "Pending updates" "${body:-None}"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
total=$(( ${#repo[@]} + ${#aur[@]} ))
|
total=$(( ${#repo[@]} + ${#aur[@]} ))
|
||||||
(( total + ${#kernel[@]} )) || exit 0
|
(( total + ${#kernel[@]} + ${#pacnew[@]} )) || [[ -n $reboot ]] || exit 0
|
||||||
text=$'\xef\x92\x87'" ${#repo[@]}/${#aur[@]}" # nf-oct-package, as UTF-8 bytes so the locale doesn't matter
|
text=$'\xef\x92\x87' # nf-oct-package, as UTF-8 bytes so the locale doesn't matter
|
||||||
(( total >= threshold )) && text="<fc=#ffb86c>$text</fc>"
|
(( total )) && text+=" ${#repo[@]}/${#aur[@]}" # markers alone: no "0/0"
|
||||||
|
(( total && total >= threshold )) && text="<fc=#ffb86c>$text</fc>"
|
||||||
(( ${#kernel[@]} )) && text+=" <fc=#f7768e>K</fc>"
|
(( ${#kernel[@]} )) && text+=" <fc=#f7768e>K</fc>"
|
||||||
|
[[ -n $reboot ]] && text+=" <fc=#f7768e>R</fc>"
|
||||||
|
(( ${#pacnew[@]} )) && text+=" <fc=#7aa2f7>P</fc>"
|
||||||
echo "$text | "
|
echo "$text | "
|
||||||
Executable
+81
@@ -0,0 +1,81 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Current weather for xmobar, e.g. "<icon> 7°C": NOAA's decoded METAR (the source of xmobar's Weather plugin)
|
||||||
|
# Icon from the weather, else the sky conditions; clear/partly/mostly cloudy get moon icons when the sun is down.
|
||||||
|
# Temperature colors match the plugin's -L 0 -H 30: low up to 0, high above 30.
|
||||||
|
# With "notify": show the description (e.g. "Light drizzle, mist") and temperature in a notification instead.
|
||||||
|
|
||||||
|
STATION=LZIB LAT=48.2 LON=17.2
|
||||||
|
|
||||||
|
declare -A ICON=(
|
||||||
|
[thermometer]=$'\xef\x8b\x89' [day_sunny]=$'\xee\x8c\x8d' [night_clear]=$'\xee\x8c\xab'
|
||||||
|
[day_cloudy]=$'\xee\x8c\x82' [night_partly_cloudy]=$'\xee\x8d\xb9' [day_sunny_overcast]=$'\xee\x8c\x8c'
|
||||||
|
[night_cloudy]=$'\xee\x8d\xbe' [cloudy]=$'\xee\x8c\x92' [cloud]=$'\xee\x8c\xbd'
|
||||||
|
[thunderstorm]=$'\xee\x8c\x9d' [rain_mix]=$'\xee\x8c\x96' [snow]=$'\xee\x8c\x9a' [showers]=$'\xee\x8c\x99'
|
||||||
|
[rain]=$'\xee\x8c\x98' [sprinkle]=$'\xee\x8c\x9b' [fog]=$'\xee\x8c\x93' [smoke]=$'\xee\x8d\x9c'
|
||||||
|
[dust]=$'\xee\x8d\x9d'
|
||||||
|
)
|
||||||
|
|
||||||
|
report=$(curl -sf --max-time 20 https://tgftp.nws.noaa.gov/data/observations/metar/decoded/"$STATION".TXT)
|
||||||
|
temp=$(sed -n 's/^Temperature: .*(\([-0-9.]*\) C).*/\1/p' <<< "$report")
|
||||||
|
if [[ -z $temp ]]; then
|
||||||
|
if [[ $1 == notify ]]; then notify-send "Weather" "No report from $STATION"; else echo "<fn=1>${ICON[thermometer]}</fn> N/A"; fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Phenomena "in the vicinity" aren't at the station; the rest are e.g. "light drizzle; mist"
|
||||||
|
wx=$(sed -n 's/^Weather: //p' <<< "$report" | tr ';' '\n' | sed 's/^ *//' | grep -v vicinity)
|
||||||
|
wx=${wx,,}
|
||||||
|
sky=$(sed -n 's/^Sky conditions: //p' <<< "$report")
|
||||||
|
# CAVOK/NSC (no cloud below 5000 ft) have no sky line in the decoded report
|
||||||
|
[[ -z $sky ]] && grep -qE '^ob: .* (CAVOK|NSC) ' <<< "$report" && sky=clear
|
||||||
|
sky=${sky,,}
|
||||||
|
|
||||||
|
# Sun above the horizon (elevation > -0.833°, as for sunrise/sunset) right now, from the low-precision solar position
|
||||||
|
sun_up() {
|
||||||
|
awk -v t="$(date +%s)" -v lat="$LAT" -v lon="$LON" 'BEGIN {
|
||||||
|
r = atan2(0, -1) / 180; d = t / 86400 - 10957.5
|
||||||
|
g = (357.529 + 0.98560028 * d) * r
|
||||||
|
l = (280.459 + 0.98564736 * d + 1.915 * sin(g) + 0.020 * sin(2 * g)) * r
|
||||||
|
e = (23.439 - 0.00000036 * d) * r
|
||||||
|
ra = atan2(cos(e) * sin(l), cos(l)); s = sin(e) * sin(l); dec = atan2(s, sqrt(1 - s * s))
|
||||||
|
h = (280.46061837 + 360.98564736629 * d + lon) * r - ra
|
||||||
|
exit !(sin(lat * r) * sin(dec) + cos(lat * r) * cos(dec) * cos(h) > sin(-0.833 * r))
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
case $wx in
|
||||||
|
*thunder*) icon=thunderstorm ;;
|
||||||
|
*freezing*|*sleet*|*ice\ pellets*|*hail*) icon=rain_mix ;;
|
||||||
|
*snow*rain*|*rain*snow*|*snow*drizzle*|*drizzle*snow*) icon=rain_mix ;;
|
||||||
|
*snow*) icon=snow ;;
|
||||||
|
*showers*) icon=showers ;;
|
||||||
|
*rain*) icon=rain ;;
|
||||||
|
*drizzle*) icon=sprinkle ;;
|
||||||
|
*fog*|*mist*) icon=fog ;;
|
||||||
|
*haze*|*smoke*) icon=smoke ;;
|
||||||
|
*dust*|*sand*) icon=dust ;;
|
||||||
|
*)
|
||||||
|
case $sky in
|
||||||
|
clear*) if sun_up; then icon=day_sunny; else icon=night_clear; fi ;;
|
||||||
|
"mostly clear"*|"partly cloudy"*) if sun_up; then icon=day_cloudy; else icon=night_partly_cloudy; fi ;;
|
||||||
|
"mostly cloudy"*) if sun_up; then icon=day_sunny_overcast; else icon=night_cloudy; fi ;;
|
||||||
|
overcast*|obscured*) icon=cloudy ;;
|
||||||
|
*) icon=cloud ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if awk -v t="$temp" 'BEGIN { exit !(t > 30) }'; then color="#ffb86c"
|
||||||
|
elif awk -v t="$temp" 'BEGIN { exit !(t > 0) }'; then color="#50fa7b"
|
||||||
|
else color="#8be9fd"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == notify ]]; then
|
||||||
|
if [[ -n $wx ]]; then desc=$(paste -sd, <<< "$wx" | sed 's/,/, /g')
|
||||||
|
elif [[ $icon == day_sunny ]]; then desc=sunny
|
||||||
|
else desc=${sky:-unknown}
|
||||||
|
fi
|
||||||
|
notify-send "${ICON[$icon]} Weather" "${desc^}, $temp°C"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "<fn=1>${ICON[$icon]}</fn> <fc=$color>$temp</fc>°C"
|
||||||
@@ -1,21 +1,15 @@
|
|||||||
Config { overrideRedirect = True
|
Config { overrideRedirect = True
|
||||||
, lowerOnStart = True
|
, lowerOnStart = True
|
||||||
, font = "Jetbrains Mono Nerd Font Bold 9"
|
, font = "Jetbrains Mono Nerd Font Bold 10"
|
||||||
|
, additionalFonts = ["Jetbrains Mono Nerd Font Bold 13"]
|
||||||
, bgColor = "#24283b"
|
, bgColor = "#24283b"
|
||||||
, fgColor = "#737aa2"
|
, fgColor = "#737aa2"
|
||||||
, position = Top
|
, position = TopH 24
|
||||||
, border = NoBorder
|
, border = NoBorder
|
||||||
, borderColor = "#24283b"
|
, borderColor = "#24283b"
|
||||||
, allDesktops = True
|
, allDesktops = True
|
||||||
, pickBroadest = True
|
, pickBroadest = True
|
||||||
, commands = [ Run Weather "LZIB"
|
, commands = [ Run Com "/home/fuxino/.config/xmobar/weather.sh" [] "weather" 9000
|
||||||
[ "--template", "\xf2c9 <tempC>°C"
|
|
||||||
, "-L", "5"
|
|
||||||
, "-H", "25"
|
|
||||||
, "--low" , "#8be9fd"
|
|
||||||
, "--normal" , "#50fa7b"
|
|
||||||
, "--high" , "#ff5555"
|
|
||||||
] 9000
|
|
||||||
, Run MultiCpu
|
, Run MultiCpu
|
||||||
[ "--template" , "\xf4bc <total>%"
|
[ "--template" , "\xf4bc <total>%"
|
||||||
, "--Low" , "25"
|
, "--Low" , "25"
|
||||||
@@ -26,16 +20,17 @@ Config { overrideRedirect = True
|
|||||||
] 10
|
] 10
|
||||||
, Run CoreTemp
|
, Run CoreTemp
|
||||||
[ "--template" , "<core0>°C"
|
[ "--template" , "<core0>°C"
|
||||||
, "--Low" , "60"
|
, "--Low" , "70"
|
||||||
, "--High" , "85"
|
, "--High" , "90"
|
||||||
, "--low" , "#50fa7b"
|
, "--low" , "#50fa7b"
|
||||||
, "--normal" , "#ffb86c"
|
, "--normal" , "#ffb86c"
|
||||||
, "--high" , "#ff5555"
|
, "--high" , "#ff5555"
|
||||||
] 50
|
] 50
|
||||||
|
, Run Com "/home/fuxino/.config/xmobar/gpu.sh" [] "gpu" 50
|
||||||
, Run Memory
|
, Run Memory
|
||||||
[ "--template" , "\xefc5 <usedratio>%"
|
[ "--template" , "\xefc5 <usedratio>%"
|
||||||
, "--Low" , "33"
|
, "--Low" , "50"
|
||||||
, "--High" , "66"
|
, "--High" , "80"
|
||||||
, "--low" , "#50fa7b"
|
, "--low" , "#50fa7b"
|
||||||
, "--normal" , "#ffb86c"
|
, "--normal" , "#ffb86c"
|
||||||
, "--high" , "#ff5555"
|
, "--high" , "#ff5555"
|
||||||
@@ -45,17 +40,15 @@ Config { overrideRedirect = True
|
|||||||
, ("us" , "<fc=#ffb86c>US</fc>")
|
, ("us" , "<fc=#ffb86c>US</fc>")
|
||||||
, ("sk(qwerty)" , "<fc=#ff5555>SK</fc>")
|
, ("sk(qwerty)" , "<fc=#ff5555>SK</fc>")
|
||||||
]
|
]
|
||||||
, Run Date "\xf133 %a %Y-%m-%d <fc=#ff79c6>%H:%M</fc>" "date" 10
|
, Run Date "\xf133 %a %d/%m <fc=#ff79c6>%H:%M</fc>" "date" 10
|
||||||
, Run Uptime
|
|
||||||
[ "--template" , "\xf017 <days>d <hours>h"
|
|
||||||
] 600
|
|
||||||
, Run Com "/home/fuxino/.config/xmobar/pactl_volume.sh" [] "pactl_volume" 10
|
, Run Com "/home/fuxino/.config/xmobar/pactl_volume.sh" [] "pactl_volume" 10
|
||||||
, Run Com "/home/fuxino/.config/xmobar/ens_brief.sh" [] "ens_brief" 18000
|
, Run Com "/home/fuxino/.config/xmobar/ens_brief.sh" [] "ens_brief" 18000
|
||||||
, Run Com "/home/fuxino/.config/xmobar/updates.sh" [] "updates" 600
|
, Run Com "/home/fuxino/.config/xmobar/updates.sh" [] "updates" 600
|
||||||
, Run Com "/home/fuxino/.config/xmobar/backup.sh" [] "backup" 3600
|
, Run Com "/home/fuxino/.config/xmobar/backup.sh" [] "backup" 3600
|
||||||
|
, Run Com "/home/fuxino/.config/xmobar/calcurse.sh" [] "calcurse" 600
|
||||||
, Run UnsafeXMonadLog
|
, Run UnsafeXMonadLog
|
||||||
]
|
]
|
||||||
, sepChar = "%"
|
, sepChar = "%"
|
||||||
, alignSep = "}{"
|
, alignSep = "}{"
|
||||||
, template = " | %UnsafeXMonadLog% } %uptime% | %multicpu% %coretemp% | %memory% | %kbd% { <action=`/home/fuxino/.config/xmobar/backup.sh list`>%backup%</action><action=`/home/fuxino/.config/xmobar/updates.sh list`>%updates%</action><action=`/home/fuxino/.config/xmobar/ens_brief.sh week`>%LZIB% <fc=#565f89>·</fc> %ens_brief%</action> | %pactl_volume% | %date% "
|
, template = " | %UnsafeXMonadLog% } %multicpu% %coretemp% | %gpu% | %memory% | <action=`/home/fuxino/.config/xmobar/kbd_cycle.sh` button=1><action=`/home/fuxino/.config/xmobar/kbd_cycle.sh prev` button=3> %kbd%</action></action> { <action=`/home/fuxino/.config/xmobar/calcurse.sh list` button=1><action=`xdotool key super+shift+a` button=3>%calcurse%</action></action><action=`/home/fuxino/.config/xmobar/backup.sh list`>%backup%</action><action=`/home/fuxino/.config/xmobar/updates.sh list`>%updates%</action><action=`/home/fuxino/.config/xmobar/weather.sh notify`>%weather%</action> <fc=#565f89>·</fc> <action=`/home/fuxino/.config/xmobar/ens_brief.sh week`>%ens_brief%</action> | <action=`pactl set-sink-mute @DEFAULT_SINK@ toggle` button=1>%pactl_volume%</action> | %date% "
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,15 @@
|
|||||||
Config { overrideRedirect = True
|
Config { overrideRedirect = True
|
||||||
, lowerOnStart = True
|
, lowerOnStart = True
|
||||||
, font = "Jetbrains Mono Nerd Font Bold 9"
|
, font = "Jetbrains Mono Nerd Font Bold 10"
|
||||||
|
, additionalFonts = ["Jetbrains Mono Nerd Font Bold 13"]
|
||||||
, bgColor = "#24283b"
|
, bgColor = "#24283b"
|
||||||
, fgColor = "#737aa2"
|
, fgColor = "#737aa2"
|
||||||
, position = Top
|
, position = TopH 24
|
||||||
, border = NoBorder
|
, border = NoBorder
|
||||||
, borderColor = "#24283b"
|
, borderColor = "#24283b"
|
||||||
, allDesktops = True
|
, allDesktops = True
|
||||||
, pickBroadest = True
|
, pickBroadest = True
|
||||||
, commands = [ Run Weather "LZIB"
|
, commands = [ Run Com "/home/fuxino/.config/xmobar/weather.sh" [] "weather" 9000
|
||||||
[ "--template", "\xf2c9 <tempC>°C"
|
|
||||||
, "-L", "5"
|
|
||||||
, "-H", "25"
|
|
||||||
, "--low" , "#8be9fd"
|
|
||||||
, "--normal" , "#50fa7b"
|
|
||||||
, "--high" , "#ff5555"
|
|
||||||
] 9000
|
|
||||||
, Run MultiCpu
|
, Run MultiCpu
|
||||||
[ "--template" , "\xf4bc <total>%"
|
[ "--template" , "\xf4bc <total>%"
|
||||||
, "--Low" , "25"
|
, "--Low" , "25"
|
||||||
@@ -26,16 +20,17 @@ Config { overrideRedirect = True
|
|||||||
] 10
|
] 10
|
||||||
, Run CoreTemp
|
, Run CoreTemp
|
||||||
[ "--template" , "<core0>°C"
|
[ "--template" , "<core0>°C"
|
||||||
, "--Low" , "60"
|
, "--Low" , "70"
|
||||||
, "--High" , "85"
|
, "--High" , "90"
|
||||||
, "--low" , "#50fa7b"
|
, "--low" , "#50fa7b"
|
||||||
, "--normal" , "#ffb86c"
|
, "--normal" , "#ffb86c"
|
||||||
, "--high" , "#ff5555"
|
, "--high" , "#ff5555"
|
||||||
] 50
|
] 50
|
||||||
|
, Run Com "/home/fuxino/.config/xmobar/gpu.sh" [] "gpu" 50
|
||||||
, Run Memory
|
, Run Memory
|
||||||
[ "--template" , "\xefc5 <usedratio>%"
|
[ "--template" , "\xefc5 <usedratio>%"
|
||||||
, "--Low" , "33"
|
, "--Low" , "50"
|
||||||
, "--High" , "66"
|
, "--High" , "80"
|
||||||
, "--low" , "#50fa7b"
|
, "--low" , "#50fa7b"
|
||||||
, "--normal" , "#ffb86c"
|
, "--normal" , "#ffb86c"
|
||||||
, "--high" , "#ff5555"
|
, "--high" , "#ff5555"
|
||||||
@@ -45,18 +40,16 @@ Config { overrideRedirect = True
|
|||||||
, ("us" , "<fc=#ffb86c>US</fc>")
|
, ("us" , "<fc=#ffb86c>US</fc>")
|
||||||
, ("sk(qwerty)" , "<fc=#ff5555>SK</fc>")
|
, ("sk(qwerty)" , "<fc=#ff5555>SK</fc>")
|
||||||
]
|
]
|
||||||
, Run Date "\xf133 %a %Y-%m-%d <fc=#ff79c6>%H:%M</fc>" "date" 10
|
, Run Date "\xf133 %a %d/%m <fc=#ff79c6>%H:%M</fc>" "date" 10
|
||||||
, Run Uptime
|
|
||||||
[ "--template" , "\xf017 <days>d <hours>h"
|
|
||||||
] 600
|
|
||||||
, Run XPropertyLog "_XMONAD_TRAYPAD"
|
, Run XPropertyLog "_XMONAD_TRAYPAD"
|
||||||
, Run Com "/home/fuxino/.config/xmobar/pactl_volume.sh" [] "pactl_volume" 10
|
, Run Com "/home/fuxino/.config/xmobar/pactl_volume.sh" [] "pactl_volume" 10
|
||||||
, Run Com "/home/fuxino/.config/xmobar/ens_brief.sh" [] "ens_brief" 18000
|
, Run Com "/home/fuxino/.config/xmobar/ens_brief.sh" [] "ens_brief" 18000
|
||||||
, Run Com "/home/fuxino/.config/xmobar/updates.sh" [] "updates" 600
|
, Run Com "/home/fuxino/.config/xmobar/updates.sh" [] "updates" 600
|
||||||
, Run Com "/home/fuxino/.config/xmobar/backup.sh" [] "backup" 3600
|
, Run Com "/home/fuxino/.config/xmobar/backup.sh" [] "backup" 3600
|
||||||
|
, Run Com "/home/fuxino/.config/xmobar/calcurse.sh" [] "calcurse" 600
|
||||||
, Run UnsafeXMonadLog
|
, Run UnsafeXMonadLog
|
||||||
]
|
]
|
||||||
, sepChar = "%"
|
, sepChar = "%"
|
||||||
, alignSep = "}{"
|
, alignSep = "}{"
|
||||||
, template = " | %UnsafeXMonadLog% } %uptime% | %multicpu% %coretemp% | %memory% | %kbd% { <action=`/home/fuxino/.config/xmobar/backup.sh list`>%backup%</action><action=`/home/fuxino/.config/xmobar/updates.sh list`>%updates%</action><action=`/home/fuxino/.config/xmobar/ens_brief.sh week`>%LZIB% <fc=#565f89>·</fc> %ens_brief%</action> | %pactl_volume% | %date% %_XMONAD_TRAYPAD% "
|
, template = " | %UnsafeXMonadLog% } %multicpu% %coretemp% | %gpu% | %memory% | <action=`/home/fuxino/.config/xmobar/kbd_cycle.sh` button=1><action=`/home/fuxino/.config/xmobar/kbd_cycle.sh prev` button=3> %kbd%</action></action> { <action=`/home/fuxino/.config/xmobar/calcurse.sh list` button=1><action=`xdotool key super+shift+a` button=3>%calcurse%</action></action><action=`/home/fuxino/.config/xmobar/backup.sh list`>%backup%</action><action=`/home/fuxino/.config/xmobar/updates.sh list`>%updates%</action><action=`/home/fuxino/.config/xmobar/weather.sh notify`>%weather%</action> <fc=#565f89>·</fc> <action=`/home/fuxino/.config/xmobar/ens_brief.sh week`>%ens_brief%</action> | <action=`pactl set-sink-mute @DEFAULT_SINK@ toggle` button=1>%pactl_volume%</action> | %date% %_XMONAD_TRAYPAD% "
|
||||||
}
|
}
|
||||||
+274
-122
@@ -1,10 +1,13 @@
|
|||||||
-- Import
|
-- Import
|
||||||
|
|
||||||
import Data.Monoid
|
import Data.Monoid
|
||||||
import Graphics.X11.ExtraTypes.XF86
|
import Data.Bits (complement, (.&.))
|
||||||
import Control.Monad (forM_, liftM2, when)
|
import Data.Char (toLower)
|
||||||
|
import Control.Monad (filterM, forM_, join, unless, when)
|
||||||
|
import qualified Data.Map.Strict as M
|
||||||
|
import Data.Maybe (isJust)
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Actions.OnScreen (greedyViewOnScreen)
|
import XMonad.Actions.OnScreen (Focus (FocusNew), onScreen)
|
||||||
import XMonad.Actions.PhysicalScreens
|
import XMonad.Actions.PhysicalScreens
|
||||||
import XMonad.Hooks.EwmhDesktops
|
import XMonad.Hooks.EwmhDesktops
|
||||||
import XMonad.Hooks.ManageDocks
|
import XMonad.Hooks.ManageDocks
|
||||||
@@ -12,6 +15,7 @@ import XMonad.Hooks.ManageHelpers
|
|||||||
import XMonad.Hooks.Rescreen
|
import XMonad.Hooks.Rescreen
|
||||||
import XMonad.Hooks.StatusBar
|
import XMonad.Hooks.StatusBar
|
||||||
import XMonad.Hooks.StatusBar.PP
|
import XMonad.Hooks.StatusBar.PP
|
||||||
|
import XMonad.Hooks.UrgencyHook (NoUrgencyHook (..), withUrgencyHook)
|
||||||
import XMonad.Layout.Grid
|
import XMonad.Layout.Grid
|
||||||
import XMonad.Layout.Magnifier
|
import XMonad.Layout.Magnifier
|
||||||
import XMonad.Layout.NoBorders
|
import XMonad.Layout.NoBorders
|
||||||
@@ -24,20 +28,25 @@ import XMonad.Layout.ThreeColumns
|
|||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
import XMonad.Util.ClickableWorkspaces
|
import XMonad.Util.ClickableWorkspaces
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
|
import qualified XMonad.Util.ExtensibleState as XS
|
||||||
import qualified XMonad.Util.Hacks as Hacks
|
import qualified XMonad.Util.Hacks as Hacks
|
||||||
import XMonad.Util.Loggers
|
import XMonad.Util.Loggers
|
||||||
|
import XMonad.Util.NamedActions
|
||||||
import XMonad.Util.NamedScratchpad
|
import XMonad.Util.NamedScratchpad
|
||||||
import XMonad.Util.Run (runProcessWithInput)
|
import XMonad.Util.Run (runProcessWithInput, spawnPipe)
|
||||||
import XMonad.Util.SpawnOnce
|
import XMonad.Util.SpawnOnce
|
||||||
|
import System.IO (hClose, hPutStr)
|
||||||
|
|
||||||
-- Main
|
-- Main
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main =
|
main =
|
||||||
xmonad
|
xmonad
|
||||||
. ewmhFullscreen
|
. ewmhFullscreen
|
||||||
|
. setEwmhFullscreenHooks myFullscreenHook myUnfullscreenHook
|
||||||
. setEwmhSwitchDesktopHook safeView
|
. setEwmhSwitchDesktopHook safeView
|
||||||
. ewmh
|
. ewmh
|
||||||
. docks
|
. docks
|
||||||
|
. withUrgencyHook NoUrgencyHook
|
||||||
. rescreenHook def {afterRescreenHook = restartStatusBars, rescreenWorkspacesHook = Last (Just safeRescreen)}
|
. rescreenHook def {afterRescreenHook = restartStatusBars, rescreenWorkspacesHook = Last (Just safeRescreen)}
|
||||||
. addRandrChangeHook (spawn myScreenHotplug)
|
. addRandrChangeHook (spawn myScreenHotplug)
|
||||||
$ myConfig
|
$ myConfig
|
||||||
@@ -58,17 +67,12 @@ myNormBorderColor = "#1f2335"
|
|||||||
myFocusBorderColor :: String
|
myFocusBorderColor :: String
|
||||||
myFocusBorderColor = "#41a6b5"
|
myFocusBorderColor = "#41a6b5"
|
||||||
|
|
||||||
myKeyboardLayoutIT :: String
|
myEarbuds :: String
|
||||||
myKeyboardLayoutIT = " -layout it"
|
myEarbuds = "F4:9D:8A:B9:8C:EE"
|
||||||
|
|
||||||
myKeyboardLayoutUS :: String
|
|
||||||
myKeyboardLayoutUS = " -layout us"
|
|
||||||
|
|
||||||
myKeyboardLayoutSK :: String
|
|
||||||
myKeyboardLayoutSK = " -layout sk -variant qwerty"
|
|
||||||
|
|
||||||
|
-- Expanded by sh, as spawn runs it
|
||||||
myScreenshotDir :: String
|
myScreenshotDir :: String
|
||||||
myScreenshotDir = "/home/fuxino/Pictures/Screenshots/"
|
myScreenshotDir = "~/Pictures/Screenshots/"
|
||||||
|
|
||||||
myScreenshotName :: String
|
myScreenshotName :: String
|
||||||
myScreenshotName = "Screenshot-%Y-%m-%d-%H%M%S.png"
|
myScreenshotName = "Screenshot-%Y-%m-%d-%H%M%S.png"
|
||||||
@@ -77,34 +81,33 @@ myScreenshotName = "Screenshot-%Y-%m-%d-%H%M%S.png"
|
|||||||
myScreenLayout :: String
|
myScreenLayout :: String
|
||||||
myScreenLayout = "/home/fuxino/.local/bin/screen-layout"
|
myScreenLayout = "/home/fuxino/.local/bin/screen-layout"
|
||||||
|
|
||||||
-- Safe to re-run (e.g. spawnOnce after this string changes and xmonad restarts)
|
-- Safe to re-run (e.g. spawnOnce after this string changes and xmonad restarts); keeps the last wallpapers across logins
|
||||||
myScreenSetup :: String
|
myScreenSetup :: String
|
||||||
myScreenSetup =
|
myScreenSetup =
|
||||||
"sleep 1; " ++ myScreenLayout ++ "; pgrep -x picom > /dev/null || picom -b -c"
|
"sleep 1; " ++ myScreenLayout ++ " --keep-wallpaper; pgrep -x picom > /dev/null || picom -b -c"
|
||||||
|
|
||||||
-- Run when a monitor is (dis)connected; restarts trayer so it moves to the right screen
|
-- Run when a monitor is (dis)connected; restarts trayer so it moves to the right screen
|
||||||
myScreenHotplug :: String
|
myScreenHotplug :: String
|
||||||
myScreenHotplug = myScreenLayout
|
myScreenHotplug = myScreenLayout ++ " --keep-wallpaper"
|
||||||
|
|
||||||
myScratchpads :: [NamedScratchpad]
|
myScratchpads :: [NamedScratchpad]
|
||||||
myScratchpads =
|
myScratchpads =
|
||||||
[ NS "Riseup-vpn" "riseup-vpn" (className =? "RiseupVPN") (customFloating $ W.RationalRect 0.15 0.4 0.15 0.4),
|
[ NS "Windscribe" "windscribe" (className =? "Windscribe2") (customFloating $ W.RationalRect 0.15 0.4 0.15 0.4),
|
||||||
NS "Terminal" spawnTerminal (className =? "scratch-terminal") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6),
|
termPad "Terminal" "kitty-float" "",
|
||||||
NS "Music" spawnMusic (className =? "scratch-music") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6),
|
termPad "Music" "ncmpcpp" "ncmpcpp",
|
||||||
NS "Mail" spawnMail (className =? "scratch-mail") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6),
|
termPad "Mail" "mutt" "bash -c 'pushd ~/Downloads > /dev/null; mutt; popd > /dev/null'",
|
||||||
NS "Cal" spawnCal (className =? "scratch-cal") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6),
|
termPad "Cal" "calcurse" "calcurse",
|
||||||
NS "Btop" spawnBtop (className =? "scratch-btop") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6)
|
termPad "Btop" "btop" "btop"
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
spawnTerminal = myTerminal ++ " --class scratch-terminal -T kitty-float"
|
-- Centred kitty with class scratch-<name>, window title t, running cmd
|
||||||
spawnMusic = myTerminal ++ " --class scratch-music -T ncmpcpp ncmpcpp"
|
termPad name t cmd =
|
||||||
spawnMail = myTerminal ++ " --class scratch-mail -T mutt bash -c 'pushd ~/Downloads > /dev/null; mutt; popd > /dev/null'"
|
let cls = "scratch-" ++ map toLower name
|
||||||
spawnCal = myTerminal ++ " --class scratch-cal -T calcurse calcurse"
|
in NS name (unwords [myTerminal, "--class", cls, "-T", t, cmd]) (className =? cls) (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6)
|
||||||
spawnBtop = myTerminal ++ " --class scratch-btop -T btop btop"
|
|
||||||
|
|
||||||
-- Config
|
-- Config
|
||||||
myConfig =
|
myConfig =
|
||||||
def
|
addDescrKeys' ((myModMask, xK_F1), showKeys) myKeys $ def
|
||||||
{ modMask = myModMask,
|
{ modMask = myModMask,
|
||||||
terminal = myTerminal,
|
terminal = myTerminal,
|
||||||
workspaces = myWorkspaces,
|
workspaces = myWorkspaces,
|
||||||
@@ -116,47 +119,101 @@ myConfig =
|
|||||||
handleEventHook = myHandleEventHook,
|
handleEventHook = myHandleEventHook,
|
||||||
logHook = myLogHook
|
logHook = myLogHook
|
||||||
}
|
}
|
||||||
`additionalKeysP` [ ("M-b", sendMessage ToggleStruts),
|
|
||||||
("M-S-l", spawn "slock"),
|
|
||||||
("<Print>", unGrab *> spawn ("scrot " ++ myScreenshotDir ++ myScreenshotName)),
|
|
||||||
("S-<Print>", unGrab *> spawn ("scrot -s " ++ myScreenshotDir ++ myScreenshotName)),
|
|
||||||
("M-S-<Print>", unGrab *> spawn ("scrot -u " ++ myScreenshotDir ++ myScreenshotName)),
|
|
||||||
("M-d", spawn "dmenu_run"),
|
|
||||||
("M-p", spawn "passmenu -i"),
|
|
||||||
("M-f", sendMessage $ JumpToLayout "Tabbed"),
|
|
||||||
("M-i", spawn $ "setxkbmap" ++ myKeyboardLayoutIT),
|
|
||||||
("M-u", spawn $ "setxkbmap" ++ myKeyboardLayoutUS),
|
|
||||||
("M-s", spawn $ "setxkbmap" ++ myKeyboardLayoutSK),
|
|
||||||
("M-S-v", namedScratchpadAction myScratchpads "Riseup-vpn"),
|
|
||||||
("M-S-s", namedScratchpadAction myScratchpads "Terminal"),
|
|
||||||
("M-S-a", namedScratchpadAction myScratchpads "Cal"),
|
|
||||||
("M-o", namedScratchpadAction myScratchpads "Btop"),
|
|
||||||
("M-x", spawn "bluetoothctl connect F4:9D:8A:B9:8C:EE"),
|
|
||||||
("M-S-x", spawn "bluetoothctl disconnect F4:9D:8A:B9:8C:EE")
|
|
||||||
]
|
|
||||||
`additionalKeys` [ ((0, xF86XK_AudioMute), spawn "pactl set-sink-mute $(pactl get-default-sink) toggle"),
|
|
||||||
((0, xF86XK_AudioLowerVolume), spawn "pactl set-sink-volume $(pactl get-default-sink) -10%"),
|
|
||||||
((0, xF86XK_AudioRaiseVolume), spawn "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 10%+"),
|
|
||||||
((0, xF86XK_AudioPlay), spawn "playerctl play-pause"),
|
|
||||||
((0, xF86XK_AudioPause), spawn "playerctl pause"),
|
|
||||||
((0, xF86XK_AudioStop), spawn "playerctl stop"),
|
|
||||||
((0, xF86XK_AudioNext), spawn "playerctl next"),
|
|
||||||
((0, xF86XK_AudioPrev), spawn "playerctl previous"),
|
|
||||||
((0, xF86XK_Calculator), spawn "qalculate-gtk"),
|
|
||||||
((0, xF86XK_HomePage), spawn myBrowser),
|
|
||||||
((0, xF86XK_Mail), namedScratchpadAction myScratchpads "Mail"),
|
|
||||||
((0, xF86XK_Tools), namedScratchpadAction myScratchpads "Music")
|
|
||||||
]
|
|
||||||
++ [ ((myModMask .|. mask, key), f sc)
|
|
||||||
| (key, sc) <- zip [xK_w, xK_e] [0 ..],
|
|
||||||
(f, mask) <- [(viewScreen def, 0), (sendToScreen def, shiftMask)]
|
|
||||||
]
|
|
||||||
++ [((myModMask, key), windows $ safeView ws) | (ws, key) <- zip myWorkspaces [xK_1 .. xK_9]]
|
|
||||||
|
|
||||||
-- greedyView that keeps wsGames on screen 0 (HDMI): Wine games lose the mouse when moved between screens
|
-- Keys
|
||||||
|
-- xmonad's described defaults minus the ones overridden here, so M-<F1> lists each key once
|
||||||
|
myKeys :: XConfig Layout -> [((KeyMask, KeySym), NamedAction)]
|
||||||
|
myKeys c = dropEmptyGroups (filter ((`notElem` overridden) . fst) (defaultKeysDescr c)) ++ custom
|
||||||
|
where
|
||||||
|
custom = myCustomKeys c
|
||||||
|
-- M-r/M-S-r: there's no third screen
|
||||||
|
overridden = (myModMask, xK_r) : (myModMask .|. shiftMask, xK_r) : filter (/= (0, 0)) (map fst custom)
|
||||||
|
-- (0, 0) is a subtitle or separator; drop it when nothing follows before the next one
|
||||||
|
dropEmptyGroups (((0, 0), _) : rest@(((0, 0), _) : _)) = dropEmptyGroups rest
|
||||||
|
dropEmptyGroups [((0, 0), _)] = []
|
||||||
|
dropEmptyGroups (x : rest) = x : dropEmptyGroups rest
|
||||||
|
dropEmptyGroups [] = []
|
||||||
|
|
||||||
|
myCustomKeys :: XConfig Layout -> [((KeyMask, KeySym), NamedAction)]
|
||||||
|
myCustomKeys c =
|
||||||
|
concatMap
|
||||||
|
(\(t, ks) -> subtitle t : mkNamedKeymap c ks)
|
||||||
|
[ ( "launchers",
|
||||||
|
[ ("M-d", addName "Run a program (dmenu)" $ spawn "dmenu_run"),
|
||||||
|
("M-p", addName "Passwords (passmenu)" $ spawn "passmenu -i"),
|
||||||
|
("<XF86HomePage>", addName "Browser" $ spawn myBrowser),
|
||||||
|
("<XF86Calculator>", addName "Calculator" $ spawn "qalculate-gtk")
|
||||||
|
]
|
||||||
|
),
|
||||||
|
( "scratchpads",
|
||||||
|
[ ("M-S-s", addName "Terminal" $ namedScratchpadAction myScratchpads "Terminal"),
|
||||||
|
("M-S-a", addName "Calendar (calcurse)" $ namedScratchpadAction myScratchpads "Cal"),
|
||||||
|
("M-o", addName "btop" $ namedScratchpadAction myScratchpads "Btop"),
|
||||||
|
("M-S-v", addName "Windscribe VPN" $ namedScratchpadAction myScratchpads "Windscribe"),
|
||||||
|
("<XF86Mail>", addName "Mail (mutt)" $ namedScratchpadAction myScratchpads "Mail"),
|
||||||
|
("<XF86Tools>", addName "Music (ncmpcpp)" $ namedScratchpadAction myScratchpads "Music")
|
||||||
|
]
|
||||||
|
),
|
||||||
|
( "session and layout",
|
||||||
|
[ ("M-S-l", addName "Lock the screen" $ spawn "loginctl lock-session"),
|
||||||
|
("M-S-n", addName "Show older notification" $ spawn "dunstctl history-pop"),
|
||||||
|
("M-C-n", addName "Close all notifications" $ spawn "dunstctl close-all"),
|
||||||
|
("M-b", addName "Toggle the status bar gap" $ sendMessage ToggleStruts),
|
||||||
|
("M-f", addName "Tabbed layout" $ sendMessage $ JumpToLayout "Tabbed"),
|
||||||
|
("M-i", addName "Keyboard: Italian" $ spawn "setxkbmap -layout it"),
|
||||||
|
("M-u", addName "Keyboard: US" $ spawn "setxkbmap -layout us"),
|
||||||
|
("M-s", addName "Keyboard: Slovak" $ spawn "setxkbmap -layout sk -variant qwerty"),
|
||||||
|
("M-x", addName "Connect earbuds" $ spawn $ "bluetoothctl connect " ++ myEarbuds),
|
||||||
|
("M-S-x", addName "Disconnect earbuds" $ spawn $ "bluetoothctl disconnect " ++ myEarbuds)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
( "screenshots",
|
||||||
|
[ ("<Print>", addName "Whole screen" $ unGrab *> spawn ("scrot " ++ myScreenshotDir ++ myScreenshotName)),
|
||||||
|
("S-<Print>", addName "Select an area" $ unGrab *> spawn ("scrot -s " ++ myScreenshotDir ++ myScreenshotName)),
|
||||||
|
("M-S-<Print>", addName "Focused window" $ unGrab *> spawn ("scrot -u " ++ myScreenshotDir ++ myScreenshotName))
|
||||||
|
]
|
||||||
|
),
|
||||||
|
( "media keys",
|
||||||
|
[ ("<XF86AudioMute>", addName "Mute" $ spawn "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"),
|
||||||
|
("<XF86AudioLowerVolume>", addName "Volume down" $ spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%-"),
|
||||||
|
("<XF86AudioRaiseVolume>", addName "Volume up" $ spawn "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 10%+"),
|
||||||
|
("<XF86AudioPlay>", addName "Play/pause" $ spawn "playerctl play-pause"),
|
||||||
|
("<XF86AudioPause>", addName "Pause" $ spawn "playerctl pause"),
|
||||||
|
("<XF86AudioStop>", addName "Stop" $ spawn "playerctl stop"),
|
||||||
|
("<XF86AudioNext>", addName "Next track" $ spawn "playerctl next"),
|
||||||
|
("<XF86AudioPrev>", addName "Previous track" $ spawn "playerctl previous")
|
||||||
|
]
|
||||||
|
),
|
||||||
|
( "workspaces and screens",
|
||||||
|
[ (m ++ show n, addName (d ++ show n ++ " (" ++ name ++ ")") $ windows $ f ws)
|
||||||
|
| (n, ws, name) <- zip3 [1 :: Int ..] myWorkspaces ["terminal", "web", "games", "chat", "media", "docs", "VM", "free", "free"],
|
||||||
|
(m, d, f) <- [("M-", "Workspace ", safeView), ("M-S-", "Send window to workspace ", W.shift)]
|
||||||
|
]
|
||||||
|
++ [ (m ++ k, addName (d ++ side) $ f def sc)
|
||||||
|
| (k, sc, side) <- [("w", 0, "left screen"), ("e", 1, "right screen")],
|
||||||
|
(m, d, f) <- [("M-", "Focus ", viewScreen), ("M-S-", "Send window to ", sendToScreen)]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
-- Shows the key list in dmenu (type to filter; picking a line does nothing).
|
||||||
|
-- spawnPipe rather than runProcessWithInput, which would block xmonad while dmenu is open.
|
||||||
|
showKeys :: [((KeyMask, KeySym), NamedAction)] -> NamedAction
|
||||||
|
showKeys ks = addName "Show keybindings" $ do
|
||||||
|
h <- spawnPipe "dmenu -i -l 30 -p Keys"
|
||||||
|
io $ hPutStr h (unlines $ map tidy $ filter (not . null) $ lines $ unlines $ showKm ks) >> hClose h
|
||||||
|
where
|
||||||
|
-- showKm writes the mod key as M4- (it doesn't know modMask); re-pad after shortening it
|
||||||
|
tidy l@('>' : _) = l
|
||||||
|
tidy l = let (k, d) = break (== ' ') l in take 24 (fixMod k ++ repeat ' ') ++ dropWhile (== ' ') d
|
||||||
|
fixMod ('M' : '4' : '-' : r) = "M-" ++ fixMod r
|
||||||
|
fixMod (x : r) = x : fixMod r
|
||||||
|
fixMod [] = []
|
||||||
|
|
||||||
|
-- greedyView that keeps wsGames on screen 0 (HDMI), and focuses it: Wine games lose the mouse when moved between screens
|
||||||
safeView :: WorkspaceId -> WindowSet -> WindowSet
|
safeView :: WorkspaceId -> WindowSet -> WindowSet
|
||||||
safeView i ws
|
safeView i ws
|
||||||
| i == wsGames = greedyViewOnScreen 0 i ws
|
| i == wsGames = onScreen (W.greedyView i) FocusNew 0 ws
|
||||||
| W.currentTag ws == wsGames && i `elem` map (W.tag . W.workspace) (W.visible ws) = W.view i ws
|
| W.currentTag ws == wsGames && i `elem` map (W.tag . W.workspace) (W.visible ws) = W.view i ws
|
||||||
| otherwise = W.greedyView i ws
|
| otherwise = W.greedyView i ws
|
||||||
|
|
||||||
@@ -180,24 +237,28 @@ safeRescreen = do
|
|||||||
|
|
||||||
-- Workspaces
|
-- Workspaces
|
||||||
myWorkspaces :: [String]
|
myWorkspaces :: [String]
|
||||||
myWorkspaces = [wsTerm, wsWeb, wsGames, wsChat, wsMedia, wsDocs, wsVM] ++ map show [8, 9]
|
myWorkspaces = [wsTerm, wsWeb, wsGames, wsChat, wsMedia, wsDocs, wsVM] ++ map show [8, 9 :: Int]
|
||||||
|
|
||||||
|
-- Icons spill past their advance in the non-Mono Nerd Font: keep them ~1000-1160 units wide or gaps look uneven
|
||||||
wsTerm, wsWeb, wsGames, wsChat, wsMedia, wsDocs, wsVM :: String
|
wsTerm, wsWeb, wsGames, wsChat, wsMedia, wsDocs, wsVM :: String
|
||||||
wsTerm = "1:\xf489 "
|
wsTerm = "1:\xf489 "
|
||||||
wsWeb = "2:\xe743 "
|
wsWeb = "2:\xf0ac "
|
||||||
wsGames = "3:\xf1b6 "
|
wsGames = "3:\xf11b "
|
||||||
wsChat = "4:\xf10b "
|
wsChat = "4:\xf086 "
|
||||||
wsMedia = "5:\xead9 "
|
wsMedia = "5:\xefab "
|
||||||
wsDocs = "6:\xeb69 "
|
wsDocs = "6:\xede2 "
|
||||||
wsVM = "7:\xea7a "
|
wsVM = "7:\xf108 "
|
||||||
|
|
||||||
-- Layout
|
-- Layout
|
||||||
myLayoutHook = onWorkspace wsWeb myWebLayout $ onWorkspace wsGames myGamesLayout $ onWorkspace wsMedia myVideoLayout myDefaultLayout
|
myLayoutHook =
|
||||||
|
avoidStruts $
|
||||||
|
onWorkspaces [wsGames, wsMedia] (smartBorders Full) $
|
||||||
|
onWorkspace wsWeb (spaced $ myTabbed ||| tiled ||| Mirror tiled ||| others) $
|
||||||
|
spaced (tiled ||| Mirror tiled ||| myTabbed ||| others)
|
||||||
where
|
where
|
||||||
myWebLayout = avoidStruts $ renamed [CutWordsLeft 1] $ spacingWithEdge 3 $ myTabbed ||| tiled ||| Mirror tiled ||| threeCol ||| Grid ||| spiral 0.856
|
-- CutWordsLeft drops the "Spacing" prefix from the layout names
|
||||||
myGamesLayout = avoidStruts $ smartBorders Full
|
spaced l = renamed [CutWordsLeft 1] $ spacingWithEdge 3 l
|
||||||
myVideoLayout = avoidStruts $ smartBorders Full
|
others = threeCol ||| Grid ||| spiral 0.856
|
||||||
myDefaultLayout = avoidStruts $ renamed [CutWordsLeft 1] $ spacingWithEdge 3 $ tiled ||| Mirror tiled ||| myTabbed ||| threeCol ||| Grid ||| spiral 0.856
|
|
||||||
threeCol =
|
threeCol =
|
||||||
renamed [Replace "ThreeCol"] $
|
renamed [Replace "ThreeCol"] $
|
||||||
magnifiercz' 1.3 $
|
magnifiercz' 1.3 $
|
||||||
@@ -241,15 +302,47 @@ myXmobarPP =
|
|||||||
ppHidden = cultured . wrap " " "",
|
ppHidden = cultured . wrap " " "",
|
||||||
ppHiddenNoWindows = outerspace . wrap " " "",
|
ppHiddenNoWindows = outerspace . wrap " " "",
|
||||||
ppUrgent = sunsetorange . wrap (keylime "!") (keylime "!"),
|
ppUrgent = sunsetorange . wrap (keylime "!") (keylime "!"),
|
||||||
ppOrder = \[ws, l, _, wins] -> [ws, l, wins],
|
-- Show "1:<icon>" as just the icon; tags stay as they are (clickablePP uses the index)
|
||||||
ppExtras = [logTitles formatFocused formatUnfocused]
|
ppRename = \tag _ -> case break (== ':') tag of
|
||||||
|
(_, ':' : icon) -> icon
|
||||||
|
_ -> tag,
|
||||||
|
-- NamedScratchpad never removes NSP once created; hide it while it's empty
|
||||||
|
ppSort = (. filter (\w -> W.tag w /= scratchpadWorkspaceTag || isJust (W.stack w))) <$> ppSort def,
|
||||||
|
ppOrder = dropTitle,
|
||||||
|
ppLayout = layoutIcon,
|
||||||
|
ppExtras = [budgetTitles]
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
formatFocused = wrap (cultured "[") (cultured "]") . pink . ppWindow
|
-- The focused title is replaced by budgetTitles
|
||||||
formatUnfocused = wrap (outerspace "[") (outerspace "]") . cultured . ppWindow
|
dropTitle :: [String] -> [String]
|
||||||
|
dropTitle (ws : l : _ : rest) = ws : l : rest
|
||||||
|
dropTitle xs = xs
|
||||||
|
|
||||||
ppWindow :: String -> String
|
layoutIcon :: String -> String
|
||||||
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 20
|
layoutIcon l = case l of
|
||||||
|
"Tall" -> "\xf0bcc"
|
||||||
|
"Mirror Tall" -> "\xf0bcb"
|
||||||
|
"Tabbed" -> "\xf04e9"
|
||||||
|
"ThreeCol" -> "\xf056d"
|
||||||
|
"Grid" -> "\xf0570"
|
||||||
|
"Spiral" -> "\xf056e"
|
||||||
|
"Full" -> "\xf0293"
|
||||||
|
_ -> l
|
||||||
|
|
||||||
|
-- Titles share one width budget, so more windows get shorter titles instead of overflowing the bar
|
||||||
|
budgetTitles :: Logger
|
||||||
|
budgetTitles = do
|
||||||
|
n <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset
|
||||||
|
let width = max 8 . min 30 $ 60 `div` max 1 n
|
||||||
|
logTitles' (TitlesFormat (formatFocused width) (formatUnfocused width) (formatUrgent width))
|
||||||
|
|
||||||
|
formatFocused, formatUnfocused, formatUrgent :: Int -> String -> String
|
||||||
|
formatFocused w = wrap (cultured "[") (cultured "]") . pink . ppWindow w
|
||||||
|
formatUnfocused w = wrap (outerspace "[") (outerspace "]") . cultured . ppWindow w
|
||||||
|
formatUrgent w = wrap (keylime "!") (keylime "!") . sunsetorange . ppWindow w
|
||||||
|
|
||||||
|
ppWindow :: Int -> String -> String
|
||||||
|
ppWindow w = xmobarRaw . (\t -> if null t then "untitled" else t) . shorten' "…" w
|
||||||
|
|
||||||
outerspace, pink, sunsetorange, cultured, keylime :: String -> String
|
outerspace, pink, sunsetorange, cultured, keylime :: String -> String
|
||||||
pink = xmobarColor "#ff79c6" ""
|
pink = xmobarColor "#ff79c6" ""
|
||||||
@@ -262,6 +355,7 @@ myXmobarPP =
|
|||||||
myStartupHook :: X ()
|
myStartupHook :: X ()
|
||||||
myStartupHook = do
|
myStartupHook = do
|
||||||
restartStatusBars
|
restartStatusBars
|
||||||
|
scanDiscoverOverlay
|
||||||
spawnOnce myScreenSetup
|
spawnOnce myScreenSetup
|
||||||
spawnOnce "systemctl --user start fehbg.timer"
|
spawnOnce "systemctl --user start fehbg.timer"
|
||||||
spawnOnce "xsetroot -cursor_name left_ptr"
|
spawnOnce "xsetroot -cursor_name left_ptr"
|
||||||
@@ -274,6 +368,8 @@ myStartupHook = do
|
|||||||
spawnOnce "nm-applet"
|
spawnOnce "nm-applet"
|
||||||
spawnOnce "arch-audit-gtk"
|
spawnOnce "arch-audit-gtk"
|
||||||
spawnOnce "calcurse --daemon"
|
spawnOnce "calcurse --daemon"
|
||||||
|
spawnOnce "systemctl --user start calcurse-today.timer"
|
||||||
|
spawnOnce "systemctl --user start calcurse-sync.timer"
|
||||||
spawnOnce "systemctl --user start dunst"
|
spawnOnce "systemctl --user start dunst"
|
||||||
spawnOnce "lxpolkit"
|
spawnOnce "lxpolkit"
|
||||||
spawnOnce "numlockx"
|
spawnOnce "numlockx"
|
||||||
@@ -285,45 +381,60 @@ myStartupHook = do
|
|||||||
myManageHook :: ManageHook
|
myManageHook :: ManageHook
|
||||||
myManageHook =
|
myManageHook =
|
||||||
composeAll
|
composeAll
|
||||||
[ className =? "Gpodder" --> doShift wsMedia,
|
[ -- Proton games are steam_app_<id>; Wine windows are named after their .exe
|
||||||
className =? "An Anime Game Launcher" --> doShift wsGames,
|
className ^? "steam_app_" --> doShift wsGames,
|
||||||
className =? "Qalculate-gtk" --> doFloat,
|
className $? ".exe" --> doShift wsGames,
|
||||||
|
classIn ["steam", "an anime game launcher"] --> doShift wsGames,
|
||||||
title =? "Genshin Impact" --> doShift wsGames,
|
title =? "Genshin Impact" --> doShift wsGames,
|
||||||
className =? "Signal" --> doShift wsChat,
|
classIn ["steam_app_109600", "steam_app_289070"] --> doFloat,
|
||||||
className =? "Spotify" --> doShift wsMedia,
|
classIn ["zen", "vivaldi-stable", "transmission-gtk"] --> doShift wsWeb,
|
||||||
className =? "Transmission-gtk" --> doShift wsWeb,
|
classIn ["signal", "discord"] --> doShift wsChat,
|
||||||
className =? "Viewnior" --> doFloat,
|
classIn ["gpodder", "spotify", "freetube", "scrcpy", "gimp", "audacity"] --> doShift wsMedia,
|
||||||
className =? "Vivaldi-stable" --> doShift wsWeb,
|
classIn ["xreader", "calibre", "library_manager", "libreoffice-calc", "libreoffice-writer"] --> doShift wsDocs,
|
||||||
className =? "Xmessage" --> doFloat,
|
classIn ["virtualbox manager"] --> doShift wsVM,
|
||||||
className =? "Xreader" --> doShift wsDocs,
|
className =? "VirtualBox Machine" --> doFullFloat <+> doShift wsVM,
|
||||||
className =? "calibre" --> doShift wsDocs,
|
className =? "mpv" --> doFullFloat <+> viewShift wsMedia,
|
||||||
className =? "discord" --> doShift wsChat,
|
|
||||||
className =? "explorer.exe" --> doShift wsGames,
|
|
||||||
className =? "feh" --> doFloat,
|
|
||||||
title =? "glxgears" --> doFloat,
|
|
||||||
className =? "library_manager" --> doShift wsDocs,
|
|
||||||
className =? "libreoffice-calc" --> doShift wsDocs,
|
|
||||||
className =? "libreoffice-writer" --> doShift wsDocs,
|
|
||||||
className =? "mpv" --> doFullFloat,
|
|
||||||
className =? "mpv" --> viewShift wsMedia,
|
|
||||||
className =? "freetube" --> doShift wsMedia,
|
|
||||||
className =? myTerminal --> doShift wsTerm,
|
className =? myTerminal --> doShift wsTerm,
|
||||||
className =? "scrcpy" --> doShift wsMedia,
|
classIn
|
||||||
className =? "steam" --> doShift wsGames,
|
[ "qalculate-gtk", "viewnior", "xmessage", "feh", "lxappearance", "qt5ct", "qt6ct",
|
||||||
className =? "steam_app_109600" --> doFloat,
|
"pavucontrol", "org.pulseaudio.pavucontrol", "zenity", "org.gnome.zenity"
|
||||||
className =? "steam_app_109600" --> doShift wsGames,
|
]
|
||||||
className =? "steam_app_289070" --> doFloat,
|
--> doFloat,
|
||||||
className =? "steam_app_289070" --> doShift wsGames,
|
title =? "glxgears" --> doFloat,
|
||||||
className =? "VirtualBox Machine" --> doShift wsVM,
|
|
||||||
className =? "VirtualBox Machine" --> doFullFloat,
|
|
||||||
className =? "VirtualBox Manager" --> doShift wsVM,
|
|
||||||
className =? "zen" --> doShift wsWeb,
|
|
||||||
isDialog --> doFloat,
|
isDialog --> doFloat,
|
||||||
-- Windows that open already fullscreen; ewmhFullscreen only handles later requests
|
-- Windows that open already fullscreen; ewmhFullscreen only handles later requests
|
||||||
isFullscreen --> doFullFloat
|
isFullscreen --> doFullFloat
|
||||||
]
|
]
|
||||||
<+> namedScratchpadManageHook myScratchpads
|
<+> namedScratchpadManageHook myScratchpads
|
||||||
where viewShift = doF . liftM2 (.) safeView W.shift
|
where
|
||||||
|
viewShift = doF . liftA2 (.) safeView W.shift
|
||||||
|
-- Case-insensitive, as GTK4 and firejailed apps capitalise their class differently
|
||||||
|
classIn names = (`elem` names) . map toLower <$> className
|
||||||
|
|
||||||
|
-- Fullscreen toggles: remember each window's float rect (Nothing if tiled) so leaving
|
||||||
|
-- fullscreen restores it instead of always sinking the window.
|
||||||
|
newtype PreFullscreen = PreFullscreen (M.Map Window (Maybe W.RationalRect))
|
||||||
|
|
||||||
|
instance ExtensionClass PreFullscreen where
|
||||||
|
initialValue = PreFullscreen M.empty
|
||||||
|
|
||||||
|
myFullscreenHook :: ManageHook
|
||||||
|
myFullscreenHook = do
|
||||||
|
w <- ask
|
||||||
|
liftX $ do
|
||||||
|
old <- gets (M.lookup w . W.floating . windowset)
|
||||||
|
XS.modify (\(PreFullscreen m) -> PreFullscreen (M.insert w old m))
|
||||||
|
doFullFloat
|
||||||
|
|
||||||
|
-- Windows with no record (e.g. opened fullscreen) are sunk, as before.
|
||||||
|
myUnfullscreenHook :: ManageHook
|
||||||
|
myUnfullscreenHook = do
|
||||||
|
w <- ask
|
||||||
|
old <- liftX $ do
|
||||||
|
PreFullscreen m <- XS.get
|
||||||
|
XS.put (PreFullscreen (M.delete w m))
|
||||||
|
pure (join (M.lookup w m))
|
||||||
|
maybe doSink doRectFloat old
|
||||||
|
|
||||||
-- Handle event hook
|
-- Handle event hook
|
||||||
myHandleEventHook :: Event -> X All
|
myHandleEventHook :: Event -> X All
|
||||||
@@ -332,6 +443,24 @@ myHandleEventHook =
|
|||||||
<> Hacks.trayerAboveXmobarEventHook
|
<> Hacks.trayerAboveXmobarEventHook
|
||||||
<> Hacks.trayerPaddingXmobarEventHook
|
<> Hacks.trayerPaddingXmobarEventHook
|
||||||
<> Hacks.fixSteamFlicker
|
<> Hacks.fixSteamFlicker
|
||||||
|
<> pinWindscribe
|
||||||
|
<> trackDiscoverOverlay
|
||||||
|
|
||||||
|
-- Windscribe moves itself to a saved position after mapping: apply its resizes (as core does for floats) but drop moves.
|
||||||
|
pinWindscribe :: Event -> X All
|
||||||
|
pinWindscribe e@ConfigureRequestEvent {ev_window = w} = do
|
||||||
|
floats <- gets (W.floating . windowset)
|
||||||
|
pinned <- if M.member w floats then runQuery (className =? "Windscribe2") w else pure False
|
||||||
|
when pinned $ withDisplay $ \dpy -> do
|
||||||
|
bw <- asks (borderWidth . config)
|
||||||
|
io $ configureWindow dpy w (ev_value_mask e .&. complement (fromIntegral (cWX .|. cWY))) $
|
||||||
|
WindowChanges
|
||||||
|
{ wc_x = 0, wc_y = 0, wc_width = ev_width e, wc_height = ev_height e,
|
||||||
|
wc_border_width = fromIntegral bw, wc_sibling = ev_above e, wc_stack_mode = ev_detail e }
|
||||||
|
float w
|
||||||
|
io $ sync dpy False
|
||||||
|
pure (All (not pinned))
|
||||||
|
pinWindscribe _ = pure (All True)
|
||||||
|
|
||||||
-- Log hook
|
-- Log hook
|
||||||
myLogHook :: X ()
|
myLogHook :: X ()
|
||||||
@@ -340,11 +469,34 @@ myLogHook = do
|
|||||||
xmonadPropLog =<< dynamicLogString =<< clickablePP myXmobarPP
|
xmonadPropLog =<< dynamicLogString =<< clickablePP myXmobarPP
|
||||||
|
|
||||||
-- discover-overlay's windows are override-redirect, so xmonad doesn't manage them and
|
-- discover-overlay's windows are override-redirect, so xmonad doesn't manage them and
|
||||||
-- raising a floating window (e.g. a game) covers them; put them back on top after every change
|
-- raising a floating window (e.g. a game) covers them; put them back on top after every change.
|
||||||
raiseDiscoverOverlay :: X ()
|
-- They're remembered when mapped, so the log hook doesn't query every window each time.
|
||||||
raiseDiscoverOverlay = withDisplay $ \d -> do
|
newtype OverlayWindows = OverlayWindows [Window]
|
||||||
|
|
||||||
|
instance ExtensionClass OverlayWindows where
|
||||||
|
initialValue = OverlayWindows []
|
||||||
|
|
||||||
|
isDiscoverOverlay :: Window -> X Bool
|
||||||
|
isDiscoverOverlay = runQuery (className =? "Discover-overlay")
|
||||||
|
|
||||||
|
-- Startup (incl. xmonad --restart): pick up overlays mapped before the event hook could see them
|
||||||
|
scanDiscoverOverlay :: X ()
|
||||||
|
scanDiscoverOverlay = withDisplay $ \d -> do
|
||||||
root <- asks theRoot
|
root <- asks theRoot
|
||||||
(_, _, ws) <- io $ queryTree d root
|
(_, _, ws) <- io $ queryTree d root
|
||||||
forM_ ws $ \w -> do
|
XS.put . OverlayWindows =<< filterM isDiscoverOverlay ws
|
||||||
cls <- io $ getClassHint d w
|
|
||||||
when (resClass cls == "Discover-overlay") $ io $ raiseWindow d w
|
trackDiscoverOverlay :: Event -> X All
|
||||||
|
trackDiscoverOverlay MapNotifyEvent {ev_window = w, ev_override_redirect = True} = do
|
||||||
|
overlay <- isDiscoverOverlay w
|
||||||
|
when overlay $ XS.modify $ \(OverlayWindows ws) -> OverlayWindows (w : filter (/= w) ws)
|
||||||
|
pure (All True)
|
||||||
|
trackDiscoverOverlay DestroyWindowEvent {ev_window = w} = do
|
||||||
|
XS.modify $ \(OverlayWindows ws) -> OverlayWindows (filter (/= w) ws)
|
||||||
|
pure (All True)
|
||||||
|
trackDiscoverOverlay _ = pure (All True)
|
||||||
|
|
||||||
|
raiseDiscoverOverlay :: X ()
|
||||||
|
raiseDiscoverOverlay = do
|
||||||
|
OverlayWindows ws <- XS.get
|
||||||
|
unless (null ws) $ withDisplay $ \d -> io $ mapM_ (raiseWindow d) ws
|
||||||
+1
-1
@@ -17,7 +17,7 @@ install script. This README lives in `.github/` to keep it out of the home direc
|
|||||||
| Audio / media | mpd, ncmpcpp, mpDris2, mpv, beets, pipewire |
|
| Audio / media | mpd, ncmpcpp, mpDris2, mpv, beets, pipewire |
|
||||||
| Packaging | `.config/aurutils-makepkg.conf`, `.config/aurb/`, `.local/bin/aurb` / `aurs` (aurutils wrappers) |
|
| Packaging | `.config/aurutils-makepkg.conf`, `.config/aurb/`, `.local/bin/aurb` / `aurs` (aurutils wrappers) |
|
||||||
| Services | `.config/systemd/user/` (timers and overrides) |
|
| Services | `.config/systemd/user/` (timers and overrides) |
|
||||||
| Scripts | `.local/bin/` (screen layout, phone mount, video helpers, Library database dump) |
|
| Scripts | `.local/bin/` (screen layout, phone mount, video helpers, Library, Garmin and Weather database dumps) |
|
||||||
|
|
||||||
Note: `config.fish` sources `~/.bash_aliases`, so the aliases apply in both shells.
|
Note: `config.fish` sources `~/.bash_aliases`, so the aliases apply in both shells.
|
||||||
|
|
||||||
|
|||||||
Executable
+101
@@ -0,0 +1,101 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Renew calcurse-caldav's Google login: catch the OAuth redirect on 127.0.0.1 and hand the code to calcurse-sync.
|
||||||
|
|
||||||
|
--prompt shows a notification first and logs in when it is clicked.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import configparser
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import urllib.parse
|
||||||
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
CONFIG = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config")) / "calcurse" / "caldav" / "config"
|
||||||
|
WAIT_SECONDS = 300
|
||||||
|
|
||||||
|
|
||||||
|
def notify(summary: str, body: str = "", *extra: str) -> str:
|
||||||
|
"""Send a calcurse notification; with actions in extra, wait and return the chosen action's name."""
|
||||||
|
cmd = ["notify-send", "-a", "calcurse", "-i", "x-office-calendar", *extra, summary, body]
|
||||||
|
return subprocess.run(cmd, capture_output=True, text=True).stdout.strip()
|
||||||
|
|
||||||
|
|
||||||
|
def redirect_port() -> int:
|
||||||
|
parser = configparser.RawConfigParser()
|
||||||
|
parser.read(CONFIG)
|
||||||
|
uri = urllib.parse.urlparse(parser.get("OAuth2", "RedirectURI", fallback=""))
|
||||||
|
if uri.hostname != "127.0.0.1" or uri.port is None:
|
||||||
|
sys.exit(f"RedirectURI in {CONFIG} must be http://127.0.0.1:<port>")
|
||||||
|
return uri.port
|
||||||
|
|
||||||
|
|
||||||
|
def ui_running() -> bool:
|
||||||
|
ttys = subprocess.run(["ps", "-C", "calcurse", "-o", "tty="], capture_output=True, text=True).stdout.split()
|
||||||
|
return any(tty != "?" for tty in ttys)
|
||||||
|
|
||||||
|
|
||||||
|
class RedirectHandler(BaseHTTPRequestHandler):
|
||||||
|
result: dict[str, str] = {}
|
||||||
|
|
||||||
|
def do_GET(self) -> None:
|
||||||
|
query = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query)
|
||||||
|
for key in ("code", "error"):
|
||||||
|
if key in query:
|
||||||
|
RedirectHandler.result[key] = query[key][0]
|
||||||
|
done = bool(RedirectHandler.result)
|
||||||
|
self.send_response(200 if done else 404)
|
||||||
|
self.send_header("Content-Type", "text/plain; charset=utf-8")
|
||||||
|
self.end_headers()
|
||||||
|
if done:
|
||||||
|
self.wfile.write(b"calcurse: login received, you can close this tab.\n")
|
||||||
|
|
||||||
|
def log_message(self, format: str, *args: object) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def login() -> int:
|
||||||
|
if ui_running():
|
||||||
|
notify("Google Calendar login", "Close calcurse first, then log in again.", "-u", "critical")
|
||||||
|
return 1
|
||||||
|
server = HTTPServer(("127.0.0.1", redirect_port()), RedirectHandler)
|
||||||
|
# With an expired login calcurse-caldav opens the consent page and exits; with a valid one it just syncs.
|
||||||
|
if subprocess.run(["calcurse-caldav"], capture_output=True).returncode == 0:
|
||||||
|
notify("Google Calendar login", "Already logged in.")
|
||||||
|
return 0
|
||||||
|
deadline = time.monotonic() + WAIT_SECONDS
|
||||||
|
while not RedirectHandler.result and (left := deadline - time.monotonic()) > 0:
|
||||||
|
server.timeout = left
|
||||||
|
server.handle_request()
|
||||||
|
server.server_close()
|
||||||
|
code = RedirectHandler.result.get("code")
|
||||||
|
if not code:
|
||||||
|
reason = RedirectHandler.result.get("error", "no answer from the browser")
|
||||||
|
notify("Google Calendar login failed", reason, "-u", "critical")
|
||||||
|
return 1
|
||||||
|
# The user manager's PATH lacks ~/.local/bin: call calcurse-sync from this script's folder.
|
||||||
|
calcurse_sync = Path(__file__).resolve().with_name("calcurse-sync")
|
||||||
|
sync = subprocess.run([calcurse_sync, "--authcode", code], capture_output=True, text=True)
|
||||||
|
if sync.returncode != 0:
|
||||||
|
last_line = (sync.stdout.strip().splitlines() or [""])[-1]
|
||||||
|
notify("Google Calendar login failed", last_line, "-u", "critical")
|
||||||
|
return 1
|
||||||
|
notify("Google Calendar login renewed", "Synced again.")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> int:
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
||||||
|
parser.add_argument("--prompt", action="store_true", help="ask with a notification before logging in")
|
||||||
|
if parser.parse_args().prompt:
|
||||||
|
body = "Click to log in again, then click Allow in the browser."
|
||||||
|
if notify("Google Calendar login expired", body, "-u", "critical", "-A", "default=Log in") != "default":
|
||||||
|
return 0
|
||||||
|
return login()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
Executable
+57
@@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Sync calcurse with Google Calendar via calcurse-caldav; start the login prompt when the weekly OAuth login expires.
|
||||||
|
# --now: called from the UI's pre-load hook (skip the UI check, shorter timeout, no daemon restart).
|
||||||
|
# --authcode CODE: finish a login (from calcurse-relogin, which checks for the UI itself).
|
||||||
|
set -uo pipefail
|
||||||
|
|
||||||
|
data=${XDG_DATA_HOME:-$HOME/.local/share}/calcurse
|
||||||
|
state=${XDG_STATE_HOME:-$HOME/.local/state}/calcurse-sync
|
||||||
|
expired_flag=$state/login-expired
|
||||||
|
now=false
|
||||||
|
authcode=()
|
||||||
|
case ${1:-} in
|
||||||
|
--now) now=true ;;
|
||||||
|
--authcode) authcode=(--authcode "$2") ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# The UI keeps the data in memory, so syncing under it would lose changes; its post-save hook syncs after it exits.
|
||||||
|
ui_running() {
|
||||||
|
# shellcheck disable=SC2009 # pgrep can't match "has any terminal"
|
||||||
|
ps -C calcurse -o tty= | grep -qv '?'
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! $now && ((${#authcode[@]} == 0)) && ui_running; then
|
||||||
|
echo "calcurse UI is running, skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$state"
|
||||||
|
# BROWSER=true: an expired login must not open browser tabs on its own.
|
||||||
|
out=$(BROWSER=true timeout "$($now && echo 15 || echo 60)" calcurse-caldav "${authcode[@]}" 2>&1)
|
||||||
|
rc=$?
|
||||||
|
printf '%s\n' "$out"
|
||||||
|
|
||||||
|
if ((rc != 0)); then
|
||||||
|
if grep -q 'Access token is missing or refresh token is expired' <<<"$out"; then
|
||||||
|
# Prompt via calcurse-relogin, again daily if the prompt was dismissed.
|
||||||
|
if [[ ! -e $expired_flag || -n $(find "$expired_flag" -mmin +1440) ]]; then
|
||||||
|
systemctl --user start --no-block calcurse-relogin.service
|
||||||
|
touch "$expired_flag"
|
||||||
|
fi
|
||||||
|
elif grep -q 'Another synchronization instance' <<<"$out"; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
exit "$rc"
|
||||||
|
fi
|
||||||
|
rm -f "$expired_flag"
|
||||||
|
|
||||||
|
# A running daemon never re-reads the data files: restart it so imported appointments get alerts.
|
||||||
|
if ! $now && ! grep -q '^0 items imported, 0 items removed locally' <<<"$out"; then
|
||||||
|
pidfile=$data/.daemon.pid
|
||||||
|
if [[ -s $pidfile ]] && pid=$(<"$pidfile") && kill "$pid" 2>/dev/null; then
|
||||||
|
timeout 5 tail --pid="$pid" -f /dev/null
|
||||||
|
# Own scope, so the daemon outlives this oneshot service.
|
||||||
|
systemd-run --user --scope -q calcurse --daemon
|
||||||
|
echo "restarted calcurse daemon"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Notify today's whole-day calcurse events (the daemon only alerts timed appointments).
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
events=$(calcurse -Q --filter-type event,recur-event --days 1 \
|
||||||
|
--format-event '%m\n' --format-recur-event '%m\n' | tail -n +2)
|
||||||
|
|
||||||
|
[[ -n $events ]] || exit 0
|
||||||
|
notify-send -a calcurse -i x-office-calendar "Today" "$events"
|
||||||
Executable
+38
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Usage: db-dump PROJECT DATABASE week|day
|
||||||
|
# Dump a MariaDB database to ~/.local/share/PROJECT/dumps with login ~/.config/PROJECT/dump.cnf.
|
||||||
|
# week: per-ISO-week files, keeping the two newest; day: per-weekday files (seven self-rotating copies).
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if (($# != 3)) || [[ $3 != week && $3 != day ]]; then
|
||||||
|
echo "usage: ${0##*/} PROJECT DATABASE week|day" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
project=$1 db=$2 mode=$3
|
||||||
|
|
||||||
|
cnf=${XDG_CONFIG_HOME:-$HOME/.config}/$project/dump.cnf
|
||||||
|
dir=${XDG_DATA_HOME:-$HOME/.local/share}/$project/dumps
|
||||||
|
if [[ $mode == week ]]; then
|
||||||
|
out=$dir/$db-$(date +%G-W%V).sql.gz
|
||||||
|
else
|
||||||
|
out=$dir/$db-$(LC_ALL=C date +%a).sql.gz
|
||||||
|
fi
|
||||||
|
keep=2
|
||||||
|
|
||||||
|
umask 077
|
||||||
|
mkdir -p "$dir"
|
||||||
|
|
||||||
|
# Write to a temporary file so a failed dump never replaces a good one
|
||||||
|
tmp=$(mktemp "$dir/.dump.XXXXXX")
|
||||||
|
trap 'rm -f "$tmp"' EXIT
|
||||||
|
|
||||||
|
mariadb-dump --defaults-extra-file="$cnf" --single-transaction --databases "$db" | gzip > "$tmp"
|
||||||
|
mv "$tmp" "$out"
|
||||||
|
|
||||||
|
# Weekly names sort by week, so all but the last $keep are the old ones
|
||||||
|
if [[ $mode == week ]]; then
|
||||||
|
dumps=("$dir/$db"-[0-9][0-9][0-9][0-9]-W[0-9][0-9].sql.gz)
|
||||||
|
if ((${#dumps[@]} > keep)); then
|
||||||
|
rm -f -- "${dumps[@]:0:${#dumps[@]}-keep}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Dump the Library database to a per-weekday file (seven self-rotating copies).
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
cnf=${XDG_CONFIG_HOME:-$HOME/.config}/library_manager/dump.cnf
|
|
||||||
dir=${XDG_DATA_HOME:-$HOME/.local/share}/library_manager/dumps
|
|
||||||
out=$dir/Library-$(LC_ALL=C date +%a).sql.gz
|
|
||||||
|
|
||||||
umask 077
|
|
||||||
mkdir -p "$dir"
|
|
||||||
|
|
||||||
# Write to a temporary file so a failed dump never replaces a good one
|
|
||||||
tmp=$(mktemp "$dir/.dump.XXXXXX")
|
|
||||||
trap 'rm -f "$tmp"' EXIT
|
|
||||||
|
|
||||||
mariadb-dump --defaults-extra-file="$cnf" --single-transaction --databases Library | gzip > "$tmp"
|
|
||||||
mv "$tmp" "$out"
|
|
||||||
@@ -22,5 +22,5 @@ pkill -x trayer
|
|||||||
while pgrep -x trayer > /dev/null; do sleep 0.1; done
|
while pgrep -x trayer > /dev/null; do sleep 0.1; done
|
||||||
trayer -l --edge top --align right --SetDockType true \
|
trayer -l --edge top --align right --SetDockType true \
|
||||||
--SetPartialStrut true --expand true --widthtype request \
|
--SetPartialStrut true --expand true --widthtype request \
|
||||||
--tint 0x232634 --height 18 --monitor "$tray" > /dev/null 2>&1 &
|
--transparent true --alpha 0 --tint 0x24283b --height 24 --monitor "$tray" > /dev/null 2>&1 &
|
||||||
disown
|
disown
|
||||||
+42
-5
@@ -2,13 +2,50 @@
|
|||||||
# i3lock-color with a background image and the keyboard layout shown.
|
# i3lock-color with a background image and the keyboard layout shown.
|
||||||
|
|
||||||
image=/usr/share/backgrounds/arch_1920x1080.png
|
image=/usr/share/backgrounds/arch_1920x1080.png
|
||||||
|
err=${XDG_RUNTIME_DIR:-/tmp}/screen-lock.err
|
||||||
|
|
||||||
# -n: stay in the foreground, as xss-lock needs to see when the screen is unlocked.
|
log() { printf '%s\n' "$*" | systemd-cat -t screen-lock -p warning; }
|
||||||
# --indicator keeps the ring (and the layout text) visible before typing.
|
|
||||||
# The layout's default spot (dx:dy+30) falls inside the ring: put it below.
|
# gcr-prompter (ssh key passphrase dialog) grabs the keyboard, so i3lock can't lock: cancel it.
|
||||||
exec i3lock -n -i "$image" -F -c 000000ff \
|
pkill -x gcr-prompter && log "stopped gcr-prompter before locking"
|
||||||
|
|
||||||
|
# Hold notifications while locked; dunst shows them on unlock. A signal to this
|
||||||
|
# script is passed on to i3lock, as the old exec did.
|
||||||
|
was_paused=$(dunstctl is-paused 2>/dev/null)
|
||||||
|
dunstctl set-paused true 2>/dev/null
|
||||||
|
stopped=
|
||||||
|
trap 'stopped=1; kill "$pid" 2>/dev/null' INT TERM HUP
|
||||||
|
|
||||||
|
# i3lock exits 1 if another client holds a grab (dmenu, rofi, a prompt): retry for a minute.
|
||||||
|
tries=0
|
||||||
|
while :; do
|
||||||
|
# -n: stay in the foreground, as xss-lock needs to see when the screen is unlocked.
|
||||||
|
# --indicator keeps the ring (and the layout text) visible before typing.
|
||||||
|
# The layout's default spot (dx:dy+30) falls inside the ring: put it below.
|
||||||
|
i3lock -n -i "$image" -F -c 000000ff \
|
||||||
-e -f --indicator --keylayout 0 \
|
-e -f --indicator --keylayout 0 \
|
||||||
--layout-pos='ix:iy+r+40' --layout-color=ffffffff \
|
--layout-pos='ix:iy+r+40' --layout-color=ffffffff \
|
||||||
--layout-size=24 \
|
--layout-size=24 \
|
||||||
--time-color=ffffffff --date-color=ffffffff --date-str='%A, %d %B' \
|
--time-color=ffffffff --date-color=ffffffff --date-str='%A, %d %B' \
|
||||||
--ring-color=1793d1ff --line-uses-ring "$@"
|
--ring-color=1793d1ff --line-uses-ring "$@" 2>"$err" &
|
||||||
|
pid=$!
|
||||||
|
wait "$pid"
|
||||||
|
status=$?
|
||||||
|
# A trapped signal interrupts the first wait; this one waits for i3lock to exit.
|
||||||
|
if [ -n "$stopped" ]; then
|
||||||
|
wait "$pid" 2>/dev/null
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
[ "$status" -eq 0 ] && break
|
||||||
|
tries=$((tries + 1))
|
||||||
|
log "i3lock failed (exit $status, try $tries): $(cat "$err")"
|
||||||
|
if [ "$tries" -ge 30 ]; then
|
||||||
|
log "giving up: screen not locked"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
[ -n "$stopped" ] && break
|
||||||
|
done
|
||||||
|
rm -f "$err"
|
||||||
|
|
||||||
|
[ "$was_paused" = true ] || dunstctl set-paused false 2>/dev/null
|
||||||
Reference in new issue
Block a user