diff --git a/hosts/morty/home-config.nix b/hosts/morty/home-config.nix
index bd1d909..ed7d5a9 100644
--- a/hosts/morty/home-config.nix
+++ b/hosts/morty/home-config.nix
@@ -5,6 +5,7 @@
zathura.enable = true;
foot.enable = true;
};
+ audio.cmus.enable = true;
cli = {
direnv.enable = true;
ghq.enable = true;
diff --git a/modules/home-manager/audio/cmus/default.nix b/modules/home-manager/audio/cmus/default.nix
new file mode 100644
index 0000000..acec36f
--- /dev/null
+++ b/modules/home-manager/audio/cmus/default.nix
@@ -0,0 +1,17 @@
+{ lib, config, pkgs, ... }:
+with lib;
+let
+ cfg = config.modules.audio.cmus;
+in
+{
+ options.modules.audio.cmus= {
+ enable = mkEnableOption "enable cmus audio player";
+ };
+ config = mkIf cfg.enable {
+ home.packages = with pkgs; [
+ cmus
+ ];
+ home.file.".config/cmus/rc".source = ./files/rc;
+ home.file.".config/cmus/notify.sh".source = ./files/notify.sh;
+ };
+}
diff --git a/modules/home-manager/audio/cmus/files/notify.sh b/modules/home-manager/audio/cmus/files/notify.sh
new file mode 100755
index 0000000..d11fbff
--- /dev/null
+++ b/modules/home-manager/audio/cmus/files/notify.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+# shellcheck disable=SC2154
+process_args() {
+ while [ "$#" -ge 2 ]
+ do
+ printf -v "$1" "%s" "$2"
+ shift
+ shift
+ done
+}
+
+main() {
+ filename=${file#*/}
+ image=${file%/*}/cover.jpg
+ [ -f "$image" ] && options="$options -i \"${image}\""
+
+ title=${title:-$filename}
+ if [[ ${#title} -gt 25 ]]; then
+ title="${title:0:24}…"
+ fi
+
+ if [ -n "$artist" ]
+ then
+ if [[ ${#artist} -gt 22 ]]; then
+ artist="by ${artist:0:21}…"
+ fi
+ fi
+
+ if [ -n "$album" ]
+ then
+ if [[ ${#album} -gt 19 ]]; then
+ album="${album:0:18}…"
+ fi
+ fi
+
+ if [ -n "$date" ]
+ then
+ date="${date%%-*}"
+ fi
+ printf -v body "%s\n%-19s %s" "${artist:-}" "${album:-}" "${date:-}"
+ notify-send --app-name=cmus -i "$image" "$title" "$body"
+}
+
+process_args "$@"
+main
diff --git a/modules/home-manager/audio/cmus/files/rc b/modules/home-manager/audio/cmus/files/rc
new file mode 100644
index 0000000..ea71c79
--- /dev/null
+++ b/modules/home-manager/audio/cmus/files/rc
@@ -0,0 +1,56 @@
+## Base16 Default Dark
+
+# overall background and foreground color
+set color_win_fg=7
+set color_win_bg=0
+
+# bottom status line
+set color_statusline_fg=20
+set color_statusline_bg=19
+
+# bottom title line
+set color_titleline_fg=7
+set color_titleline_bg=18
+
+# top title area
+set color_win_title_fg=20
+set color_win_title_bg=19
+set color_win_title_attr=bold
+
+# command-line colors
+set color_cmdline_bg=default
+set color_cmdline_fg=default
+set color_error=1
+set color_info=6
+
+# separator of windows
+# should be black
+set color_separator=16
+
+# unselected currently playing track's text
+set color_win_cur=13
+
+# active selection for currently playing track
+set color_win_cur_sel_bg=20
+set color_win_cur_sel_fg=0
+set color_win_cur_sel_attr=none
+
+# inactive selection for currently playing track
+set color_win_inactive_cur_sel_bg=8
+set color_win_inactive_cur_sel_fg=21
+
+# active selection
+set color_win_sel_bg=6
+set color_win_sel_fg=0
+set color_win_sel_attr=none
+
+# inactive selection
+set color_win_inactive_sel_bg=19
+set color_win_inactive_sel_fg=20
+
+# directory listing color
+set color_win_dir=default
+
+set status_display_program=~/.config/cmus/notify.sh
+
+add -l ~/medias/music
diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix
index 31d0fbf..998b326 100644
--- a/modules/home-manager/cli/neovim/default.nix
+++ b/modules/home-manager/cli/neovim/default.nix
@@ -34,7 +34,7 @@ in
nodePackages.bash-language-server
python3Packages.python-lsp-server
shellcheck
- yaml-language-server
+ # yaml-language-server
# Formatters
nixfmt-rfc-style
diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix
index 9025c48..eee7b36 100644
--- a/modules/home-manager/default.nix
+++ b/modules/home-manager/default.nix
@@ -5,6 +5,7 @@
./application/gnupg
./application/imv
./application/zathura
+ ./audio/cmus
./cli/direnv
./cli/ghq/default.nix
./cli/git
diff --git a/modules/home-manager/desktop/sway/includes/mako.nix b/modules/home-manager/desktop/sway/includes/mako.nix
index 8a60054..81ddf7e 100644
--- a/modules/home-manager/desktop/sway/includes/mako.nix
+++ b/modules/home-manager/desktop/sway/includes/mako.nix
@@ -13,7 +13,7 @@ with lib;
};
services.mako = {
enable = true;
- font = "Fira Code 10";
+ font = "Fira Code Nerd Font 10";
backgroundColor = "#353535FF";
borderColor = "#1CD180";
progressColor = "over #5566AAFF";
@@ -31,8 +31,12 @@ with lib;
border-color=#F268b3
[app-name="cmus"]
- border-color=#00000000
- default-timeout=10000
+ border-size=1
+ default-timeout=7000
+ group-by=app-name
+
+ [app-name="cmus" grouped]
+ format=%s\n%b
'';
};
};