From c696da568d55d1a3dc48b37dc6d1c5ea7a8e0a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 15:52:09 +0100 Subject: [PATCH] nix: Add dunst --- .../roles/desktop_environment/tasks/main.yml | 9 --- config/dunst/.gitignore | 2 - config/dunst/dunstrc.j2 | 65 ------------------- config/nix/hm/desktop.nix | 51 ++++++++++++++- 4 files changed, 49 insertions(+), 78 deletions(-) delete mode 100644 config/dunst/.gitignore delete mode 100644 config/dunst/dunstrc.j2 diff --git a/config/automatrop/roles/desktop_environment/tasks/main.yml b/config/automatrop/roles/desktop_environment/tasks/main.yml index 3a5c159..748a00a 100644 --- a/config/automatrop/roles/desktop_environment/tasks/main.yml +++ b/config/automatrop/roles/desktop_environment/tasks/main.yml @@ -60,15 +60,6 @@ - color - i3 -- name: Configure Dunst - ansible.builtin.template: - src: "{{ ansible_env.HOME }}/.config/dunst/dunstrc.j2" - dest: "{{ ansible_env.HOME }}/.config/dunst/dunstrc" - mode: u=rw,g=r,o=r - tags: - - color - when: display_server == 'x11' - - name: Download base16 theme for fzf ansible.builtin.copy: content: "{{ base16_schemes['schemes'][base16_scheme]['fzf']['bash']['base16-' + base16_scheme + '.config'] }}" diff --git a/config/dunst/.gitignore b/config/dunst/.gitignore deleted file mode 100644 index 93fb535..0000000 --- a/config/dunst/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -dunstrc -theme diff --git a/config/dunst/dunstrc.j2 b/config/dunst/dunstrc.j2 deleted file mode 100644 index 2fb355e..0000000 --- a/config/dunst/dunstrc.j2 +++ /dev/null @@ -1,65 +0,0 @@ -[global] - alignment = left - always_run_script = true - browser = /usr/bin/qutebrowser - class = Dunst - dmenu = /usr/bin/dmenu -p dunst: - ellipsize = middle - follow = none - font = DejaVu Sans 10 - force_xinerama = false - format = "%s %p\n%b" - frame_color = "#A6E22E" - frame_width = 3 - geometry = "500x5-30+20" - hide_duplicate_count = false - history_length = 20 - horizontal_padding = 8 - icon_path = /usr/share/icons/gnome/256x256/actions/:/usr/share/icons/gnome/256x256/status/:/usr/share/icons/gnome/256x256/devices/ - icon_position = left - idle_threshold = 120 - ignore_newline = no - indicate_hidden = yes - line_height = 0 - markup = full - max_icon_size = 48 - monitor = 0 - notification_height = 0 - padding = 8 - separator_color = frame - separator_height = 2 - show_age_threshold = 60 - show_indicators = yes - shrink = no - sort = yes - stack_duplicates = true - startup_notification = false - sticky_history = yes - title = Dunst - transparency = 0 - verbosity = mesg - word_wrap = yes -[experimental] - per_monitor_dpi = false -[shortcuts] - close_all = ctrl+mod4+n - close = mod4+n - context = mod1+mod4+n - history = shift+mod4+n -[urgency_low] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#A6E22E" - timeout = 10 -[urgency_normal] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#F4BF75" - timeout = 10 -[urgency_critical] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#F92672" - timeout = 0 -{{ base16_schemes['schemes'][base16_scheme]['dunst']['themes']['base16-' + base16_scheme + '.dunstrc'] }} -# TODO Not used. Not sure how it's supposed to be used :D diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index ab6ef78..7622f92 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -377,10 +377,57 @@ autorandr.enable = true; }; - xdg.userDirs.enable = true; # TODO Which ones do we want? + xdg = { + mimeApps = { + enable = true; + associations.added = { + "text/html" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; + }; + }; + userDirs.enable = true; # TODO Which ones do we want? + }; services = { unclutter.enable = true; - dunst.enable = true; + dunst = + { + enable = true; + settings = + # TODO Change dmenu for rofi, so we can use context + with config.lib.stylix.colors.withHashtag; { + global = { + separator_color = lib.mkForce base05; + idle_threshold = 120; + markup = "full"; + max_icon_size = 48; + # TODO Those shortcuts don't seem to work, maybe try: + # > define shortcuts inside your window manager and bind them to dunstctl(1) commands + close_all = "ctrl+mod4+n"; + close = "mod4+n"; + context = "mod1+mod4+n"; + history = "shift+mod4+n"; + }; + + urgency_low = { + background = lib.mkForce base01; + foreground = lib.mkForce base03; + frame_color = lib.mkForce base05; + }; + urgency_normal = { + background = lib.mkForce base02; + foreground = lib.mkForce base05; + frame_color = lib.mkForce base05; + }; + urgency_critical = { + background = lib.mkForce base08; + foreground = lib.mkForce base06; + frame_color = lib.mkForce base05; + }; + }; + }; mpd.enable = true; autorandr.enable = true; };