From c9e147c93b8bd3c52b2e7658d928daec6bd824e1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 3 Mar 2022 17:44:39 +0100 Subject: gkleen@sif: ... --- accounts/gkleen@sif/default.nix | 17 +++++++-- accounts/gkleen@sif/dunst-settings.nix | 40 ++++------------------ accounts/gkleen@sif/dunstrc.d/00-urgency_low.conf | 4 +++ .../gkleen@sif/dunstrc.d/01-urgency_normal.conf | 4 +++ .../gkleen@sif/dunstrc.d/02-urgency_critical.conf | 4 +++ .../gkleen@sif/dunstrc.d/10-pulseaudio-ctl.conf | 5 +++ accounts/gkleen@sif/dunstrc.d/20-element.conf | 3 ++ accounts/gkleen@sif/dunstrc.d/20-mail.conf | 3 ++ accounts/gkleen@sif/dunstrc.d/20-zulip.conf | 3 ++ accounts/gkleen@sif/systemd.nix | 1 + accounts/gkleen@sif/xcompose.nix | 21 ++++++++++++ hosts/sif/default.nix | 2 ++ overlays/xcompose.nix | 28 +++++++++++++++ 13 files changed, 99 insertions(+), 36 deletions(-) create mode 100644 accounts/gkleen@sif/dunstrc.d/00-urgency_low.conf create mode 100644 accounts/gkleen@sif/dunstrc.d/01-urgency_normal.conf create mode 100644 accounts/gkleen@sif/dunstrc.d/02-urgency_critical.conf create mode 100644 accounts/gkleen@sif/dunstrc.d/10-pulseaudio-ctl.conf create mode 100644 accounts/gkleen@sif/dunstrc.d/20-element.conf create mode 100644 accounts/gkleen@sif/dunstrc.d/20-mail.conf create mode 100644 accounts/gkleen@sif/dunstrc.d/20-zulip.conf create mode 100644 accounts/gkleen@sif/xcompose.nix create mode 100644 overlays/xcompose.nix diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 11bd221c..61a5fdb4 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -51,10 +51,10 @@ let wrappedRocketChatDesktop = wrapElectron { package = pkgs.rocketchat-desktop; bin = "rocketchat-desktop"; outBin = "rocketchat"; }; in { imports = with flake.nixosModules.userProfiles.${userName}; [ - mpv yt-dlp + mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) ]; - home-manager.users.${userName} = { + config.home-manager.users.${userName} = { nixpkgs.config = { zathura.useMupdf = false; }; @@ -82,6 +82,9 @@ in { Match host *.cipmath.loc !exec "nc -z -w 1 %h %p &>/dev/null" ProxyJump mathw0h + Match host *.ifi.lmu.de,*.math.lmu.de + AddressFamily inet + Host * ''; }; @@ -320,6 +323,16 @@ in { }; }; + xdg.configFile = { + "dunst/dunstrc.d" = { + source = ./dunstrc.d; + recursive = true; + onChange = '' + ${pkgs.systemd}/bin/systemctl --user try-restart dunst + ''; + }; + }; + fonts.fontconfig.enable = true; systemd.user = import ./systemd.nix inputs; diff --git a/accounts/gkleen@sif/dunst-settings.nix b/accounts/gkleen@sif/dunst-settings.nix index 540602c2..7f36922f 100644 --- a/accounts/gkleen@sif/dunst-settings.nix +++ b/accounts/gkleen@sif/dunst-settings.nix @@ -5,7 +5,11 @@ markup = "full"; format = "%s %p\\n%b"; alignment = "left"; - geometry = "1216x10-32+64"; + # geometry = "1216x10-32+64"; + width = 250; + height = 50; + offset = "32x64"; + origin = "top-right"; shrink = true; monitor = 0; follow = "none"; @@ -30,6 +34,7 @@ sticky_history = false; dmenu = "${pkgs.dmenu}/bin/dmenu"; + browser = "${pkgs.xdg-utils}/bin/xdg-open"; }; # shortcuts = { # close = "ctrl+space"; @@ -37,37 +42,4 @@ # history = "ctrl+comma"; # context = "ctrl+period"; # }; - urgency_low = { - background = "#000000"; - foreground = "#999999"; - timeout = 5; - }; - urgency_normal = { - background = "#000000"; - foreground = "#ffffff"; - timeout = 15; - }; - urgency_critical = { - background = "#900000"; - foreground = "#ffffff"; - timeout = 0; - }; - pulseaudio-ctl = { - summary = "Volume *"; - body = "Current is *"; - set_stack_tag = "volume"; - history_ignore = true; - }; - mail = { - appname = "notmuch"; - timeout = 0; - }; - zulip = { - appname = "Zulip"; - timeout = 0; - }; - element = { - appname = "Element"; - timeout = 0; - }; } diff --git a/accounts/gkleen@sif/dunstrc.d/00-urgency_low.conf b/accounts/gkleen@sif/dunstrc.d/00-urgency_low.conf new file mode 100644 index 00000000..442cc243 --- /dev/null +++ b/accounts/gkleen@sif/dunstrc.d/00-urgency_low.conf @@ -0,0 +1,4 @@ +[urgency_low] +background="#000000" +foreground="#999999" +timeout=5 \ No newline at end of file diff --git a/accounts/gkleen@sif/dunstrc.d/01-urgency_normal.conf b/accounts/gkleen@sif/dunstrc.d/01-urgency_normal.conf new file mode 100644 index 00000000..a95dfdf1 --- /dev/null +++ b/accounts/gkleen@sif/dunstrc.d/01-urgency_normal.conf @@ -0,0 +1,4 @@ +[urgency_normal] +background="#000000" +foreground="#ffffff" +timeout=15 \ No newline at end of file diff --git a/accounts/gkleen@sif/dunstrc.d/02-urgency_critical.conf b/accounts/gkleen@sif/dunstrc.d/02-urgency_critical.conf new file mode 100644 index 00000000..d57fe91c --- /dev/null +++ b/accounts/gkleen@sif/dunstrc.d/02-urgency_critical.conf @@ -0,0 +1,4 @@ +[urgency_critical] +background="#900000" +foreground="#ffffff" +timeout=0 diff --git a/accounts/gkleen@sif/dunstrc.d/10-pulseaudio-ctl.conf b/accounts/gkleen@sif/dunstrc.d/10-pulseaudio-ctl.conf new file mode 100644 index 00000000..074f4535 --- /dev/null +++ b/accounts/gkleen@sif/dunstrc.d/10-pulseaudio-ctl.conf @@ -0,0 +1,5 @@ +[pulseaudio-ctl] +body="Current is *" +history_ignore=yes +set_stack_tag="volume" +summary="Volume *" diff --git a/accounts/gkleen@sif/dunstrc.d/20-element.conf b/accounts/gkleen@sif/dunstrc.d/20-element.conf new file mode 100644 index 00000000..5ff6031e --- /dev/null +++ b/accounts/gkleen@sif/dunstrc.d/20-element.conf @@ -0,0 +1,3 @@ +[element-im] +appname=Element +timeout=0 \ No newline at end of file diff --git a/accounts/gkleen@sif/dunstrc.d/20-mail.conf b/accounts/gkleen@sif/dunstrc.d/20-mail.conf new file mode 100644 index 00000000..cb568e01 --- /dev/null +++ b/accounts/gkleen@sif/dunstrc.d/20-mail.conf @@ -0,0 +1,3 @@ +[element] +appname="notmuch" +timeout=0 \ No newline at end of file diff --git a/accounts/gkleen@sif/dunstrc.d/20-zulip.conf b/accounts/gkleen@sif/dunstrc.d/20-zulip.conf new file mode 100644 index 00000000..d7fbd32c --- /dev/null +++ b/accounts/gkleen@sif/dunstrc.d/20-zulip.conf @@ -0,0 +1,3 @@ +[zulip] +appname="Zulip" +timeout=0 \ No newline at end of file diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index de2d92f8..ec02b1c3 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix @@ -128,6 +128,7 @@ in { }; dunst = { Service = { + ExecStart = lib.mkForce "${cfg.services.dunst.package}/bin/dunst"; Restart = "always"; }; Install = { diff --git a/accounts/gkleen@sif/xcompose.nix b/accounts/gkleen@sif/xcompose.nix new file mode 100644 index 00000000..50dddacd --- /dev/null +++ b/accounts/gkleen@sif/xcompose.nix @@ -0,0 +1,21 @@ +{ userName, pkgs, ... }: +let + runSed = path: sedScript: pkgs.runCommand (baseNameOf path) { buildInputs = [ pkgs.gnused ]; } "sed -r -f ${pkgs.writeText "script-file" sedScript} ${path} > $out"; +in { + config.home-manager.users.${userName}.home.file.".XCompose".text = '' + include "${pkgs.xorg.libX11}/share/X11/locale/en_US.UTF-8/Compose" + include "${runSed "${pkgs.xcompose}/dotXCompose" '' + /include "%L"/ s/^/# / + ''}" + include "${pkgs.xcompose}/frakturcompose" + include "${pkgs.xcompose}/emoji.compose" + include "${pkgs.xcompose}/modletters.compose" + include "${pkgs.xcompose}/tags.compose" + include "${pkgs.xcompose}/maths.compose" + include "${pkgs.xcompose}/parens.compose" + + : "🙁" U1F641 # SLIGHTLY FROWNING FACE + : "🙁" U1F641 # SLIGHTLY FROWNING FACE + : "☚ī¸" U2639 # WHITE FROWNING FACE VARIANT + ''; +} diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index b4914273..7cce8af0 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix @@ -455,6 +455,8 @@ in { group = "users"; }; + i18n.inputMethod.enabled = "ibus"; + system.stateVersion = "20.03"; }; } diff --git a/overlays/xcompose.nix b/overlays/xcompose.nix new file mode 100644 index 00000000..2bcd6c01 --- /dev/null +++ b/overlays/xcompose.nix @@ -0,0 +1,28 @@ +final: prev: { + xcompose = prev.stdenv.mkDerivation (let + rev = "150c47fabb9f45e81138f71347dc75f69b5dd987"; + in { + pname = "xcompose"; + version = builtins.substring 0 8 rev; + + src = prev.fetchFromGitHub { + owner = "kragen"; + repo = "xcompose"; + inherit rev; + hash = "sha256-XQ0ZuXGvDLz9fJ0yGHtgL4wl9Jx3SG30cGBM2b947iY="; + }; + + nativeBuildInputs = with final; [ perl ]; + + postPatch = '' + substituteInPlace emojitrans2.pl --replace "/usr/bin/env -S perl -p" "${final.perl}/bin/perl -p" + ''; + + installPhase = '' + mkdir -p $out + install -t $out \ + dotXCompose frakturcompose \ + emoji.compose modletters.compose tags.compose maths.compose parens.compose + ''; + }); +} -- cgit v1.2.3