summaryrefslogtreecommitdiff
path: root/accounts
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2026-10-21 15:05:50 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2026-10-21 15:05:50 +0200
commitebccb33b4eb60a07e667332665181ba9ad352615 (patch)
tree14947c3add7677919250265616f9ab4f5f6b071b /accounts
parentf2c90589d4d4d6c1f101c969d1363729171b3115 (diff)
downloadnixos-ebccb33b4eb60a07e667332665181ba9ad352615.tar
nixos-ebccb33b4eb60a07e667332665181ba9ad352615.tar.gz
nixos-ebccb33b4eb60a07e667332665181ba9ad352615.tar.bz2
nixos-ebccb33b4eb60a07e667332665181ba9ad352615.tar.xz
nixos-ebccb33b4eb60a07e667332665181ba9ad352615.zip
...
Diffstat (limited to 'accounts')
-rw-r--r--accounts/gkleen@skadhi/shell/quickshell-plugins/Chrono.cpp2
-rw-r--r--accounts/gkleen@skadhi/shell/quickshell-plugins/Systemd.cpp1
-rw-r--r--accounts/gkleen@skadhi/zsh/default.nix1
-rw-r--r--accounts/gkleen@skadhi/zsh/zshrc20
4 files changed, 3 insertions, 21 deletions
diff --git a/accounts/gkleen@skadhi/shell/quickshell-plugins/Chrono.cpp b/accounts/gkleen@skadhi/shell/quickshell-plugins/Chrono.cpp
index 22b3469b..2487cddd 100644
--- a/accounts/gkleen@skadhi/shell/quickshell-plugins/Chrono.cpp
+++ b/accounts/gkleen@skadhi/shell/quickshell-plugins/Chrono.cpp
@@ -75,7 +75,7 @@ void Chrono::schedule(const std::chrono::time_point<std::chrono::system_clock>&
75} 75}
76 76
77QString Chrono::format(const QString& fmt) const { 77QString Chrono::format(const QString& fmt) const {
78 return QString::fromStdString(std::format(std::runtime_format(fmt.toStdString()), std::chrono::zoned_time(std::chrono::current_zone(), std::chrono::time_point_cast<std::chrono::seconds>(this->currentTime)))); 78 return QString::fromStdString(std::format(std::dynamic_format(fmt.toStdString()), std::chrono::zoned_time(std::chrono::current_zone(), std::chrono::time_point_cast<std::chrono::seconds>(this->currentTime))));
79} 79}
80 80
81QDateTime Chrono::date() const { 81QDateTime Chrono::date() const {
diff --git a/accounts/gkleen@skadhi/shell/quickshell-plugins/Systemd.cpp b/accounts/gkleen@skadhi/shell/quickshell-plugins/Systemd.cpp
index 1fa236f6..a1fbe0d3 100644
--- a/accounts/gkleen@skadhi/shell/quickshell-plugins/Systemd.cpp
+++ b/accounts/gkleen@skadhi/shell/quickshell-plugins/Systemd.cpp
@@ -1,6 +1,7 @@
1#include "Systemd.hpp" 1#include "Systemd.hpp"
2 2
3#include <sstream> 3#include <sstream>
4#include <unistd.h>
4 5
5#include <QDBusConnection> 6#include <QDBusConnection>
6#include <QDBusReply> 7#include <QDBusReply>
diff --git a/accounts/gkleen@skadhi/zsh/default.nix b/accounts/gkleen@skadhi/zsh/default.nix
index 1e11d639..d0046bc1 100644
--- a/accounts/gkleen@skadhi/zsh/default.nix
+++ b/accounts/gkleen@skadhi/zsh/default.nix
@@ -43,7 +43,6 @@ let
43 sysConfig.systemd.package 43 sysConfig.systemd.package
44 sysConfig.programs.ssh.package 44 sysConfig.programs.ssh.package
45 gnused 45 gnused
46 miniserve
47 p7zip 46 p7zip
48 ]; 47 ];
49 execer = with pkgs; [ 48 execer = with pkgs; [
diff --git a/accounts/gkleen@skadhi/zsh/zshrc b/accounts/gkleen@skadhi/zsh/zshrc
index c532b308..ea792718 100644
--- a/accounts/gkleen@skadhi/zsh/zshrc
+++ b/accounts/gkleen@skadhi/zsh/zshrc
@@ -7,7 +7,6 @@ dir() {
7 wormhole=false 7 wormhole=false
8 gitWorktree="" 8 gitWorktree=""
9 modifyPDF="" 9 modifyPDF=""
10 miniserve=false
11 10
12 while getopts ':t:a:d:ir:wg:p:m' arg; do 11 while getopts ':t:a:d:ir:wg:p:m' arg; do
13 case $arg in 12 case $arg in
@@ -26,7 +25,6 @@ dir() {
26 "w") wormhole=true ;; 25 "w") wormhole=true ;;
27 "g") gitWorktree=${OPTARG} ;; 26 "g") gitWorktree=${OPTARG} ;;
28 "p") modifyPDF=${OPTARG:a} ;; 27 "p") modifyPDF=${OPTARG:a} ;;
29 "m") miniserve=true ;;
30 *) printf "Invalid option: %s\n" $arg >&2; exit 2 ;; 28 *) printf "Invalid option: %s\n" $arg >&2; exit 2 ;;
31 esac 29 esac
32 done 30 done
@@ -50,11 +48,6 @@ dir() {
50 gitWorktree="" 48 gitWorktree=""
51 fi 49 fi
52 50
53 miniservePIDFile=""
54 if [[ ${miniserve} = "true" ]]; then
55 miniservePIDFile=$(mktemp --tmpdir --suffix=.pid)
56 fi
57
58 cleanup() 51 cleanup()
59 { 52 {
60 if [[ -n ${modifyPDF} ]]; then 53 if [[ -n ${modifyPDF} ]]; then
@@ -64,10 +57,6 @@ dir() {
64 magick -verbose "${pages[@]}" $(mktemp --tmpdir=${modifyPDF:h} ${modifyPDF:t:r}_XXXXXXXXXX.${modifyPDF:e}) 57 magick -verbose "${pages[@]}" $(mktemp --tmpdir=${modifyPDF:h} ${modifyPDF:t:r}_XXXXXXXXXX.${modifyPDF:e})
65 modifyPDF="" 58 modifyPDF=""
66 fi 59 fi
67 if [[ -n ${miniservePIDFile} ]]; then
68 command kill --verbose -- $(cat ${miniservePIDFile}) && wait $(cat ${miniservePIDFile})
69 miniservePIDFile=""
70 fi
71 } 60 }
72 61
73 ( 62 (
@@ -155,12 +144,7 @@ dir() {
155 144
156 cd $(pwd) # Needed for mounting to work 145 cd $(pwd) # Needed for mounting to work
157 146
158 if [[ ${miniserve} = "true" ]]; then 147 if [[ ${#@} -eq 0 ]] || [[ $forceShell = "true" ]]; then
159 miniserve --random-route --hidden --enable-tar-gz --enable-zip . &
160 echo $! > "${miniservePIDFile}"
161 fi
162
163 if [[ ${#@} -eq 0 ]] && [[ ${miniserve} != "true" ]] || [[ $forceShell = "true" ]]; then
164 isSingleDir() { 148 isSingleDir() {
165 typeset -a contents 149 typeset -a contents
166 contents=(*(N) .*(N)) 150 contents=(*(N) .*(N))
@@ -175,8 +159,6 @@ dir() {
175 while d=$(isSingleDir); do cd ${d}; done 159 while d=$(isSingleDir); do cd ${d}; done
176 160
177 zsh 161 zsh
178 elif [[ ${miniserve} == "true" ]]; then
179 wait $(cat "${miniservePIDFile}")
180 fi 162 fi
181 ) 163 )
182} 164}