2022-07-31 11:03:59 +02:00
|
|
|
# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
2021-01-24 17:43:50 +01:00
|
|
|
{
|
2022-07-31 11:03:59 +02:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.magic_rb.programs.xmonad;
|
|
|
|
in {
|
2021-04-11 00:25:36 +02:00
|
|
|
options.magic_rb.programs.xmonad = {
|
|
|
|
enable = mkEnableOption "Enable xmonad config";
|
2021-01-24 17:43:50 +01:00
|
|
|
|
2021-04-11 00:25:36 +02:00
|
|
|
enableDunst = mkOption {
|
|
|
|
description = "Enable dunst";
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
enablePicom = mkOption {
|
|
|
|
description = "Enable picom";
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
|
2022-04-15 09:52:23 +02:00
|
|
|
enableKeynav = mkOption {
|
|
|
|
description = "Enable keynav";
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
|
2021-04-11 00:25:36 +02:00
|
|
|
picomExperimentalBackends = mkOption {
|
|
|
|
description = "Enable experimental backends in picom";
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
powerline-fonts
|
|
|
|
font-awesome
|
|
|
|
dejavu_fonts
|
|
|
|
];
|
|
|
|
|
2022-04-15 09:52:23 +02:00
|
|
|
home.file.".keynavrc".source = ./keynavrc;
|
|
|
|
|
2021-12-22 23:48:31 +01:00
|
|
|
home.file.".xmonad/xmonad.hs".source = pkgs.writeSubstitutedFile {
|
2021-04-11 00:25:36 +02:00
|
|
|
name = "xmonad.hs";
|
|
|
|
file = ./xmonad.hs;
|
|
|
|
substitutes = {
|
|
|
|
"screenshot" = "${pkgs.magic_rb.screenshot}/bin/screenshot";
|
2023-05-28 12:49:08 +02:00
|
|
|
"emacs-rofi" = lib.getExe pkgs.emacs-rofi;
|
|
|
|
"auxmenu" = pkgs.writeShellScript "auxmenu"
|
|
|
|
''
|
|
|
|
_options="toggle-mic\ntoggle-radio"
|
2021-04-11 00:25:36 +02:00
|
|
|
|
2023-05-28 12:49:08 +02:00
|
|
|
_option="$(echo -e $_options | emacs-rofi "command: " 90 30 | awk '{print $1}' | tr -d '\r\n')"
|
|
|
|
if [ ''${#_option} -gt 0 ]
|
|
|
|
then
|
|
|
|
case $_option in
|
|
|
|
toggle-mic)
|
|
|
|
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
|
|
|
|
;;
|
|
|
|
toggle-radio)
|
|
|
|
if [ "$(nmcli radio wifi)" = "enabled" ]
|
|
|
|
then
|
|
|
|
nmcli radio wifi off
|
|
|
|
else
|
|
|
|
nmcli radio wifi on
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
"dmenu_run" = "${pkgs.dmenu}/bin/dmenu_run";
|
|
|
|
"polybar" = pkgs.writeShellScript "polybar"
|
|
|
|
''
|
|
|
|
monitors=$(polybar --list-monitors | cut -f 1 -d':')
|
|
|
|
MONITOR=''${monitors[$1]} ${lib.getExe pkgs.polybarFull} -c ${./polybar.ini} top
|
|
|
|
'';
|
|
|
|
"dunst" = lib.getExe pkgs.dunst;
|
2021-04-11 00:25:36 +02:00
|
|
|
"dunstConfig" = ./dunstrc;
|
|
|
|
|
2023-05-28 12:49:08 +02:00
|
|
|
"picom" = lib.getExe pkgs.picom;
|
2021-04-11 00:25:36 +02:00
|
|
|
"picomConfig" = ./picom.conf;
|
2023-05-28 12:49:08 +02:00
|
|
|
"picomArgs" =
|
2022-07-31 11:03:59 +02:00
|
|
|
if cfg.picomExperimentalBackends
|
|
|
|
then "--experimental-backends"
|
|
|
|
else "";
|
2022-04-15 09:52:23 +02:00
|
|
|
|
2023-05-28 12:49:08 +02:00
|
|
|
"keynav" = lib.getExe pkgs.keynav;
|
|
|
|
"lightLocker" = lib.getExe pkgs.lightlocker;
|
|
|
|
"lightLockerCommand" = "${pkgs.lightlocker}/bin/light-locker-command";
|
|
|
|
"brightnessctl" = lib.getExe pkgs.brightnessctl;
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
2021-01-24 17:43:50 +01:00
|
|
|
};
|
2021-02-26 10:24:58 +01:00
|
|
|
};
|
2021-01-24 17:43:50 +01:00
|
|
|
}
|