mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 11:43:03 +03:00
uconsole: v1
This commit is contained in:
parent
13aef359c2
commit
8a6e444470
12 changed files with 599 additions and 327 deletions
8
.bashrc
8
.bashrc
|
|
@ -133,9 +133,13 @@ fi
|
||||||
|
|
||||||
# [[file:Console.org::*Micromamba][Micromamba:1]]
|
# [[file:Console.org::*Micromamba][Micromamba:1]]
|
||||||
init_mamba () {
|
init_mamba () {
|
||||||
export MAMBA_EXE="/home/pavel/.guix-extra-profiles/dev/dev/bin/micromamba";
|
export MAMBA_EXE=$(which micromamba);
|
||||||
export MAMBA_ROOT_PREFIX="/home/pavel/micromamba";
|
export MAMBA_ROOT_PREFIX="/home/pavel/micromamba";
|
||||||
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
if [[ "$(micromamba --version)" > "2.0.0" ]]; then
|
||||||
|
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
||||||
|
else
|
||||||
|
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
||||||
|
fi
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
eval "$__mamba_setup"
|
eval "$__mamba_setup"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,13 @@ set fish_greeting
|
||||||
|
|
||||||
# [[file:../../Console.org::*Micromamba][Micromamba:1]]
|
# [[file:../../Console.org::*Micromamba][Micromamba:1]]
|
||||||
function init_mamba
|
function init_mamba
|
||||||
set -gx MAMBA_EXE "/home/pavel/.guix-extra-profiles/dev/dev/bin/micromamba"
|
set -gx MAMBA_EXE (which micromamba)
|
||||||
set -gx MAMBA_ROOT_PREFIX "/home/pavel/micromamba"
|
set -gx MAMBA_ROOT_PREFIX "/home/pavel/micromamba"
|
||||||
$MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source
|
if test (string replace -a '.' '' -- (micromamba --version)) -gt 200
|
||||||
|
$MAMBA_EXE shell hook --shell fish --root-prefix $MAMBA_ROOT_PREFIX | source &> /dev/null
|
||||||
|
else
|
||||||
|
$MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -n "$INIT_MAMBA";
|
if test -n "$INIT_MAMBA";
|
||||||
|
|
|
||||||
|
|
@ -35,20 +35,6 @@ gright =
|
||||||
; Glyph settings:1 ends here
|
; Glyph settings:1 ends here
|
||||||
|
|
||||||
; [[file:../../Desktop.org::*Generating glyphs][Generating glyphs:3]]
|
; [[file:../../Desktop.org::*Generating glyphs][Generating glyphs:3]]
|
||||||
[module/glyph-light-cyan--cyan]
|
|
||||||
type = custom/text
|
|
||||||
content-background = ${colors.light-cyan}
|
|
||||||
content-foreground = ${colors.cyan}
|
|
||||||
content = ${glyph.gright}
|
|
||||||
content-font = 5
|
|
||||||
|
|
||||||
[module/glyph-magenta--light-cyan]
|
|
||||||
type = custom/text
|
|
||||||
content-background = ${colors.magenta}
|
|
||||||
content-foreground = ${colors.light-cyan}
|
|
||||||
content = ${glyph.gright}
|
|
||||||
content-font = 5
|
|
||||||
|
|
||||||
[module/glyph-light-blue--blue]
|
[module/glyph-light-blue--blue]
|
||||||
type = custom/text
|
type = custom/text
|
||||||
content-background = ${colors.light-blue}
|
content-background = ${colors.light-blue}
|
||||||
|
|
@ -112,10 +98,24 @@ content-foreground = ${colors.cyan}
|
||||||
content = ${glyph.gright}
|
content = ${glyph.gright}
|
||||||
content-font = 5
|
content-font = 5
|
||||||
|
|
||||||
[module/glyph-magenta--cyan]
|
[module/glyph-light-cyan--cyan]
|
||||||
|
type = custom/text
|
||||||
|
content-background = ${colors.light-cyan}
|
||||||
|
content-foreground = ${colors.cyan}
|
||||||
|
content = ${glyph.gright}
|
||||||
|
content-font = 5
|
||||||
|
|
||||||
|
[module/glyph-light-cyan--light-cyan]
|
||||||
|
type = custom/text
|
||||||
|
content-background = ${colors.light-cyan}
|
||||||
|
content-foreground = ${colors.light-cyan}
|
||||||
|
content = ${glyph.gright}
|
||||||
|
content-font = 5
|
||||||
|
|
||||||
|
[module/glyph-magenta--light-cyan]
|
||||||
type = custom/text
|
type = custom/text
|
||||||
content-background = ${colors.magenta}
|
content-background = ${colors.magenta}
|
||||||
content-foreground = ${colors.cyan}
|
content-foreground = ${colors.light-cyan}
|
||||||
content = ${glyph.gright}
|
content = ${glyph.gright}
|
||||||
content-font = 5
|
content-font = 5
|
||||||
|
|
||||||
|
|
@ -126,6 +126,34 @@ content-foreground = ${colors.magenta}
|
||||||
content = ${glyph.gright}
|
content = ${glyph.gright}
|
||||||
content-font = 5
|
content-font = 5
|
||||||
|
|
||||||
|
[module/glyph-red--light-blue]
|
||||||
|
type = custom/text
|
||||||
|
content-background = ${colors.red}
|
||||||
|
content-foreground = ${colors.light-blue}
|
||||||
|
content = ${glyph.gright}
|
||||||
|
content-font = 5
|
||||||
|
|
||||||
|
[module/glyph-light-green--red]
|
||||||
|
type = custom/text
|
||||||
|
content-background = ${colors.light-green}
|
||||||
|
content-foreground = ${colors.red}
|
||||||
|
content = ${glyph.gright}
|
||||||
|
content-font = 5
|
||||||
|
|
||||||
|
[module/glyph-light-magenta--light-cyan]
|
||||||
|
type = custom/text
|
||||||
|
content-background = ${colors.light-magenta}
|
||||||
|
content-foreground = ${colors.light-cyan}
|
||||||
|
content = ${glyph.gright}
|
||||||
|
content-font = 5
|
||||||
|
|
||||||
|
[module/glyph-magenta--cyan]
|
||||||
|
type = custom/text
|
||||||
|
content-background = ${colors.magenta}
|
||||||
|
content-foreground = ${colors.cyan}
|
||||||
|
content = ${glyph.gright}
|
||||||
|
content-font = 5
|
||||||
|
|
||||||
[module/glyph-blue--background]
|
[module/glyph-blue--background]
|
||||||
type = custom/text
|
type = custom/text
|
||||||
content-background = ${colors.blue}
|
content-background = ${colors.blue}
|
||||||
|
|
@ -213,6 +241,11 @@ scroll-down = i3wm-wsprev
|
||||||
; Global bar config:4 ends here
|
; Global bar config:4 ends here
|
||||||
|
|
||||||
; [[file:../../Desktop.org::*Global bar config][Global bar config:5]]
|
; [[file:../../Desktop.org::*Global bar config][Global bar config:5]]
|
||||||
|
dpi-x = ${env:DPI}
|
||||||
|
dpi-y = ${env:DPI}
|
||||||
|
; Global bar config:5 ends here
|
||||||
|
|
||||||
|
; [[file:../../Desktop.org::*Global bar config][Global bar config:6]]
|
||||||
[settings]
|
[settings]
|
||||||
screenchange-reload = true
|
screenchange-reload = true
|
||||||
compositing-background = source
|
compositing-background = source
|
||||||
|
|
@ -224,7 +257,7 @@ compositing-border = over
|
||||||
[global/wm]
|
[global/wm]
|
||||||
margin-top = 0
|
margin-top = 0
|
||||||
margin-bottom = 0
|
margin-bottom = 0
|
||||||
; Global bar config:5 ends here
|
; Global bar config:6 ends here
|
||||||
|
|
||||||
; [[file:../../Desktop.org::*pulseaudio][pulseaudio:1]]
|
; [[file:../../Desktop.org::*pulseaudio][pulseaudio:1]]
|
||||||
[module/pulseaudio]
|
[module/pulseaudio]
|
||||||
|
|
@ -327,6 +360,20 @@ format-background = ${colors.light-cyan}
|
||||||
format-foreground = ${colors.foreground}
|
format-foreground = ${colors.foreground}
|
||||||
; nvidia:2 ends here
|
; nvidia:2 ends here
|
||||||
|
|
||||||
|
; [[file:../../Desktop.org::*backlight][backlight:2]]
|
||||||
|
[module/backlight]
|
||||||
|
type = custom/script
|
||||||
|
exec = /home/pavel/bin/polybar/backlight.sh
|
||||||
|
scroll-up = /home/pavel/bin/polybar/backlight.sh up
|
||||||
|
click-left = /home/pavel/bin/polybar/backlight.sh up
|
||||||
|
scroll-down = /home/pavel/bin/polybar/backlight.sh down
|
||||||
|
click-right = /home/pavel/bin/polybar/backlight.sh down
|
||||||
|
interval = 1
|
||||||
|
|
||||||
|
format-background = ${colors.light-cyan}
|
||||||
|
format-foreground = ${colors.foreground}
|
||||||
|
; backlight:2 ends here
|
||||||
|
|
||||||
; [[file:../../Desktop.org::*ram-memory][ram-memory:1]]
|
; [[file:../../Desktop.org::*ram-memory][ram-memory:1]]
|
||||||
[module/ram-memory]
|
[module/ram-memory]
|
||||||
type = internal/memory
|
type = internal/memory
|
||||||
|
|
@ -429,8 +476,8 @@ layout-icon-1 = us;US
|
||||||
; [[file:../../Desktop.org::*battery][battery:1]]
|
; [[file:../../Desktop.org::*battery][battery:1]]
|
||||||
[module/battery]
|
[module/battery]
|
||||||
type = internal/battery
|
type = internal/battery
|
||||||
battery = BAT0
|
battery = ${env:BATTERY:BAT0}
|
||||||
adapter = ADP0
|
adapter = ${env:ADAPTER:ADP0}
|
||||||
|
|
||||||
time-format = %H:%M
|
time-format = %H:%M
|
||||||
format-discharging = <ramp-capacity> <label-discharging>
|
format-discharging = <ramp-capacity> <label-discharging>
|
||||||
|
|
@ -527,7 +574,7 @@ content-background = ${colors.blue}
|
||||||
; [[file:../../Desktop.org::*C-g][C-g:3]]
|
; [[file:../../Desktop.org::*C-g][C-g:3]]
|
||||||
[module/glyph-left-light-background--blue]
|
[module/glyph-left-light-background--blue]
|
||||||
type = custom/text
|
type = custom/text
|
||||||
content-background = ${colors.backround}
|
content-background = ${colors.background}
|
||||||
content-foreground = ${colors.blue}
|
content-foreground = ${colors.blue}
|
||||||
content = ${glyph.gleft}
|
content = ${glyph.gleft}
|
||||||
content-font = 5
|
content-font = 5
|
||||||
|
|
|
||||||
|
|
@ -1,136 +1,122 @@
|
||||||
|
(use-modules (shepherd service timer))
|
||||||
|
|
||||||
(define mpd
|
(define mpd
|
||||||
(make <service>
|
(service '(mpd)
|
||||||
#:provides '(mpd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("mpd" "--no-daemon"))
|
#:start (make-forkexec-constructor '("mpd" "--no-daemon"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define sqrt-data-agent-mpd
|
(define sqrt-data-agent-mpd
|
||||||
(make <service>
|
(service '(sqrt-data-agent-mpd)
|
||||||
#:provides '(sqrt-data-agent-mpd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("sqrt_data_agent_mpd"))
|
#:start (make-forkexec-constructor '("sqrt_data_agent_mpd"))
|
||||||
#:stop (make-kill-destructor)
|
#:stop (make-kill-destructor)
|
||||||
#:requires '(mpd)))
|
#:requirement '(mpd)))
|
||||||
|
|
||||||
(define deterred-mpd
|
(define deterred-mpd
|
||||||
(make <service>
|
(service '(deterred-mpd)
|
||||||
#:provides '(deterred-mpd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor
|
#:start (make-forkexec-constructor
|
||||||
'("python" "/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py"
|
'("python" "/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py"
|
||||||
"--db" "/home/pavel/.deterred/database.db"))
|
"--db" "/home/pavel/.deterred/database.db"))
|
||||||
#:stop (make-kill-destructor)
|
#:stop (make-kill-destructor)
|
||||||
#:requires '(mpd)))
|
#:requirement '(mpd)))
|
||||||
|
|
||||||
(define mcron
|
(define mcron
|
||||||
(make <service>
|
(service '(mcron)
|
||||||
#:provides '(mcron)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("mcron"))
|
#:start (make-forkexec-constructor '("mcron"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define aw-server
|
(define aw-server
|
||||||
(make <service>
|
(service '(aw-server)
|
||||||
#:provides '(aw-server)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("aw-server"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-run" "aw-server"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define aw-watcher-afk
|
(define aw-watcher-afk
|
||||||
(make <service>
|
(service '(aw-watcher-afk)
|
||||||
#:provides '(aw-watcher-afk)
|
#:requirement '(aw-server)
|
||||||
#:requires '(aw-server)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-watcher-afk-wrapper"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-run" "aw-watcher-afk"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define aw-watcher-window
|
(define aw-watcher-window
|
||||||
(make <service>
|
(service '(aw-watcher-window)
|
||||||
#:provides '(aw-watcher-window)
|
#:requirement '(aw-server)
|
||||||
#:requires '(aw-server)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("aw-watcher-window"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-run" "aw-watcher-window"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define pulseeffects
|
(define pulseeffects
|
||||||
(make <service>
|
(service '(pulseeffects)
|
||||||
#:provides '(pulseeffects)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("flatpak" "run" "com.github.wwmm.pulseeffects" "--gapplication-service"))
|
#:start (make-forkexec-constructor '("flatpak" "run" "com.github.wwmm.pulseeffects" "--gapplication-service"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define xsettingsd
|
(define xsettingsd
|
||||||
(make <service>
|
(service '(xsettingsd)
|
||||||
#:provides '(xsettingsd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("xsettingsd"))
|
#:start (make-forkexec-constructor '("xsettingsd"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define nm-applet
|
(define nm-applet
|
||||||
(make <service>
|
(service '(nm-applet)
|
||||||
#:provides '(nm-applet)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("nm-applet"))
|
#:start (make-forkexec-constructor '("nm-applet"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define discord-rich-presence
|
(define discord-rich-presence
|
||||||
(make <service>
|
(service '(discord-rich-presence)
|
||||||
#:provides '(discord-rich-presence)
|
|
||||||
#:one-shot? #t
|
#:one-shot? #t
|
||||||
#:start (make-system-constructor "ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-0")))
|
#:start (make-system-constructor "ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-0")))
|
||||||
|
|
||||||
(define polkit-gnome
|
(define polkit-gnome
|
||||||
(make <service>
|
(service '(polkit-gnome)
|
||||||
#:provides '(polkit-gnome)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("/home/pavel/.guix-extra-profiles/desktop-misc/desktop-misc/libexec/polkit-gnome-authentication-agent-1"))
|
#:start (make-forkexec-constructor
|
||||||
|
(if (file-exists? "/home/pavel/.guix-extra-profiles/")
|
||||||
|
'("/home/pavel/.guix-extra-profiles/desktop-misc/desktop-misc/libexec/polkit-gnome-authentication-agent-1")
|
||||||
|
'("/usr/libexec/polkit-agent-helper-1")))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define xmodmap
|
(define xmodmap
|
||||||
(make <service>
|
(service '(xmodmap)
|
||||||
#:provides '(xmodmap)
|
|
||||||
#:one-shot? #t
|
#:one-shot? #t
|
||||||
#:start (make-system-constructor "xmodmap /home/pavel/.Xmodmap")))
|
#:start (make-system-constructor "xmodmap /home/pavel/.Xmodmap")))
|
||||||
|
|
||||||
(define vpn
|
(define vpn
|
||||||
(make <service>
|
(service '(vpn)
|
||||||
#:provides '(vpn)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/vpn-start"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/vpn-start"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define davmail
|
(define davmail
|
||||||
(make <service>
|
(service '(davmail)
|
||||||
#:provides '(davmail)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("/home/pavel/bin/davmail"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/davmail"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define vnstatd
|
(define vnstatd
|
||||||
(make <service>
|
(service '(vnstatd)
|
||||||
#:provides '(vnstatd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("vnstatd" "-n"))
|
#:start (make-forkexec-constructor '("vnstatd" "-n"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define opensnitchd
|
(define opensnitchd
|
||||||
(make <service>
|
(service '(opensnitchd)
|
||||||
#:provides '(opensnitchd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("sudo" "opensnitchd"))
|
#:start (make-forkexec-constructor '("sudo" "opensnitchd"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define opensnitch-ui
|
(define opensnitch-ui
|
||||||
(make <service>
|
(service '(opensnitch-ui)
|
||||||
#:provides '(opensnitch-ui)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("sudo" "opensnitch-ui"))
|
#:start (make-forkexec-constructor '("sudo" "opensnitch-ui"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define ollama
|
(define ollama
|
||||||
(make <service>
|
(service '(ollama)
|
||||||
#:provides '(ollama)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("ollama" "serve"))
|
#:start (make-forkexec-constructor '("ollama" "serve"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -156,23 +142,25 @@
|
||||||
;; opensnitch-ui
|
;; opensnitch-ui
|
||||||
ollama)
|
ollama)
|
||||||
|
|
||||||
(action 'shepherd 'daemonize)
|
(perform-service-action root-service 'daemonize)
|
||||||
|
|
||||||
(for-each start '(mpd
|
(for-each start-service
|
||||||
sqrt-data-agent-mpd
|
(list
|
||||||
deterred-mpd
|
mpd
|
||||||
mcron
|
sqrt-data-agent-mpd
|
||||||
aw-server
|
deterred-mpd
|
||||||
aw-watcher-afk
|
mcron
|
||||||
aw-watcher-window
|
aw-server
|
||||||
pulseeffects
|
aw-watcher-afk
|
||||||
xsettingsd
|
aw-watcher-window
|
||||||
;; discord-rich-presence
|
pulseeffects
|
||||||
;; polkit-gnome
|
xsettingsd
|
||||||
davmail
|
;; discord-rich-presence
|
||||||
;; ; xmodmap
|
;; polkit-gnome
|
||||||
;; nm-applet
|
davmail
|
||||||
vnstatd
|
;; ; xmodmap
|
||||||
;; opensnitchd
|
;; nm-applet
|
||||||
;; opensnitch-ui
|
vnstatd
|
||||||
))
|
;; opensnitchd
|
||||||
|
;; opensnitch-ui
|
||||||
|
))
|
||||||
|
|
|
||||||
|
|
@ -177,9 +177,6 @@ _=_: Balance "
|
||||||
(seq-uniq (cons exwm-workspace-current-index
|
(seq-uniq (cons exwm-workspace-current-index
|
||||||
my/exwm-last-workspaces))))
|
my/exwm-last-workspaces))))
|
||||||
|
|
||||||
(add-hook 'exwm-workspace-switch-hook
|
|
||||||
#'my/exwm-store-last-workspace)
|
|
||||||
|
|
||||||
(defun my/exwm-last-workspaces-clear ()
|
(defun my/exwm-last-workspaces-clear ()
|
||||||
"Clean `my/exwm-last-workspaces' from deleted workspaces."
|
"Clean `my/exwm-last-workspaces' from deleted workspaces."
|
||||||
(setq my/exwm-last-workspaces
|
(setq my/exwm-last-workspaces
|
||||||
|
|
@ -556,8 +553,9 @@ _d_: Discord
|
||||||
(exwm--log "Unhandled: %s(%d)"
|
(exwm--log "Unhandled: %s(%d)"
|
||||||
(x-get-atom-name type exwm-workspace--current) type)))))
|
(x-get-atom-name type exwm-workspace--current) type)))))
|
||||||
|
|
||||||
(with-eval-after-load 'exwm
|
(unless my/is-uconsole
|
||||||
(advice-add 'exwm--on-ClientMessage :override #'exwm--on-ClientMessage-old))
|
(with-eval-after-load 'exwm
|
||||||
|
(advice-add 'exwm--on-ClientMessage :override #'exwm--on-ClientMessage-old)))
|
||||||
|
|
||||||
(setq exwm-manage-configurations
|
(setq exwm-manage-configurations
|
||||||
'(((member exwm-class-name '("Nyxt"))
|
'(((member exwm-class-name '("Nyxt"))
|
||||||
|
|
@ -570,8 +568,11 @@ _d_: Discord
|
||||||
(my/exwm-set-wallpaper)
|
(my/exwm-set-wallpaper)
|
||||||
(my/exwm-run-shepherd)
|
(my/exwm-run-shepherd)
|
||||||
(my/run-in-background "gpgconf --reload gpg-agent")
|
(my/run-in-background "gpgconf --reload gpg-agent")
|
||||||
(when (my/is-arch)
|
(when (or (my/is-arch)
|
||||||
(my/run-in-background "set_layout")))
|
(equal (system-name) "amaranth"))
|
||||||
|
(my/run-in-background "set_layout"))
|
||||||
|
(add-hook 'exwm-workspace-switch-hook
|
||||||
|
#'my/exwm-store-last-workspace))
|
||||||
|
|
||||||
(defun my/exwm-update-class ()
|
(defun my/exwm-update-class ()
|
||||||
(exwm-workspace-rename-buffer (format "EXWM :: %s" exwm-class-name)))
|
(exwm-workspace-rename-buffer (format "EXWM :: %s" exwm-class-name)))
|
||||||
|
|
@ -710,6 +711,16 @@ _d_: Discord
|
||||||
(when (or (< ,i (exwm-workspace--count))
|
(when (or (< ,i (exwm-workspace--count))
|
||||||
(y-or-n-p (format "Create workspace %d" ,i)))
|
(y-or-n-p (format "Create workspace %d" ,i)))
|
||||||
(exwm-workspace-switch-create ,i) ))))
|
(exwm-workspace-switch-create ,i) ))))
|
||||||
|
(number-sequence 0 9))
|
||||||
|
,@(mapcar (lambda (i)
|
||||||
|
(when (= i 0)
|
||||||
|
(setq i 10))
|
||||||
|
`(,(kbd (format "s-<f%d>" i)) .
|
||||||
|
(lambda ()
|
||||||
|
(interactive)
|
||||||
|
(when (or (< ,i (exwm-workspace--count))
|
||||||
|
(y-or-n-p (format "Create workspace %d" ,i)))
|
||||||
|
(exwm-workspace-switch-create ,i) ))))
|
||||||
(number-sequence 0 9))))
|
(number-sequence 0 9))))
|
||||||
|
|
||||||
(defun exwm-input--fake-last-command ()
|
(defun exwm-input--fake-last-command ()
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
|
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
|
||||||
|
|
||||||
|
(setq my/is-uconsole (string= (system-name) "amaranth"))
|
||||||
|
|
||||||
(defun my/system-name ()
|
(defun my/system-name ()
|
||||||
(or (getenv "ANDROID_NAME")
|
(or (getenv "ANDROID_NAME")
|
||||||
(system-name)))
|
(system-name)))
|
||||||
|
|
@ -41,7 +43,7 @@
|
||||||
gcs-done)
|
gcs-done)
|
||||||
(setq my/emacs-started t)))
|
(setq my/emacs-started t)))
|
||||||
|
|
||||||
(setq use-package-verbose nil)
|
(setq use-package-verbose t)
|
||||||
|
|
||||||
(setq use-package-compute-statistics t)
|
(setq use-package-compute-statistics t)
|
||||||
|
|
||||||
|
|
@ -1421,6 +1423,9 @@ targets."
|
||||||
(add-to-list 'default-frame-alist `(font . ,font)))
|
(add-to-list 'default-frame-alist `(font . ,font)))
|
||||||
(message "Install JetBrainsMono Nerd Font!")))
|
(message "Install JetBrainsMono Nerd Font!")))
|
||||||
|
|
||||||
|
(when my/is-uconsole
|
||||||
|
(set-face-attribute 'default nil :height 140))
|
||||||
|
|
||||||
(when (display-graphic-p)
|
(when (display-graphic-p)
|
||||||
(set-face-attribute 'variable-pitch nil :family "Cantarell" :height 1.0)
|
(set-face-attribute 'variable-pitch nil :family "Cantarell" :height 1.0)
|
||||||
(set-face-attribute
|
(set-face-attribute
|
||||||
|
|
@ -1573,6 +1578,15 @@ targets."
|
||||||
(when (fboundp #'my/exwm-run-polybar)
|
(when (fboundp #'my/exwm-run-polybar)
|
||||||
(my/exwm-run-polybar))))
|
(my/exwm-run-polybar))))
|
||||||
|
|
||||||
|
(defun my/doom-modeline-uconsole--font-height ()
|
||||||
|
20)
|
||||||
|
|
||||||
|
(when my/is-uconsole
|
||||||
|
(with-eval-after-load 'doom-modeline
|
||||||
|
(advice-add #'doom-modeline--font-height :override #'my-doom-modeline--font-height))
|
||||||
|
(setq doom-modeline-window-width-limit 70)
|
||||||
|
(setq doom-modeline-major-mode-icon nil))
|
||||||
|
|
||||||
(use-package perspective
|
(use-package perspective
|
||||||
:straight t
|
:straight t
|
||||||
:init
|
:init
|
||||||
|
|
|
||||||
42
.profile
42
.profile
|
|
@ -30,6 +30,12 @@ if [ -f "/home/pavel/.no-guix" ]; then
|
||||||
fi
|
fi
|
||||||
# Environment:6 ends here
|
# Environment:6 ends here
|
||||||
|
|
||||||
|
# [[file:Console.org::*Environment][Environment:7]]
|
||||||
|
if [ "$(hostname)" = "amaranth" ]; then
|
||||||
|
export XDG_DATA_DIRS=/usr/share/fkms:/usr/local/share:/usr/share/raspi-ui-overrides:/usr/share:/usr/share/gdm:/var/lib/menu-xdg:$XDG_DATA_DIRS
|
||||||
|
fi
|
||||||
|
# Environment:7 ends here
|
||||||
|
|
||||||
# [[file:Console.org::*My paths][My paths:1]]
|
# [[file:Console.org::*My paths][My paths:1]]
|
||||||
if [ -d "$HOME/bin" ] ; then
|
if [ -d "$HOME/bin" ] ; then
|
||||||
export PATH="$HOME/bin:$PATH"
|
export PATH="$HOME/bin:$PATH"
|
||||||
|
|
@ -52,10 +58,10 @@ fi
|
||||||
|
|
||||||
# [[file:Console.org::*ssh-agent][ssh-agent:1]]
|
# [[file:Console.org::*ssh-agent][ssh-agent:1]]
|
||||||
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
|
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
|
||||||
ssh-agent -t 1h > "/tmp/ssh-agent.env"
|
ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env"
|
||||||
fi
|
fi
|
||||||
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
|
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
|
||||||
source "/tmp/ssh-agent.env" >/dev/null
|
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
|
||||||
fi
|
fi
|
||||||
# ssh-agent:1 ends here
|
# ssh-agent:1 ends here
|
||||||
|
|
||||||
|
|
@ -104,30 +110,48 @@ fi
|
||||||
# Other package managers:1 ends here
|
# Other package managers:1 ends here
|
||||||
|
|
||||||
# [[file:Console.org::*Other package managers][Other package managers:2]]
|
# [[file:Console.org::*Other package managers][Other package managers:2]]
|
||||||
if [ -d "$HOME/.local/share/flatpak" ]; then
|
if [ -d "/usr/local/go/" ]; then
|
||||||
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share"
|
export PATH="/usr/local/go/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
# Other package managers:2 ends here
|
# Other package managers:2 ends here
|
||||||
|
|
||||||
# [[file:Console.org::*Other package managers][Other package managers:3]]
|
# [[file:Console.org::*Other package managers][Other package managers:3]]
|
||||||
|
if [ -d "$HOME/.cargo" ] ; then
|
||||||
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
|
fi
|
||||||
|
# Other package managers:3 ends here
|
||||||
|
|
||||||
|
# [[file:Console.org::*Other package managers][Other package managers:4]]
|
||||||
|
if [ -d "/opt/guile" ]; then
|
||||||
|
export PATH="/opt/guile/bin:$PATH"
|
||||||
|
fi
|
||||||
|
# Other package managers:4 ends here
|
||||||
|
|
||||||
|
# [[file:Console.org::*Other package managers][Other package managers:5]]
|
||||||
|
if [ -d "$HOME/.local/share/flatpak" ]; then
|
||||||
|
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share"
|
||||||
|
fi
|
||||||
|
# Other package managers:5 ends here
|
||||||
|
|
||||||
|
# [[file:Console.org::*Other package managers][Other package managers:6]]
|
||||||
if [ -f /run/current-system/profile/etc/profile.d/nix.sh ] && [ -z "$NO_GUIX" ] ; then
|
if [ -f /run/current-system/profile/etc/profile.d/nix.sh ] && [ -z "$NO_GUIX" ] ; then
|
||||||
. /run/current-system/profile/etc/profile.d/nix.sh
|
. /run/current-system/profile/etc/profile.d/nix.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e /home/pavel/.nix-profile/etc/profile.d/nix.sh ] && [ -z "$NO_GUIX" ] ; then . /home/pavel/.nix-profile/etc/profile.d/nix.sh; fi
|
if [ -e /home/pavel/.nix-profile/etc/profile.d/nix.sh ] && [ -z "$NO_GUIX" ] ; then . /home/pavel/.nix-profile/etc/profile.d/nix.sh; fi
|
||||||
# Other package managers:3 ends here
|
# Other package managers:6 ends here
|
||||||
|
|
||||||
# [[file:Console.org::*Other package managers][Other package managers:4]]
|
# [[file:Console.org::*Other package managers][Other package managers:7]]
|
||||||
if [ -d "$HOME/.guix-extra-profiles/desktop-misc" ] && [ -z "$NO_GUIX" ] ; then
|
if [ -d "$HOME/.guix-extra-profiles/desktop-misc" ] && [ -z "$NO_GUIX" ] ; then
|
||||||
export FONTCONFIG_PATH="$HOME/.guix-extra-profiles/desktop-misc/desktop-misc/etc/fonts"
|
export FONTCONFIG_PATH="$HOME/.guix-extra-profiles/desktop-misc/desktop-misc/etc/fonts"
|
||||||
fi
|
fi
|
||||||
# Other package managers:4 ends here
|
# Other package managers:7 ends here
|
||||||
|
|
||||||
# [[file:Console.org::*Other package managers][Other package managers:5]]
|
# [[file:Console.org::*Other package managers][Other package managers:8]]
|
||||||
if [ -d "$HOME/.nix-profile" ] && [ -z "$NO_GUIX" ]; then
|
if [ -d "$HOME/.nix-profile" ] && [ -z "$NO_GUIX" ]; then
|
||||||
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.nix-profile/share/applications"
|
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.nix-profile/share/applications"
|
||||||
fi
|
fi
|
||||||
# Other package managers:5 ends here
|
# Other package managers:8 ends here
|
||||||
|
|
||||||
# [[file:Console.org::*npm][npm:2]]
|
# [[file:Console.org::*npm][npm:2]]
|
||||||
export NPM_CONFIG_USERCONFIG=$HOME/._npmrc
|
export NPM_CONFIG_USERCONFIG=$HOME/._npmrc
|
||||||
|
|
|
||||||
57
Console.org
57
Console.org
|
|
@ -80,6 +80,14 @@ if [ -f "/home/pavel/.no-guix" ]; then
|
||||||
fi
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Fix =XDG_DATA_DIRS= on Raspberry. Not sure what's going on.
|
||||||
|
|
||||||
|
#+begin_src bash
|
||||||
|
if [ "$(hostname)" = "amaranth" ]; then
|
||||||
|
export XDG_DATA_DIRS=/usr/share/fkms:/usr/local/share:/usr/share/raspi-ui-overrides:/usr/share:/usr/share/gdm:/var/lib/menu-xdg:$XDG_DATA_DIRS
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** My paths
|
** My paths
|
||||||
My script folders
|
My script folders
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
|
|
@ -161,7 +169,7 @@ Somehow LibreOffice doesn't work without the following:
|
||||||
export GIO_EXTRA_MODULES=""
|
export GIO_EXTRA_MODULES=""
|
||||||
#+end_src
|
#+end_src
|
||||||
** Other package managers
|
** Other package managers
|
||||||
Using other package managers with Guix requires some extra work.
|
Using other package managers with Guix requires some extra work; this section is also relevant for my non-guix setup.
|
||||||
|
|
||||||
Cask
|
Cask
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
|
|
@ -170,6 +178,27 @@ if [ -d "$HOME/.cask" ]; then
|
||||||
fi
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Golang:
|
||||||
|
#+begin_src sh
|
||||||
|
if [ -d "/usr/local/go/" ]; then
|
||||||
|
export PATH="/usr/local/go/bin:$PATH"
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Cargo:
|
||||||
|
#+begin_src sh
|
||||||
|
if [ -d "$HOME/.cargo" ] ; then
|
||||||
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Guile:
|
||||||
|
#+begin_src sh
|
||||||
|
if [ -d "/opt/guile" ]; then
|
||||||
|
export PATH="/opt/guile/bin:$PATH"
|
||||||
|
fi
|
||||||
|
#+end_src
|
||||||
|
|
||||||
Make flatpak apps visible to launchers:
|
Make flatpak apps visible to launchers:
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
if [ -d "$HOME/.local/share/flatpak" ]; then
|
if [ -d "$HOME/.local/share/flatpak" ]; then
|
||||||
|
|
@ -196,12 +225,14 @@ fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Make nix apps visible to launchers:
|
Make nix apps visible to launchers:
|
||||||
|
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
if [ -d "$HOME/.nix-profile" ] && [ -z "$NO_GUIX" ]; then
|
if [ -d "$HOME/.nix-profile" ] && [ -z "$NO_GUIX" ]; then
|
||||||
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.nix-profile/share/applications"
|
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.nix-profile/share/applications"
|
||||||
fi
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
*** npm
|
*** npm
|
||||||
npm is especially cumbersome, for instance because by default it tries to install packages to =/gnu/store/=.
|
npm is especially cumbersome, for instance because by default it tries to install packages to =/gnu/store/=.
|
||||||
|
|
||||||
|
|
@ -247,13 +278,6 @@ if [ -d "/usr/local/texlive/2020" ]; then
|
||||||
fi
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Cargo (Rust)
|
|
||||||
#+begin_src sh :tangle no
|
|
||||||
if [ -d "$HOME/.cargo" ] ; then
|
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
fi
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
RVM (Ruby)
|
RVM (Ruby)
|
||||||
#+begin_src sh :tangle no
|
#+begin_src sh :tangle no
|
||||||
if [ -d "$HOME/.rvm" ] ; then
|
if [ -d "$HOME/.rvm" ] ; then
|
||||||
|
|
@ -474,9 +498,13 @@ Yeah, tell this to yourself
|
||||||
|
|
||||||
#+begin_src bash
|
#+begin_src bash
|
||||||
init_mamba () {
|
init_mamba () {
|
||||||
export MAMBA_EXE="/home/pavel/.guix-extra-profiles/dev/dev/bin/micromamba";
|
export MAMBA_EXE=$(which micromamba);
|
||||||
export MAMBA_ROOT_PREFIX="/home/pavel/micromamba";
|
export MAMBA_ROOT_PREFIX="/home/pavel/micromamba";
|
||||||
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
if [[ "$(micromamba --version)" > "2.0.0" ]]; then
|
||||||
|
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
||||||
|
else
|
||||||
|
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
||||||
|
fi
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
eval "$__mamba_setup"
|
eval "$__mamba_setup"
|
||||||
else
|
else
|
||||||
|
|
@ -564,6 +592,7 @@ end
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Suppress fish greeting
|
Suppress fish greeting
|
||||||
|
|
||||||
#+begin_src fish
|
#+begin_src fish
|
||||||
set fish_greeting
|
set fish_greeting
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -571,9 +600,13 @@ set fish_greeting
|
||||||
First, a function to initialize micromamba.
|
First, a function to initialize micromamba.
|
||||||
#+begin_src fish
|
#+begin_src fish
|
||||||
function init_mamba
|
function init_mamba
|
||||||
set -gx MAMBA_EXE "/home/pavel/.guix-extra-profiles/dev/dev/bin/micromamba"
|
set -gx MAMBA_EXE (which micromamba)
|
||||||
set -gx MAMBA_ROOT_PREFIX "/home/pavel/micromamba"
|
set -gx MAMBA_ROOT_PREFIX "/home/pavel/micromamba"
|
||||||
$MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source
|
if test (string replace -a '.' '' -- (micromamba --version)) -gt 200
|
||||||
|
$MAMBA_EXE shell hook --shell fish --root-prefix $MAMBA_ROOT_PREFIX | source &> /dev/null
|
||||||
|
else
|
||||||
|
$MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -n "$INIT_MAMBA";
|
if test -n "$INIT_MAMBA";
|
||||||
|
|
|
||||||
444
Desktop.org
444
Desktop.org
|
|
@ -38,13 +38,16 @@ To use them, let's define a noweb block:
|
||||||
color))
|
color))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
#+RESULTS: get-color
|
||||||
|
: #222222
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
#+begin_src emacs-lisp :noweb yes
|
#+begin_src emacs-lisp :noweb yes
|
||||||
<<get-color(name="red", quote=1)>>
|
<<get-color(name="red", quote=1)>>
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: #f07178
|
: #cc3333
|
||||||
|
|
||||||
Also, get a foreground for the current color:
|
Also, get a foreground for the current color:
|
||||||
#+NAME: get-fg-for-color
|
#+NAME: get-fg-for-color
|
||||||
|
|
@ -57,13 +60,16 @@ Also, get a foreground for the current color:
|
||||||
val))
|
val))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
#+RESULTS: get-fg-for-color
|
||||||
|
: #fff8f0
|
||||||
|
|
||||||
Test;
|
Test;
|
||||||
#+begin_src emacs-lisp :noweb yes
|
#+begin_src emacs-lisp :noweb yes
|
||||||
<<get-fg-for-color(name="red", quote=1)>>
|
<<get-fg-for-color(name="red", quote=1)>>
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: #fafafa
|
: #fff8f0
|
||||||
|
|
||||||
This table used to have values, now it has only keys:
|
This table used to have values, now it has only keys:
|
||||||
#+tblname: colors
|
#+tblname: colors
|
||||||
|
|
@ -102,6 +108,26 @@ Some programs get their colors from =XResources=. Let's generate that file.
|
||||||
"\n")
|
"\n")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
#+RESULTS: get-xresources
|
||||||
|
#+begin_example
|
||||||
|
,*color0: #222222
|
||||||
|
,*color1: #cc3333
|
||||||
|
,*color2: #217a3c
|
||||||
|
,*color3: #8a5d00
|
||||||
|
,*color4: #375cd8
|
||||||
|
,*color5: #ba35af
|
||||||
|
,*color6: #1f6fbf
|
||||||
|
,*color7: #fff8f0
|
||||||
|
,*color8: #484848
|
||||||
|
,*color9: #ff8f88
|
||||||
|
,*color10: #8adf80
|
||||||
|
,*color11: #fac200
|
||||||
|
,*color12: #cbcfff
|
||||||
|
,*color13: #df8fff
|
||||||
|
,*color14: #88c8ff
|
||||||
|
,*color15: #ffffff
|
||||||
|
#+end_example
|
||||||
|
|
||||||
#+begin_src conf-xdefaults :noweb yes :tangle ~/.Xresources
|
#+begin_src conf-xdefaults :noweb yes :tangle ~/.Xresources
|
||||||
<<get-xresources()>>
|
<<get-xresources()>>
|
||||||
|
|
||||||
|
|
@ -120,6 +146,7 @@ Also, Xresources are used to set =Xft= settings. Unfortunately, the DPI setting
|
||||||
((string-equal hostname "eminence") 120)
|
((string-equal hostname "eminence") 120)
|
||||||
((string-equal hostname "violet") 120)
|
((string-equal hostname "violet") 120)
|
||||||
((string-equal hostname "iris") 120)
|
((string-equal hostname "iris") 120)
|
||||||
|
((string-equal hostname "amaranth") 140)
|
||||||
(t 96)))
|
(t 96)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -295,7 +322,7 @@ The GUI pinentry doesn't work too well with EXWM because of issues with popup wi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+RESULTS: find-pinentry
|
#+RESULTS: find-pinentry
|
||||||
: /home/pavel/.guix-profile/bin/pinentry
|
: /usr/bin/pinentry
|
||||||
|
|
||||||
#+begin_src conf-space :tangle ~/.gnupg/gpg-agent.conf :noweb yes
|
#+begin_src conf-space :tangle ~/.gnupg/gpg-agent.conf :noweb yes
|
||||||
default-cache-ttl 3600
|
default-cache-ttl 3600
|
||||||
|
|
@ -539,9 +566,6 @@ Here is a snippet of code that does it:
|
||||||
(setq my/exwm-last-workspaces
|
(setq my/exwm-last-workspaces
|
||||||
(seq-uniq (cons exwm-workspace-current-index
|
(seq-uniq (cons exwm-workspace-current-index
|
||||||
my/exwm-last-workspaces))))
|
my/exwm-last-workspaces))))
|
||||||
|
|
||||||
(add-hook 'exwm-workspace-switch-hook
|
|
||||||
#'my/exwm-store-last-workspace)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
The variable =my/exwm-last-workspaces= stores the workspace indices; the first item is the index of the current workspace, the second item is the index of the previous workspace, and so on.
|
The variable =my/exwm-last-workspaces= stores the workspace indices; the first item is the index of the current workspace, the second item is the index of the previous workspace, and so on.
|
||||||
|
|
@ -912,6 +936,16 @@ And keybindings that are available in both =char-mode= and =line-mode=:
|
||||||
(when (or (< ,i (exwm-workspace--count))
|
(when (or (< ,i (exwm-workspace--count))
|
||||||
(y-or-n-p (format "Create workspace %d" ,i)))
|
(y-or-n-p (format "Create workspace %d" ,i)))
|
||||||
(exwm-workspace-switch-create ,i) ))))
|
(exwm-workspace-switch-create ,i) ))))
|
||||||
|
(number-sequence 0 9))
|
||||||
|
,@(mapcar (lambda (i)
|
||||||
|
(when (= i 0)
|
||||||
|
(setq i 10))
|
||||||
|
`(,(kbd (format "s-<f%d>" i)) .
|
||||||
|
(lambda ()
|
||||||
|
(interactive)
|
||||||
|
(when (or (< ,i (exwm-workspace--count))
|
||||||
|
(y-or-n-p (format "Create workspace %d" ,i)))
|
||||||
|
(exwm-workspace-switch-create ,i) ))))
|
||||||
(number-sequence 0 9))))
|
(number-sequence 0 9))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -1167,8 +1201,9 @@ It seems like this strange commit: [[https://github.com/ch11ng/exwm/commit/ce219
|
||||||
(exwm--log "Unhandled: %s(%d)"
|
(exwm--log "Unhandled: %s(%d)"
|
||||||
(x-get-atom-name type exwm-workspace--current) type)))))
|
(x-get-atom-name type exwm-workspace--current) type)))))
|
||||||
|
|
||||||
(with-eval-after-load 'exwm
|
(unless my/is-uconsole
|
||||||
(advice-add 'exwm--on-ClientMessage :override #'exwm--on-ClientMessage-old))
|
(with-eval-after-load 'exwm
|
||||||
|
(advice-add 'exwm--on-ClientMessage :override #'exwm--on-ClientMessage-old)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Application-specific settings
|
** Application-specific settings
|
||||||
|
|
@ -1190,8 +1225,11 @@ And the EXWM config itself.
|
||||||
(my/exwm-set-wallpaper)
|
(my/exwm-set-wallpaper)
|
||||||
(my/exwm-run-shepherd)
|
(my/exwm-run-shepherd)
|
||||||
(my/run-in-background "gpgconf --reload gpg-agent")
|
(my/run-in-background "gpgconf --reload gpg-agent")
|
||||||
(when (my/is-arch)
|
(when (or (my/is-arch)
|
||||||
(my/run-in-background "set_layout")))
|
(equal (system-name) "amaranth"))
|
||||||
|
(my/run-in-background "set_layout"))
|
||||||
|
(add-hook 'exwm-workspace-switch-hook
|
||||||
|
#'my/exwm-store-last-workspace))
|
||||||
|
|
||||||
(defun my/exwm-update-class ()
|
(defun my/exwm-update-class ()
|
||||||
(exwm-workspace-rename-buffer (format "EXWM :: %s" exwm-class-name)))
|
(exwm-workspace-rename-buffer (format "EXWM :: %s" exwm-class-name)))
|
||||||
|
|
@ -1922,6 +1960,7 @@ As we want to interweave polybar modules with these glyphs in the right order an
|
||||||
| 1 | pulseaudio | light-magenta | + |
|
| 1 | pulseaudio | light-magenta | + |
|
||||||
| 2 | mpd | magenta | + |
|
| 2 | mpd | magenta | + |
|
||||||
| 16 | nvidia | light-cyan | + |
|
| 16 | nvidia | light-cyan | + |
|
||||||
|
| 17 | backlight | light-cyan | + |
|
||||||
| 3 | cpu | cyan | + |
|
| 3 | cpu | cyan | + |
|
||||||
| 15 | temperature | cyan | + |
|
| 15 | temperature | cyan | + |
|
||||||
| 9 | battery | cyan | + |
|
| 9 | battery | cyan | + |
|
||||||
|
|
@ -1938,17 +1977,25 @@ As we want to interweave polybar modules with these glyphs in the right order an
|
||||||
Also excluding some modules from certain monitors, which for now is about excluding =battery= from the monitors of my desktop PC:
|
Also excluding some modules from certain monitors, which for now is about excluding =battery= from the monitors of my desktop PC:
|
||||||
|
|
||||||
#+NAME: polybar_modules_exclude
|
#+NAME: polybar_modules_exclude
|
||||||
| Monitor | Exclude |
|
| Monitor | Hostname | Exclude |
|
||||||
|----------+---------|
|
|----------+----------+-------------|
|
||||||
| DVI-D-0 | battery |
|
| HDMI-0 | violet | battery |
|
||||||
| HDMI-A-0 | battery |
|
| HDMI-0 | violet | backlight |
|
||||||
| HDMI-0 | battery |
|
| DP-1 | violet | battery |
|
||||||
| DP-1 | battery |
|
| DP-1 | violet | backlight |
|
||||||
| eDP | nvidia |
|
| HDMI-A-0 | eminence | battery |
|
||||||
| eDP-1 | nvidia |
|
| HDMI-A-0 | eminence | nvidia |
|
||||||
| DVI-D-0 | nvidia |
|
| eDP | eminence | nvidia |
|
||||||
| HDMI-A-0 | nvidia |
|
| HDMI-1 | iris | nvidia |
|
||||||
| HDMI-1 | nvidia |
|
| HDMI-1 | iris | backlight |
|
||||||
|
| DSI-1 | amaranth | nvidia |
|
||||||
|
| DSI-1 | amaranth | mpd |
|
||||||
|
| DSI-1 | amaranth | openvpn |
|
||||||
|
| DSI-1 | amaranth | swap-memory |
|
||||||
|
| DSI-1 | amaranth | bandwidth |
|
||||||
|
| DSI-1 | amaranth | temperature |
|
||||||
|
| DSI-1 | amaranth | weather |
|
||||||
|
| DSI-1 | amaranth | sun |
|
||||||
|
|
||||||
Another thing we need to do is to set the color of modules in accordance with the =polybar_modules= table. The background can be determined from the =Color= column with the following code block:
|
Another thing we need to do is to set the color of modules in accordance with the =polybar_modules= table. The background can be determined from the =Color= column with the following code block:
|
||||||
#+NAME: get-polybar-bg
|
#+NAME: get-polybar-bg
|
||||||
|
|
@ -1977,21 +2024,27 @@ Most of these combinations can be inferred from the =polybar_modules= table, the
|
||||||
|
|
||||||
#+NAME: polybar-generate-glyphs
|
#+NAME: polybar-generate-glyphs
|
||||||
#+begin_src emacs-lisp :var table=polybar_modules exclude-table=polybar_modules_exclude extra=polybar_extra_colors
|
#+begin_src emacs-lisp :var table=polybar_modules exclude-table=polybar_modules_exclude extra=polybar_extra_colors
|
||||||
(let* ((monitors
|
(let* ((monitor-hostnames
|
||||||
(thread-last
|
(thread-last
|
||||||
exclude-table
|
exclude-table
|
||||||
(seq-map (lambda (el) (nth 0 el)))
|
(seq-map (lambda (el) (concat (nth 0 el) ":" (nth 1 el))))
|
||||||
(seq-uniq)))
|
(seq-uniq)))
|
||||||
(exclude-combinations
|
(exclude-combinations
|
||||||
(seq-map
|
(seq-uniq
|
||||||
(lambda (monitor)
|
(seq-map
|
||||||
(seq-map
|
(lambda (monitor-hostname)
|
||||||
(lambda (el) (nth 1 el))
|
(let* ((split (string-split monitor-hostname ":"))
|
||||||
(seq-filter
|
(monitor (nth 0 split))
|
||||||
(lambda (el) (and (string-equal (nth 0 el) monitor)
|
(hostname (nth 1 split)))
|
||||||
(nth 1 el)))
|
(seq-map
|
||||||
exclude-table)))
|
(lambda (el) (nth 2 el))
|
||||||
`(,@monitors "")))
|
(seq-filter
|
||||||
|
(lambda (el)
|
||||||
|
(and (string-equal (nth 0 el) monitor)
|
||||||
|
(string-equal (nth 1 el) hostname)
|
||||||
|
(nth 2 el)))
|
||||||
|
exclude-table))))
|
||||||
|
`(,@monitor-hostnames ""))))
|
||||||
(module-glyph-combinations
|
(module-glyph-combinations
|
||||||
(thread-last
|
(thread-last
|
||||||
exclude-combinations
|
exclude-combinations
|
||||||
|
|
@ -2007,16 +2060,16 @@ Most of these combinations can be inferred from the =polybar_modules= table, the
|
||||||
(seq-uniq)))
|
(seq-uniq)))
|
||||||
(color-changes nil))
|
(color-changes nil))
|
||||||
(dolist (e extra)
|
(dolist (e extra)
|
||||||
(add-to-list
|
(push (concat (nth 0 e) "--" (nth 1 e))
|
||||||
'color-changes
|
color-changes))
|
||||||
(concat (nth 0 e) "--" (nth 1 e))))
|
|
||||||
(dolist (comb module-glyph-combinations)
|
(dolist (comb module-glyph-combinations)
|
||||||
(dotimes (i (1- (length comb)))
|
(dotimes (i (1- (length comb)))
|
||||||
(add-to-list
|
(push
|
||||||
'color-changes
|
|
||||||
(concat (nth 2 (nth i comb))
|
(concat (nth 2 (nth i comb))
|
||||||
"--"
|
"--"
|
||||||
(nth 2 (nth (1+ i) comb))))))
|
(nth 2 (nth (1+ i) comb)))
|
||||||
|
color-changes)))
|
||||||
|
(setq color-changes (seq-uniq color-changes))
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (el)
|
(lambda (el)
|
||||||
(let ((colors (split-string el "--")))
|
(let ((colors (split-string el "--")))
|
||||||
|
|
@ -2036,10 +2089,10 @@ content-font = 5"
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Here's a rough outline of how the code works:
|
Here's a rough outline of how the code works:
|
||||||
- =monitors= is a list of unique monitors in =exclude-table=
|
- =monitor-hostnames= is a list of unique monitor-hostname combination in =exclude-table=
|
||||||
- =exclude-combilnations= is a list of lists of module names to be excluded for each monitor
|
- =exclude-combilnations= is a list of lists of module names to be excluded for each combinations
|
||||||
- =module-glyphs-combinations= is a list of lists of actual modules for each monitor
|
- =module-glyphs-combinations= is a list of lists of actual modules for each combination
|
||||||
- =color-changes= is a list of unique adjacent colors across modules in all monitors
|
- =color-changes= is a list of unique adjacent colors across modules in all combinations
|
||||||
|
|
||||||
Finally, =color-changes= is used to generate glyph modules that look like this:
|
Finally, =color-changes= is used to generate glyph modules that look like this:
|
||||||
#+begin_src conf-windows :tangle no
|
#+begin_src conf-windows :tangle no
|
||||||
|
|
@ -2066,12 +2119,13 @@ The parameters here, excluding the two required tables, are:
|
||||||
- =last-color= - the second color of the last glyph.
|
- =last-color= - the second color of the last glyph.
|
||||||
|
|
||||||
#+NAME: polybar-generate-modules
|
#+NAME: polybar-generate-modules
|
||||||
#+begin_src emacs-lisp :var table=polybar_modules exclude-table=polybar_modules_exclude monitor="DVI-D-0" first-color="background" last-color="background"
|
#+begin_src emacs-lisp :var table=polybar_modules exclude-table=polybar_modules_exclude monitor="DSI-1" first-color="background" last-color="background" hostname="amaranth"
|
||||||
(let* ((exclude-modules
|
(let* ((exclude-modules
|
||||||
(thread-last
|
(thread-last
|
||||||
exclude-table
|
exclude-table
|
||||||
(seq-filter (lambda (el) (string-equal (nth 0 el) monitor)))
|
(seq-filter (lambda (el) (and (string-equal (nth 0 el) monitor)
|
||||||
(seq-map (lambda (el) (nth 1 el)))))
|
(string-equal (nth 1 el) hostname))))
|
||||||
|
(seq-map (lambda (el) (nth 2 el)))))
|
||||||
(modules
|
(modules
|
||||||
(thread-last
|
(thread-last
|
||||||
table
|
table
|
||||||
|
|
@ -2169,6 +2223,12 @@ scroll-down = i3wm-wsprev
|
||||||
; cursor-scroll = ns-resize
|
; cursor-scroll = ns-resize
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
DPI:
|
||||||
|
#+begin_src conf-windows
|
||||||
|
dpi-x = ${env:DPI}
|
||||||
|
dpi-y = ${env:DPI}
|
||||||
|
#+end_src
|
||||||
|
|
||||||
Misc settings.
|
Misc settings.
|
||||||
#+begin_src conf-windows
|
#+begin_src conf-windows
|
||||||
[settings]
|
[settings]
|
||||||
|
|
@ -2191,6 +2251,9 @@ The script below allows me to:
|
||||||
#+begin_src bash :tangle ./bin/polybar.sh :noweb yes
|
#+begin_src bash :tangle ./bin/polybar.sh :noweb yes
|
||||||
hostname=$(hostname)
|
hostname=$(hostname)
|
||||||
# Settings varying on the hostname
|
# Settings varying on the hostname
|
||||||
|
DPI=96
|
||||||
|
BAR_HEIGHT=29
|
||||||
|
|
||||||
if [ "$hostname" = "azure" ]; then
|
if [ "$hostname" = "azure" ]; then
|
||||||
TRAY_MONITOR="eDP-1"
|
TRAY_MONITOR="eDP-1"
|
||||||
elif [ "$hostname" = "eminence" ]; then
|
elif [ "$hostname" = "eminence" ]; then
|
||||||
|
|
@ -2201,52 +2264,45 @@ elif [ "$hostname" = "eminence" ]; then
|
||||||
fi
|
fi
|
||||||
elif [ "$hostname" = "iris" ]; then
|
elif [ "$hostname" = "iris" ]; then
|
||||||
TRAY_MONITOR="HDMI-1"
|
TRAY_MONITOR="HDMI-1"
|
||||||
|
elif [ "$hostname" = "amaranth" ]; then
|
||||||
|
export BATTERY="axp20x-battery"
|
||||||
|
export ADAPTER="axp22x-ac"
|
||||||
|
TRAY_MONITOR="DSI-1"
|
||||||
else
|
else
|
||||||
TRAY_MONITOR="DP-1"
|
TRAY_MONITOR="DP-1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setting varying on the monitor
|
# Setting varying on the monitor
|
||||||
declare -A FONT_SIZES=(
|
declare -A FONT_SIZE_OVERRIDE=(
|
||||||
["eDP"]="13"
|
["amaranth:DSI-1"]="13"
|
||||||
["eDP-1"]="13"
|
|
||||||
["DVI-D-0"]="13"
|
|
||||||
["HDMI-A-0"]="13"
|
|
||||||
["HDMI-1"]="13"
|
|
||||||
["HDMI-0"]="13"
|
|
||||||
["DP-1"]="13"
|
|
||||||
)
|
)
|
||||||
declare -A EMOJI_SCALE=(
|
declare -A EMOJI_SCALE_OVERRIDE=(
|
||||||
["eDP"]="9"
|
["amaranth:DSI-1"]="13"
|
||||||
["eDP-1"]="9"
|
|
||||||
["DVI-D-0"]="10"
|
|
||||||
["HDMI-A-0"]="10"
|
|
||||||
["HDMI-1"]="10"
|
|
||||||
["HDMI-0"]="10"
|
|
||||||
["DP-1"]="10"
|
|
||||||
)
|
)
|
||||||
declare -A BAR_HEIGHT=(
|
declare -A DPI_OVERRIDE=(
|
||||||
["eDP"]="29"
|
["amaranth:DSI-1"]="140"
|
||||||
["eDP-1"]="29"
|
)
|
||||||
["DVI-D-0"]="29"
|
declare -A BAR_HEIGHT_OVERRIDE=(
|
||||||
["HDMI-A-0"]="29"
|
["amaranth:DSI-1"]="40"
|
||||||
["HDMI-1"]="29"
|
|
||||||
["HDMI-0"]="29"
|
|
||||||
["DP-1"]="29"
|
|
||||||
)
|
)
|
||||||
declare -A BLOCKS=(
|
declare -A BLOCKS=(
|
||||||
["eDP"]="<<polybar-generate-modules(monitor="eDP")>>"
|
["violet:HDMI-0"]="<<polybar-generate-modules(monitor="HDMI-0" hostname="violet")>>"
|
||||||
["eDP-1"]="<<polybar-generate-modules(monitor="eDP-1")>>"
|
["violet:DP-1"]="<<polybar-generate-modules(monitor="DP-1" hostname="violet")>>"
|
||||||
["DVI-D-0"]="<<polybar-generate-modules(monitor="DVI-D-0")>>"
|
["eminence:eDP"]="<<polybar-generate-modules(monitor="HDMI-A-0" hostname="eminence")>>"
|
||||||
["HDMI-A-0"]="<<polybar-generate-modules(monitor="HDMI-A-0")>>"
|
["eminence:HDMI-A-0"]="<<polybar-generate-modules(monitor="HDMI-A-0" hostname="eminence")>>"
|
||||||
["HDMI-1"]="<<polybar-generate-modules(monitor="HDMI-1")>>"
|
["iris:HDMI-1"]="<<polybar-generate-modules(monitor="HDMI-1" hostname="iris")>>"
|
||||||
["HDMI-0"]="<<polybar-generate-modules(monitor="HDMI-0")>>"
|
["amaranth:DSI-1"]="<<polybar-generate-modules(monitor="DSI-1" hostname="amaranth")>>"
|
||||||
["DP-1"]="<<polybar-generate-modules(monitor="DP-1")>>"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
declare -A TEMP_HWMON_PATHS=(
|
declare -A TEMP_HWMON_PATHS=(
|
||||||
["eminence"]="/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input"
|
["eminence"]="/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input"
|
||||||
["indigo"]="/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"
|
["indigo"]="/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"
|
||||||
["violet"]="/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"
|
["violet"]="/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"
|
||||||
|
["amaranth"]="/sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp1_input"
|
||||||
|
)
|
||||||
|
|
||||||
|
declare -A BACKLIGHT_CARDS=(
|
||||||
|
["amaranth"]="backlight@0"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Geolocation for some modules
|
# Geolocation for some modules
|
||||||
|
|
@ -2262,19 +2318,19 @@ for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
else
|
else
|
||||||
export TRAY="none"
|
export TRAY="none"
|
||||||
fi
|
fi
|
||||||
SIZE=${FONT_SIZES[$MONITOR]}
|
|
||||||
SCALE=${EMOJI_SCALE[$MONITOR]}
|
KEY="$(hostname):${m}"
|
||||||
TEMP=${TEMP_HWMON_PATHS[$(hostname)]}
|
|
||||||
if [[ -z "$SCALE" ]]; then
|
export HEIGHT=${BAR_HEIGHT_OVERRIDE[$KEY]:-$BAR_HEIGHT}
|
||||||
|
export DPI=${DPI_OVERRIDE[$KEY]:-$DPI}
|
||||||
|
export RIGHT_BLOCKS=${BLOCKS[$KEY]}
|
||||||
|
if [[ -z "$RIGHT_BLOCKS" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
# export FONT0="pango:monospace:size=$SIZE;1"
|
|
||||||
# export FONT1="NotoEmoji:scale=$SCALE:antialias=false;1"
|
export TEMP_HWMON_PATH=${TEMP_HWMON_PATHS[$(hostname)]}
|
||||||
# export FONT2="fontawesome:pixelsize=$SIZE;1"
|
export BACKLIGHT_CARD=${BACKLIGHT_CARDS[$(hostname)]}
|
||||||
# export FONT3="JetBrains Mono Nerd Font:monospace:size=15;1"
|
|
||||||
export HEIGHT=${BAR_HEIGHT[$MONITOR]}
|
|
||||||
export RIGHT_BLOCKS=${BLOCKS[$MONITOR]}
|
|
||||||
export TEMP_HWMON_PATH=${TEMP}
|
|
||||||
polybar mybar &
|
polybar mybar &
|
||||||
done
|
done
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -2396,7 +2452,72 @@ format = <label>
|
||||||
format-background = <<get-polybar-bg(module="nvidia")>>
|
format-background = <<get-polybar-bg(module="nvidia")>>
|
||||||
format-foreground = ${colors.foreground}
|
format-foreground = ${colors.foreground}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
*** backlight
|
||||||
|
The built-in backlight module doesn't work for me for some reason.
|
||||||
|
|
||||||
|
#+begin_src bash :tangle ~/bin/polybar/backlight.sh
|
||||||
|
if [ -z "$BACKLIGHT_CARD" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
BRIGHTNESS_PATH="/sys/class/backlight/$BACKLIGHT_CARD/brightness"
|
||||||
|
MAX_BRIGHTNESS_PATH="/sys/class/backlight/$BACKLIGHT_CARD/max_brightness"
|
||||||
|
|
||||||
|
if [ ! -f "$BRIGHTNESS_PATH" ] || [ ! -f "$MAX_BRIGHTNESS_PATH" ]; then
|
||||||
|
echo "Brightness files not found :c"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
current_brightness=$(cat "$BRIGHTNESS_PATH")
|
||||||
|
max_brightness=$(cat "$MAX_BRIGHTNESS_PATH")
|
||||||
|
|
||||||
|
print_brightness() {
|
||||||
|
local brightness=$1
|
||||||
|
local max=$2
|
||||||
|
local ramp_chars=("▁" "▂" "▃" "▄" "▅" "▆" "▇" "█")
|
||||||
|
|
||||||
|
local ramp_index=$(( (brightness * 7) / max ))
|
||||||
|
echo -n " ${ramp_chars[$ramp_index]} $brightness"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
"up")
|
||||||
|
new_brightness=$((current_brightness + 1))
|
||||||
|
if [ $new_brightness -gt $max_brightness ]; then
|
||||||
|
new_brightness=$max_brightness
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"down")
|
||||||
|
new_brightness=$((current_brightness - 1))
|
||||||
|
if [ $new_brightness -lt 1 ]; then
|
||||||
|
new_brightness=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
,*)
|
||||||
|
new_brightness=$current_brightness
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ $new_brightness -ne $current_brightness ]; then
|
||||||
|
echo $new_brightness > "$BRIGHTNESS_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
print_brightness $new_brightness $max_brightness
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src conf-windows :noweb yes
|
||||||
|
[module/backlight]
|
||||||
|
type = custom/script
|
||||||
|
exec = /home/pavel/bin/polybar/backlight.sh
|
||||||
|
scroll-up = /home/pavel/bin/polybar/backlight.sh up
|
||||||
|
click-left = /home/pavel/bin/polybar/backlight.sh up
|
||||||
|
scroll-down = /home/pavel/bin/polybar/backlight.sh down
|
||||||
|
click-right = /home/pavel/bin/polybar/backlight.sh down
|
||||||
|
interval = 1
|
||||||
|
|
||||||
|
format-background = <<get-polybar-bg(module="backlight")>>
|
||||||
|
format-foreground = ${colors.foreground}
|
||||||
|
#+end_src
|
||||||
*** ram-memory
|
*** ram-memory
|
||||||
RAM usage
|
RAM usage
|
||||||
#+begin_src conf-windows :noweb yes
|
#+begin_src conf-windows :noweb yes
|
||||||
|
|
@ -2660,8 +2781,8 @@ layout-icon-1 = us;US
|
||||||
#+begin_src conf-windows :noweb yes
|
#+begin_src conf-windows :noweb yes
|
||||||
[module/battery]
|
[module/battery]
|
||||||
type = internal/battery
|
type = internal/battery
|
||||||
battery = BAT0
|
battery = ${env:BATTERY:BAT0}
|
||||||
adapter = ADP0
|
adapter = ${env:ADAPTER:ADP0}
|
||||||
|
|
||||||
time-format = %H:%M
|
time-format = %H:%M
|
||||||
format-discharging = <ramp-capacity> <label-discharging>
|
format-discharging = <ramp-capacity> <label-discharging>
|
||||||
|
|
@ -2778,7 +2899,13 @@ afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$
|
||||||
status=$(echo ${afk_event} | jq -r '.[0].data.status')
|
status=$(echo ${afk_event} | jq -r '.[0].data.status')
|
||||||
afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M")
|
afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M")
|
||||||
|
|
||||||
uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M")
|
if uptime --version 2>&1 | grep -q "GNU coreutils"; then
|
||||||
|
uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M")
|
||||||
|
else
|
||||||
|
startup_seconds=$(date -d "$(uptime -s)" +%s)
|
||||||
|
current_seconds=$(date +%s)
|
||||||
|
uptime=$(date -d "@$((current_seconds - startup_seconds))" -u +"%H:%M")
|
||||||
|
fi
|
||||||
res="${afk_time} / ${uptime}"
|
res="${afk_time} / ${uptime}"
|
||||||
if [[ $status == 'afk' ]]; then
|
if [[ $status == 'afk' ]]; then
|
||||||
# echo "%{u<<get-color(name="red")>>}%{+u} [AFK] $res %{u-}"
|
# echo "%{u<<get-color(name="red")>>}%{+u} [AFK] $res %{u-}"
|
||||||
|
|
@ -2876,7 +3003,7 @@ content-background = ${colors.blue}
|
||||||
#+begin_src conf-windows
|
#+begin_src conf-windows
|
||||||
[module/glyph-left-light-background--blue]
|
[module/glyph-left-light-background--blue]
|
||||||
type = custom/text
|
type = custom/text
|
||||||
content-background = ${colors.backround}
|
content-background = ${colors.background}
|
||||||
content-foreground = ${colors.blue}
|
content-foreground = ${colors.blue}
|
||||||
content = ${glyph.gleft}
|
content = ${glyph.gleft}
|
||||||
content-font = 5
|
content-font = 5
|
||||||
|
|
@ -4374,6 +4501,10 @@ I previously used supervisor, but shepherd also seems pretty capable.
|
||||||
|-----------------|
|
|-----------------|
|
||||||
| shepherd |
|
| shepherd |
|
||||||
|
|
||||||
|
#+begin_src scheme
|
||||||
|
(use-modules (shepherd service timer))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Music
|
** Music
|
||||||
| Category | Guix dependency |
|
| Category | Guix dependency |
|
||||||
|----------+-----------------|
|
|----------+-----------------|
|
||||||
|
|
@ -4388,8 +4519,7 @@ I previously used supervisor, but shepherd also seems pretty capable.
|
||||||
Music player daemon
|
Music player daemon
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define mpd
|
(define mpd
|
||||||
(make <service>
|
(service '(mpd)
|
||||||
#:provides '(mpd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("mpd" "--no-daemon"))
|
#:start (make-forkexec-constructor '("mpd" "--no-daemon"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4398,30 +4528,27 @@ Music player daemon
|
||||||
MPD watcher
|
MPD watcher
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define sqrt-data-agent-mpd
|
(define sqrt-data-agent-mpd
|
||||||
(make <service>
|
(service '(sqrt-data-agent-mpd)
|
||||||
#:provides '(sqrt-data-agent-mpd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("sqrt_data_agent_mpd"))
|
#:start (make-forkexec-constructor '("sqrt_data_agent_mpd"))
|
||||||
#:stop (make-kill-destructor)
|
#:stop (make-kill-destructor)
|
||||||
#:requires '(mpd)))
|
#:requirement '(mpd)))
|
||||||
|
|
||||||
(define deterred-mpd
|
(define deterred-mpd
|
||||||
(make <service>
|
(service '(deterred-mpd)
|
||||||
#:provides '(deterred-mpd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor
|
#:start (make-forkexec-constructor
|
||||||
'("python" "/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py"
|
'("python" "/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py"
|
||||||
"--db" "/home/pavel/.deterred/database.db"))
|
"--db" "/home/pavel/.deterred/database.db"))
|
||||||
#:stop (make-kill-destructor)
|
#:stop (make-kill-destructor)
|
||||||
#:requires '(mpd)))
|
#:requirement '(mpd)))
|
||||||
#+end_src
|
#+end_src
|
||||||
** GNU Mcron
|
** GNU Mcron
|
||||||
[[https://www.gnu.org/software/mcron/][GNU Mcron]] is a replacement for cron, written in Scheme.
|
[[https://www.gnu.org/software/mcron/][GNU Mcron]] is a replacement for cron, written in Scheme.
|
||||||
|
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define mcron
|
(define mcron
|
||||||
(make <service>
|
(service '(mcron)
|
||||||
#:provides '(mcron)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("mcron"))
|
#:start (make-forkexec-constructor '("mcron"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4433,49 +4560,46 @@ MPD watcher
|
||||||
|-------------------|
|
|-------------------|
|
||||||
| activitywatch-bin |
|
| activitywatch-bin |
|
||||||
|
|
||||||
|
#+begin_src sh :tangle ~/bin/scripts/aw-run
|
||||||
|
PATH=/home/pavel/micromamba/envs/aw/bin:$PATH
|
||||||
|
if [ "$1" = "aw-watcher-afk" ]; then
|
||||||
|
sleep 5
|
||||||
|
fi
|
||||||
|
$@
|
||||||
|
#+end_src
|
||||||
|
|
||||||
aw-server
|
aw-server
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define aw-server
|
(define aw-server
|
||||||
(make <service>
|
(service '(aw-server)
|
||||||
#:provides '(aw-server)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("aw-server"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-run" "aw-server"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
=aw-watcher-afk= has some problems with statup, so there is a wrapper script
|
|
||||||
|
|
||||||
#+begin_src sh :tangle ~/bin/scripts/aw-watcher-afk-wrapper
|
|
||||||
sleep 5
|
|
||||||
aw-watcher-afk
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
aw-watcher-afk
|
aw-watcher-afk
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define aw-watcher-afk
|
(define aw-watcher-afk
|
||||||
(make <service>
|
(service '(aw-watcher-afk)
|
||||||
#:provides '(aw-watcher-afk)
|
#:requirement '(aw-server)
|
||||||
#:requires '(aw-server)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-watcher-afk-wrapper"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-run" "aw-watcher-afk"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
aw-watcher-window
|
aw-watcher-window
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define aw-watcher-window
|
(define aw-watcher-window
|
||||||
(make <service>
|
(service '(aw-watcher-window)
|
||||||
#:provides '(aw-watcher-window)
|
#:requirement '(aw-server)
|
||||||
#:requires '(aw-server)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("aw-watcher-window"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-run" "aw-watcher-window"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
#+end_src
|
#+end_src
|
||||||
** PulseEffects
|
** PulseEffects
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define pulseeffects
|
(define pulseeffects
|
||||||
(make <service>
|
(service '(pulseeffects)
|
||||||
#:provides '(pulseeffects)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("flatpak" "run" "com.github.wwmm.pulseeffects" "--gapplication-service"))
|
#:start (make-forkexec-constructor '("flatpak" "run" "com.github.wwmm.pulseeffects" "--gapplication-service"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4483,8 +4607,7 @@ aw-watcher-window
|
||||||
** xsettingsd
|
** xsettingsd
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define xsettingsd
|
(define xsettingsd
|
||||||
(make <service>
|
(service '(xsettingsd)
|
||||||
#:provides '(xsettingsd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("xsettingsd"))
|
#:start (make-forkexec-constructor '("xsettingsd"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4492,8 +4615,7 @@ aw-watcher-window
|
||||||
** nm-applet
|
** nm-applet
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define nm-applet
|
(define nm-applet
|
||||||
(make <service>
|
(service '(nm-applet)
|
||||||
#:provides '(nm-applet)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("nm-applet"))
|
#:start (make-forkexec-constructor '("nm-applet"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4505,8 +4627,7 @@ References:
|
||||||
|
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define discord-rich-presence
|
(define discord-rich-presence
|
||||||
(make <service>
|
(service '(discord-rich-presence)
|
||||||
#:provides '(discord-rich-presence)
|
|
||||||
#:one-shot? #t
|
#:one-shot? #t
|
||||||
#:start (make-system-constructor "ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-0")))
|
#:start (make-system-constructor "ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-0")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -4515,17 +4636,18 @@ Launch an authentication agent. Necessary for stuff like =pkexec=. I suspect I'm
|
||||||
|
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define polkit-gnome
|
(define polkit-gnome
|
||||||
(make <service>
|
(service '(polkit-gnome)
|
||||||
#:provides '(polkit-gnome)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("/home/pavel/.guix-extra-profiles/desktop-misc/desktop-misc/libexec/polkit-gnome-authentication-agent-1"))
|
#:start (make-forkexec-constructor
|
||||||
|
(if (file-exists? "/home/pavel/.guix-extra-profiles/")
|
||||||
|
'("/home/pavel/.guix-extra-profiles/desktop-misc/desktop-misc/libexec/polkit-gnome-authentication-agent-1")
|
||||||
|
'("/usr/libexec/polkit-agent-helper-1")))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Xmodmap
|
** Xmodmap
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define xmodmap
|
(define xmodmap
|
||||||
(make <service>
|
(service '(xmodmap)
|
||||||
#:provides '(xmodmap)
|
|
||||||
#:one-shot? #t
|
#:one-shot? #t
|
||||||
#:start (make-system-constructor "xmodmap /home/pavel/.Xmodmap")))
|
#:start (make-system-constructor "xmodmap /home/pavel/.Xmodmap")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
@ -4534,8 +4656,7 @@ Run my [[file:Guix.org::*OpenVPN][OpenVPN setup]]. Not lauching this automatiall
|
||||||
|
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define vpn
|
(define vpn
|
||||||
(make <service>
|
(service '(vpn)
|
||||||
#:provides '(vpn)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/vpn-start"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/scripts/vpn-start"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4543,8 +4664,7 @@ Run my [[file:Guix.org::*OpenVPN][OpenVPN setup]]. Not lauching this automatiall
|
||||||
** Davmail
|
** Davmail
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define davmail
|
(define davmail
|
||||||
(make <service>
|
(service '(davmail)
|
||||||
#:provides '(davmail)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("/home/pavel/bin/davmail"))
|
#:start (make-forkexec-constructor '("/home/pavel/bin/davmail"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4552,8 +4672,7 @@ Run my [[file:Guix.org::*OpenVPN][OpenVPN setup]]. Not lauching this automatiall
|
||||||
** vnstatd
|
** vnstatd
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define vnstatd
|
(define vnstatd
|
||||||
(make <service>
|
(service '(vnstatd)
|
||||||
#:provides '(vnstatd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("vnstatd" "-n"))
|
#:start (make-forkexec-constructor '("vnstatd" "-n"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4569,15 +4688,13 @@ nix-env -I opensnitchd opensnitch-ui
|
||||||
=sudoers= has to be modified this to work.
|
=sudoers= has to be modified this to work.
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define opensnitchd
|
(define opensnitchd
|
||||||
(make <service>
|
(service '(opensnitchd)
|
||||||
#:provides '(opensnitchd)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("sudo" "opensnitchd"))
|
#:start (make-forkexec-constructor '("sudo" "opensnitchd"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
||||||
(define opensnitch-ui
|
(define opensnitch-ui
|
||||||
(make <service>
|
(service '(opensnitch-ui)
|
||||||
#:provides '(opensnitch-ui)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("sudo" "opensnitch-ui"))
|
#:start (make-forkexec-constructor '("sudo" "opensnitch-ui"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4585,8 +4702,7 @@ nix-env -I opensnitchd opensnitch-ui
|
||||||
** ollama
|
** ollama
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(define ollama
|
(define ollama
|
||||||
(make <service>
|
(service '(ollama)
|
||||||
#:provides '(ollama)
|
|
||||||
#:respawn? #t
|
#:respawn? #t
|
||||||
#:start (make-forkexec-constructor '("ollama" "serve"))
|
#:start (make-forkexec-constructor '("ollama" "serve"))
|
||||||
#:stop (make-kill-destructor)))
|
#:stop (make-kill-destructor)))
|
||||||
|
|
@ -4621,29 +4737,31 @@ Register services:
|
||||||
|
|
||||||
Daemonize shepherd
|
Daemonize shepherd
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(action 'shepherd 'daemonize)
|
(perform-service-action root-service 'daemonize)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Run services
|
Run services
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(for-each start '(mpd
|
(for-each start-service
|
||||||
sqrt-data-agent-mpd
|
(list
|
||||||
deterred-mpd
|
mpd
|
||||||
mcron
|
sqrt-data-agent-mpd
|
||||||
aw-server
|
deterred-mpd
|
||||||
aw-watcher-afk
|
mcron
|
||||||
aw-watcher-window
|
aw-server
|
||||||
pulseeffects
|
aw-watcher-afk
|
||||||
xsettingsd
|
aw-watcher-window
|
||||||
;; discord-rich-presence
|
pulseeffects
|
||||||
;; polkit-gnome
|
xsettingsd
|
||||||
davmail
|
;; discord-rich-presence
|
||||||
;; ; xmodmap
|
;; polkit-gnome
|
||||||
;; nm-applet
|
davmail
|
||||||
vnstatd
|
;; ; xmodmap
|
||||||
;; opensnitchd
|
;; nm-applet
|
||||||
;; opensnitch-ui
|
vnstatd
|
||||||
))
|
;; opensnitchd
|
||||||
|
;; opensnitch-ui
|
||||||
|
))
|
||||||
#+end_src
|
#+end_src
|
||||||
* Guix settings
|
* Guix settings
|
||||||
Other desktop programs I use are listed below.
|
Other desktop programs I use are listed below.
|
||||||
|
|
|
||||||
33
Emacs.org
33
Emacs.org
|
|
@ -116,7 +116,7 @@ References:
|
||||||
** Variables & environment
|
** Variables & environment
|
||||||
This section is about optioning the Emacs config.
|
This section is about optioning the Emacs config.
|
||||||
|
|
||||||
The following is true is Emacs is run on a remote server where I don't need stuff like my org workflow
|
The following is true is Emacs is run on a remote server where I don't need stuff like my org workflow.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq my/remote-server
|
(setq my/remote-server
|
||||||
(or (string= (getenv "IS_REMOTE") "true")
|
(or (string= (getenv "IS_REMOTE") "true")
|
||||||
|
|
@ -124,11 +124,16 @@ The following is true is Emacs is run on a remote server where I don't need stuf
|
||||||
(string= (system-name) "viridian")))
|
(string= (system-name) "viridian")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
And the following is true if Emacs is run from termux on Android.
|
The following is true if Emacs is run from termux on Android.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
|
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
The following is true if Emacs is run on my uConsole.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq my/is-uconsole (string= (system-name) "amaranth"))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
Custom system name logic because on termux it's always "localhost".
|
Custom system name logic because on termux it's always "localhost".
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun my/system-name ()
|
(defun my/system-name ()
|
||||||
|
|
@ -170,7 +175,7 @@ A small function to print out the loading time and number of GCs during the load
|
||||||
|
|
||||||
Set the following to =t= to print debug information during the startup. This will include package loading order and time.
|
Set the following to =t= to print debug information during the startup. This will include package loading order and time.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq use-package-verbose nil)
|
(setq use-package-verbose t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
@ -2242,6 +2247,12 @@ References:
|
||||||
(message "Install JetBrainsMono Nerd Font!")))
|
(message "Install JetBrainsMono Nerd Font!")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Increase font size for my uConsole:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(when my/is-uconsole
|
||||||
|
(set-face-attribute 'default nil :height 140))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
To make the icons work (e.g. in the Doom Modeline), run =M-x all-the-icons-install-fonts=. The package definition is somewhere later in the config.
|
To make the icons work (e.g. in the Doom Modeline), run =M-x all-the-icons-install-fonts=. The package definition is somewhere later in the config.
|
||||||
*** Other fonts
|
*** Other fonts
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
@ -2429,6 +2440,22 @@ References:
|
||||||
(when (fboundp #'my/exwm-run-polybar)
|
(when (fboundp #'my/exwm-run-polybar)
|
||||||
(my/exwm-run-polybar))))
|
(my/exwm-run-polybar))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
*** Doom Modeline on uConsole
|
||||||
|
My uConsole has a rather small screen, so here are some tweaks.
|
||||||
|
|
||||||
|
What this does is:
|
||||||
|
- Force a smaller height (see [[https://github.com/seagle0128/doom-modeline/issues/187][this issue]])
|
||||||
|
- Force display =mode-line-misc-info=, which includes EXWM workspace list and perspectives list.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun my/doom-modeline-uconsole--font-height ()
|
||||||
|
20)
|
||||||
|
|
||||||
|
(when my/is-uconsole
|
||||||
|
(with-eval-after-load 'doom-modeline
|
||||||
|
(advice-add #'doom-modeline--font-height :override #'my-doom-modeline--font-height))
|
||||||
|
(setq doom-modeline-window-width-limit 70)
|
||||||
|
(setq doom-modeline-major-mode-icon nil))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** perspective.el
|
** perspective.el
|
||||||
[[https://github.com/nex3/perspective-el][perspective.el]] is a package that groups buffers in "perspectives".
|
[[https://github.com/nex3/perspective-el][perspective.el]] is a package that groups buffers in "perspectives".
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
# [[file:../Desktop.org::*Launch script][Launch script:1]]
|
# [[file:../Desktop.org::*Launch script][Launch script:1]]
|
||||||
hostname=$(hostname)
|
hostname=$(hostname)
|
||||||
# Settings varying on the hostname
|
# Settings varying on the hostname
|
||||||
|
DPI=96
|
||||||
|
BAR_HEIGHT=29
|
||||||
|
|
||||||
if [ "$hostname" = "azure" ]; then
|
if [ "$hostname" = "azure" ]; then
|
||||||
TRAY_MONITOR="eDP-1"
|
TRAY_MONITOR="eDP-1"
|
||||||
elif [ "$hostname" = "eminence" ]; then
|
elif [ "$hostname" = "eminence" ]; then
|
||||||
|
|
@ -12,52 +15,45 @@ elif [ "$hostname" = "eminence" ]; then
|
||||||
fi
|
fi
|
||||||
elif [ "$hostname" = "iris" ]; then
|
elif [ "$hostname" = "iris" ]; then
|
||||||
TRAY_MONITOR="HDMI-1"
|
TRAY_MONITOR="HDMI-1"
|
||||||
|
elif [ "$hostname" = "amaranth" ]; then
|
||||||
|
export BATTERY="axp20x-battery"
|
||||||
|
export ADAPTER="axp22x-ac"
|
||||||
|
TRAY_MONITOR="DSI-1"
|
||||||
else
|
else
|
||||||
TRAY_MONITOR="DP-1"
|
TRAY_MONITOR="DP-1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setting varying on the monitor
|
# Setting varying on the monitor
|
||||||
declare -A FONT_SIZES=(
|
declare -A FONT_SIZE_OVERRIDE=(
|
||||||
["eDP"]="13"
|
["amaranth:DSI-1"]="13"
|
||||||
["eDP-1"]="13"
|
|
||||||
["DVI-D-0"]="13"
|
|
||||||
["HDMI-A-0"]="13"
|
|
||||||
["HDMI-1"]="13"
|
|
||||||
["HDMI-0"]="13"
|
|
||||||
["DP-1"]="13"
|
|
||||||
)
|
)
|
||||||
declare -A EMOJI_SCALE=(
|
declare -A EMOJI_SCALE_OVERRIDE=(
|
||||||
["eDP"]="9"
|
["amaranth:DSI-1"]="13"
|
||||||
["eDP-1"]="9"
|
|
||||||
["DVI-D-0"]="10"
|
|
||||||
["HDMI-A-0"]="10"
|
|
||||||
["HDMI-1"]="10"
|
|
||||||
["HDMI-0"]="10"
|
|
||||||
["DP-1"]="10"
|
|
||||||
)
|
)
|
||||||
declare -A BAR_HEIGHT=(
|
declare -A DPI_OVERRIDE=(
|
||||||
["eDP"]="29"
|
["amaranth:DSI-1"]="140"
|
||||||
["eDP-1"]="29"
|
)
|
||||||
["DVI-D-0"]="29"
|
declare -A BAR_HEIGHT_OVERRIDE=(
|
||||||
["HDMI-A-0"]="29"
|
["amaranth:DSI-1"]="40"
|
||||||
["HDMI-1"]="29"
|
|
||||||
["HDMI-0"]="29"
|
|
||||||
["DP-1"]="29"
|
|
||||||
)
|
)
|
||||||
declare -A BLOCKS=(
|
declare -A BLOCKS=(
|
||||||
["eDP"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
["violet:HDMI-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--light-cyan backlight glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
||||||
["eDP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
["violet:DP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--light-cyan backlight glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
||||||
["DVI-D-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--cyan temperature glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
["eminence:eDP"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--light-cyan backlight glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
||||||
["HDMI-A-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--cyan temperature glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
["eminence:HDMI-A-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--light-cyan backlight glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
||||||
["HDMI-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
["iris:HDMI-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--light-cyan backlight glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
||||||
["HDMI-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
["amaranth:DSI-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--light-cyan backlight glyph-light-cyan--cyan cpu glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--red xkeyboard glyph-red--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
||||||
["DP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
|
|
||||||
)
|
)
|
||||||
|
|
||||||
declare -A TEMP_HWMON_PATHS=(
|
declare -A TEMP_HWMON_PATHS=(
|
||||||
["eminence"]="/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input"
|
["eminence"]="/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input"
|
||||||
["indigo"]="/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"
|
["indigo"]="/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"
|
||||||
["violet"]="/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"
|
["violet"]="/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input"
|
||||||
|
["amaranth"]="/sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp1_input"
|
||||||
|
)
|
||||||
|
|
||||||
|
declare -A BACKLIGHT_CARDS=(
|
||||||
|
["amaranth"]="backlight@0"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Geolocation for some modules
|
# Geolocation for some modules
|
||||||
|
|
@ -73,19 +69,19 @@ for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
else
|
else
|
||||||
export TRAY="none"
|
export TRAY="none"
|
||||||
fi
|
fi
|
||||||
SIZE=${FONT_SIZES[$MONITOR]}
|
|
||||||
SCALE=${EMOJI_SCALE[$MONITOR]}
|
KEY="$(hostname):${m}"
|
||||||
TEMP=${TEMP_HWMON_PATHS[$(hostname)]}
|
|
||||||
if [[ -z "$SCALE" ]]; then
|
export HEIGHT=${BAR_HEIGHT_OVERRIDE[$KEY]:-$BAR_HEIGHT}
|
||||||
|
export DPI=${DPI_OVERRIDE[$KEY]:-$DPI}
|
||||||
|
export RIGHT_BLOCKS=${BLOCKS[$KEY]}
|
||||||
|
if [[ -z "$RIGHT_BLOCKS" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
# export FONT0="pango:monospace:size=$SIZE;1"
|
|
||||||
# export FONT1="NotoEmoji:scale=$SCALE:antialias=false;1"
|
export TEMP_HWMON_PATH=${TEMP_HWMON_PATHS[$(hostname)]}
|
||||||
# export FONT2="fontawesome:pixelsize=$SIZE;1"
|
export BACKLIGHT_CARD=${BACKLIGHT_CARDS[$(hostname)]}
|
||||||
# export FONT3="JetBrains Mono Nerd Font:monospace:size=15;1"
|
|
||||||
export HEIGHT=${BAR_HEIGHT[$MONITOR]}
|
|
||||||
export RIGHT_BLOCKS=${BLOCKS[$MONITOR]}
|
|
||||||
export TEMP_HWMON_PATH=${TEMP}
|
|
||||||
polybar mybar &
|
polybar mybar &
|
||||||
done
|
done
|
||||||
# Launch script:1 ends here
|
# Launch script:1 ends here
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,13 @@ afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$
|
||||||
status=$(echo ${afk_event} | jq -r '.[0].data.status')
|
status=$(echo ${afk_event} | jq -r '.[0].data.status')
|
||||||
afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M")
|
afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M")
|
||||||
|
|
||||||
uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M")
|
if uptime --version 2>&1 | grep -q "GNU coreutils"; then
|
||||||
|
uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M")
|
||||||
|
else
|
||||||
|
startup_seconds=$(date -d "$(uptime -s)" +%s)
|
||||||
|
current_seconds=$(date +%s)
|
||||||
|
uptime=$(date -d "@$((current_seconds - startup_seconds))" -u +"%H:%M")
|
||||||
|
fi
|
||||||
res="${afk_time} / ${uptime}"
|
res="${afk_time} / ${uptime}"
|
||||||
if [[ $status == 'afk' ]]; then
|
if [[ $status == 'afk' ]]; then
|
||||||
# echo "%{u#cc3333}%{+u} [AFK] $res %{u-}"
|
# echo "%{u#cc3333}%{+u} [AFK] $res %{u-}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue