summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accounts/gkleen@sif/default.nix8
-rw-r--r--accounts/gkleen@sif/hyprland.nix39
-rw-r--r--accounts/gkleen@sif/systemd.nix1
3 files changed, 45 insertions, 3 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index d1a0ec3f..2c6d747d 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -933,7 +933,13 @@ in {
933 "gtklock/config.ini" = { 933 "gtklock/config.ini" = {
934 source = (pkgs.formats.ini {}).generate "config.ini" { 934 source = (pkgs.formats.ini {}).generate "config.ini" {
935 main = { 935 main = {
936 936 };
937 };
938 };
939 "qalculate/qalc.cfg" = {
940 source = (pkgs.formats.ini {}).generate "qalc.cfg" {
941 General = {
942 dot_as_separator = 0;
937 }; 943 };
938 }; 944 };
939 }; 945 };
diff --git a/accounts/gkleen@sif/hyprland.nix b/accounts/gkleen@sif/hyprland.nix
index 252b8351..d26b72a7 100644
--- a/accounts/gkleen@sif/hyprland.nix
+++ b/accounts/gkleen@sif/hyprland.nix
@@ -1,5 +1,7 @@
1{ pkgs, lib, ... }: 1{ pkgs, lib, config, userName, ... }:
2{ 2let
3 cfg = config.home-manager.users.${userName};
4in {
3 monitor = [ 5 monitor = [
4 ",preferred,auto,auto" 6 ",preferred,auto,auto"
5 "eDP-1,3840x2160@59.99900,auto,1.5" 7 "eDP-1,3840x2160@59.99900,auto,1.5"
@@ -217,6 +219,39 @@
217 makeWrapper ${lib.getExe pkgs.hyprpicker} $out \ 219 makeWrapper ${lib.getExe pkgs.hyprpicker} $out \
218 --prefix PATH : ${lib.makeBinPath [pkgs.wl-clipboard-rs]} 220 --prefix PATH : ${lib.makeBinPath [pkgs.wl-clipboard-rs]}
219 ''} -a" 221 ''} -a"
222 "$mainMod, E, exec, ${pkgs.writeShellScript "qalc-fuzzel" ''
223 export PATH="${lib.makeBinPath (with pkgs; [ wl-clipboard-rs libqalculate cfg.programs.fuzzel.package coreutils findutils libnotify gnugrep ])}:$PATH"
224
225 RESULTS_DIR="$HOME/.cache/qalc-fuzzel"
226 prev() {
227 FOUND=false
228 while IFS= read -r line; do
229 [[ -n "$line" ]] || continue
230 FOUND=true
231 echo $line
232 done < <(export LC_ALL=C.UTF-8; echo; find "$RESULTS_DIR" -type f -printf $'%T@ %p\n' | sort -n | cut -d' ' -f2- | xargs -r cat)
233 $FOUND || echo
234 }
235 FUZZEL_RES=$(prev | fuzzel --dmenu --prompt "qalc> ") || exit $?
236 if [[ "$FUZZEL_RES" =~ .*\ =\ .* ]]; then
237 QALC_RES="$FUZZEL_RES"
238 QALC_RET=0
239 else
240 QALC_RES=$(qalc "$FUZZEL_RES" 2>&1)
241 QALC_RET=$?
242 fi
243 [[ -n "$QALC_RES" ]] || exit 1
244 EXISTING=false
245 fgrep -xrl "$QALC_RES" "$RESULTS_DIR" | xargs -r touch
246 [[ ''${PIPESTATUS[0]} -eq 0 ]] && EXISTING=true
247 if [[ $QALC_RET -eq 0 ]] && ! $EXISTING; then
248 RES_FILE="$RESULTS_DIR"/$(date -uIs).$(tr -Cd 'a-zA-Z0-9' </dev/random | head -c 10)
249 cat >"$RES_FILE" <<<"$QALC_RES"
250 fi
251 [[ "$QALC_RES" =~ .*\ =\ (.*) ]] && QALC_RES="''${BASH_REMATCH[1]}"
252 [[ $QALC_RET -eq 0 ]] && wl-copy "$QALC_RES"
253 notify-send "$QALC_RES"
254 ''}"
220 255
221 "$mainMod CTRL, return, togglespecialworkspace, term" 256 "$mainMod CTRL, return, togglespecialworkspace, term"
222 "$mainMod CTRL, e, togglespecialworkspace, edit" 257 "$mainMod CTRL, e, togglespecialworkspace, edit"
diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix
index e5d1681c..5902946c 100644
--- a/accounts/gkleen@sif/systemd.nix
+++ b/accounts/gkleen@sif/systemd.nix
@@ -44,6 +44,7 @@ let
44in { 44in {
45 tmpfiles.rules = [ 45 tmpfiles.rules = [
46 "e /home/gkleen/screenshots - - - 365d -" 46 "e /home/gkleen/screenshots - - - 365d -"
47 "d /home/gkleen/.cache/qalc-fuzzel - - - 1d -"
47 ]; 48 ];
48 49
49 services = { 50 services = {