mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
nix!: refactored homeModules
This commit is contained in:
parent
1c48edddf4
commit
e9f8ccd2b3
50 changed files with 14 additions and 41 deletions
59
nix/homeModules/common/cmus/default.nix
Normal file
59
nix/homeModules/common/cmus/default.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.programs.cmus.enable = lib.mkEnableOption "cmus";
|
||||
|
||||
config = lib.mkIf config.programs.cmus.enable {
|
||||
home.packages = [ pkgs.cmus ];
|
||||
xdg.configFile."cmus/rc".text = lib.mkMerge [
|
||||
(builtins.readFile ./rc)
|
||||
|
||||
(lib.mkIf pkgs.stdenv.isLinux (
|
||||
let
|
||||
# dispatch to multiple callbacks
|
||||
callback = pkgs.writeShellApplication {
|
||||
name = "cmus-callback-script";
|
||||
runtimeInputs = [
|
||||
pkgs.cmusfm
|
||||
pkgs.libnotify
|
||||
];
|
||||
text = ''
|
||||
argv=("$@")
|
||||
declare -A map
|
||||
while [ $# -gt 0 ]; do
|
||||
map["$1"]="$2"
|
||||
shift
|
||||
shift
|
||||
done
|
||||
|
||||
notify-send "''${map[title]}" "''${map[artist]} / ''${map[album]}"
|
||||
cmusfm "''${argv[@]}"
|
||||
'';
|
||||
};
|
||||
in
|
||||
''
|
||||
set status_display_program=${lib.getExe callback}
|
||||
''
|
||||
))
|
||||
|
||||
(lib.mkIf pkgs.stdenv.isDarwin ''
|
||||
set status_display_program=${lib.getExe pkgs.cmusfm}
|
||||
'')
|
||||
|
||||
(lib.mkIf pkgs.stdenv.isLinux ''
|
||||
set output_plugin=alsa
|
||||
'')
|
||||
|
||||
# When switching over bluetooth, toggle the output device to coreaudio
|
||||
# and back to ao would fix the no sound issue.
|
||||
(lib.mkIf pkgs.stdenv.isDarwin ''
|
||||
# distortion fix https://github.com/cmus/cmus/issues/1130#issuecomment-1003324193
|
||||
set output_plugin=ao
|
||||
'')
|
||||
];
|
||||
};
|
||||
}
|
||||
94
nix/homeModules/common/cmus/rc
Normal file
94
nix/homeModules/common/cmus/rc
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
colorscheme spotify
|
||||
|
||||
set aaa_mode=album
|
||||
set confirm_run=true
|
||||
set continue=true
|
||||
set continue_album=true
|
||||
set follow=true
|
||||
|
||||
bind -f browser - browser-up
|
||||
bind -f browser i toggle show_hidden
|
||||
bind -f browser space win-activate
|
||||
bind -f browser u win-update
|
||||
bind -f common ! push shell
|
||||
bind -f common / search-start
|
||||
bind -f common 1 view tree
|
||||
bind -f common 2 view sorted
|
||||
bind -f common 3 view playlist
|
||||
bind -f common 4 view queue
|
||||
bind -f common 5 view browser
|
||||
bind -f common 6 view filters
|
||||
bind -f common 7 view settings
|
||||
bind -f common < seek -1m
|
||||
bind -f common = vol +10%
|
||||
bind -f common > seek +1m
|
||||
bind -f common ? search-b-start
|
||||
bind -f common B player-prev-album
|
||||
bind -f common C toggle continue
|
||||
bind -f common D win-remove
|
||||
bind -f common F push filter
|
||||
bind -f common G win-bottom
|
||||
bind -f common K echo {}
|
||||
bind -f common L push live-filter
|
||||
bind -f common M toggle play_library
|
||||
bind -f common N search-prev
|
||||
bind -f common P win-mv-before
|
||||
bind -f common Q win-add-Q
|
||||
bind -f common U win-update-cache
|
||||
bind -f common W player-next-album
|
||||
bind -f common [ vol +1% +0
|
||||
bind -f common ] vol +0 +1%
|
||||
bind -f common ^B win-page-up
|
||||
bind -f common ^C echo Type :quit<enter> to exit cmus.
|
||||
bind -f common ^D win-half-page-down
|
||||
bind -f common ^E win-scroll-down
|
||||
bind -f common ^F win-page-down
|
||||
bind -f common ^L refresh
|
||||
bind -f common ^R toggle repeat_current
|
||||
bind -f common ^U win-half-page-up
|
||||
bind -f common ^Y win-scroll-up
|
||||
bind -f common a win-add-l
|
||||
bind -f common b player-prev
|
||||
bind -f common c player-pause
|
||||
bind -f common delete win-remove
|
||||
bind -f common down win-down
|
||||
bind -f common end win-bottom
|
||||
bind -f common enter win-activate
|
||||
bind -f common f toggle follow
|
||||
bind -f common g win-top
|
||||
bind -f common h seek -5
|
||||
bind -f common home win-top
|
||||
bind -f common i win-sel-cur
|
||||
bind -f common j win-down
|
||||
bind -f common k win-up
|
||||
bind -f common l seek +5
|
||||
bind -f common left seek -5
|
||||
bind -f common m toggle aaa_mode
|
||||
bind -f common mlb_click_bar player-pause
|
||||
bind -f common mlb_click_selected win-activate
|
||||
bind -f common mouse_scroll_down win-down
|
||||
bind -f common mouse_scroll_down_bar seek -5
|
||||
bind -f common mouse_scroll_down_title right-view
|
||||
bind -f common mouse_scroll_up win-up
|
||||
bind -f common mouse_scroll_up_bar seek +5
|
||||
bind -f common mouse_scroll_up_title left-view
|
||||
bind -f common n search-next
|
||||
bind -f common o toggle play_sorted
|
||||
bind -f common p win-mv-after
|
||||
bind -f common page_down win-page-down
|
||||
bind -f common page_up win-page-up
|
||||
bind -f common q win-add-q
|
||||
bind -f common r toggle repeat
|
||||
bind -f common right seek +5
|
||||
bind -f common s toggle shuffle
|
||||
bind -f common space win-toggle
|
||||
bind -f common t toggle show_remaining_time
|
||||
bind -f common tab win-next
|
||||
bind -f common u update-cache
|
||||
bind -f common up win-up
|
||||
bind -f common v player-stop
|
||||
bind -f common w player-next
|
||||
bind -f common x player-play
|
||||
bind -f common y win-add-p
|
||||
bind -f common { vol -1% -0
|
||||
bind -f common } vol -0 -1%
|
||||
Loading…
Add table
Add a link
Reference in a new issue