aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/desktop/eww/bar/bar.nix2
-rw-r--r--modules/desktop/eww/bar/bar.yuck2
-rw-r--r--modules/desktop/eww/bar/system-stats.lua2
-rw-r--r--modules/desktop/icons/default.nix6
-rw-r--r--modules/desktop/niri/keybindings.nix2
-rw-r--r--modules/office/default.nix2
-rw-r--r--modules/office/khal/default.nix69
-rw-r--r--modules/terminal/kitty/assertions.nix2
-rw-r--r--users/arpit/default.nix3
9 files changed, 84 insertions, 6 deletions
diff --git a/modules/desktop/eww/bar/bar.nix b/modules/desktop/eww/bar/bar.nix
index 3f322e4..009b28c 100644
--- a/modules/desktop/eww/bar/bar.nix
+++ b/modules/desktop/eww/bar/bar.nix
@@ -90,10 +90,12 @@
in
builtins.replaceStrings
[
+ "@@bash@@"
"@@niri-status-script@@"
"@@system-stats-script@@"
]
[
+ (lib.getExe config.terminal.bash.package)
(lib.getExe niri-status)
(lib.getExe system-stats)
]
diff --git a/modules/desktop/eww/bar/bar.yuck b/modules/desktop/eww/bar/bar.yuck
index 66e552f..c2fb09d 100644
--- a/modules/desktop/eww/bar/bar.yuck
+++ b/modules/desktop/eww/bar/bar.yuck
@@ -127,7 +127,7 @@
(label :class "system-label"
:text "${system_stats.battery.present ? (system_stats.battery.percent + '%') : '-'}"))
(eventbox :onclick "pamixer --toggle-mute"
- :onscroll "bash -c '[ \"{}\" = \"up\" ] && pamixer --increase 5 --unmute || pamixer --decrease 5'"
+ :onscroll "@@bash@@ -c '[ \"{}\" = \"up\" ] && pamixer --allow-boost --increase 5 --unmute || pamixer --allow-boost --decrease 5'"
:cursor "pointer"
:halign "fill"
(box :orientation "v"
diff --git a/modules/desktop/eww/bar/system-stats.lua b/modules/desktop/eww/bar/system-stats.lua
index b651e2d..6085f39 100644
--- a/modules/desktop/eww/bar/system-stats.lua
+++ b/modules/desktop/eww/bar/system-stats.lua
@@ -483,7 +483,7 @@ local function get_sound_state()
if pout then
local num = tonumber(pout:match("^(%-?%d+)"))
if num then
- percent = math.max(0, math.min(100, num))
+ percent = math.max(0, num)
end
end
diff --git a/modules/desktop/icons/default.nix b/modules/desktop/icons/default.nix
index d310268..e4f7d7b 100644
--- a/modules/desktop/icons/default.nix
+++ b/modules/desktop/icons/default.nix
@@ -10,6 +10,11 @@ in
{
options.desktop.icons = {
apps = {
+ khal = lib.mkOption {
+ type = lib.types.str;
+ default = "calendar";
+ description = "Icon for khal calendar app";
+ };
calcurse = lib.mkOption {
type = lib.types.str;
default = "calendar";
@@ -164,6 +169,7 @@ in
config = lib.mkIf cfg.enable {
desktop.icons = {
apps = {
+ khal = "calendar";
calcurse = "calendar";
git = "git";
gopass = "password-manager";
diff --git a/modules/desktop/niri/keybindings.nix b/modules/desktop/niri/keybindings.nix
index de2f144..946bdc0 100644
--- a/modules/desktop/niri/keybindings.nix
+++ b/modules/desktop/niri/keybindings.nix
@@ -140,6 +140,7 @@ in
_props.allow-when-locked = true;
spawn = [
(lib.getExe config.media.pamixer.package)
+ "--allow-boost"
"--decrease"
"5"
];
@@ -148,6 +149,7 @@ in
_props.allow-when-locked = true;
spawn = [
(lib.getExe config.media.pamixer.package)
+ "--allow-boost"
"--increase"
"5"
];
diff --git a/modules/office/default.nix b/modules/office/default.nix
index 669ff22..0a19fcd 100644
--- a/modules/office/default.nix
+++ b/modules/office/default.nix
@@ -2,7 +2,7 @@
{ ... }:
{
imports = [
- ./calcurse
+ ./khal
./zathura
];
}
diff --git a/modules/office/khal/default.nix b/modules/office/khal/default.nix
new file mode 100644
index 0000000..8d924f5
--- /dev/null
+++ b/modules/office/khal/default.nix
@@ -0,0 +1,69 @@
+# CLI calendar application (khal)
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+let
+ cfg = config.office.khal;
+ icons = config.desktop.icons.apps;
+ calendarPath = "${config.xdg.dataHome}/khal/calendars";
+ base16Colors = import ../../colors/base16 { inherit config lib pkgs; };
+in
+{
+ options.office.khal = {
+ enable = lib.mkEnableOption "khal, a CLI calendar application";
+ package = lib.mkOption {
+ type = lib.types.package;
+ readOnly = true;
+ default = config.programs.khal.package;
+ description = "The khal package to use.";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.khal = {
+ enable = true;
+ locale = {
+ timeformat = "%H:%M";
+ dateformat = "%Y-%m-%d";
+ longdateformat = "%Y-%m-%d";
+ datetimeformat = "%Y-%m-%d %H:%M";
+ longdatetimeformat = "%Y-%m-%d %H:%M";
+ };
+ settings.default = {
+ default_calendar = "personal";
+ default_dayevent_duration = "1d";
+ default_event_duration = "1h";
+ enable_mouse = true;
+ timedelta = "2d";
+ };
+ settings.view.theme = "dark";
+ };
+
+ accounts.calendar = {
+ basePath = calendarPath;
+ accounts.personal = {
+ khal = {
+ enable = true;
+ color = base16Colors.colorsWithHashPrefix.base0D;
+ };
+ local.type = "filesystem";
+ };
+ };
+
+ xdg.desktopEntries."khal" = lib.mkIf (config.terminal.kitty.enable && cfg.package != null) {
+ name = "khal";
+ exec = "${lib.getExe config.terminal.kitty.package} --class khal -e ${lib.getExe' cfg.package "khal"} interactive";
+ icon = icons.khal or "calendar";
+ categories = [
+ "Office"
+ "Calendar"
+ ];
+ comment = "CLI calendar application";
+ terminal = false;
+ type = "Application";
+ };
+ };
+}
diff --git a/modules/terminal/kitty/assertions.nix b/modules/terminal/kitty/assertions.nix
index 97f1ba0..96be94c 100644
--- a/modules/terminal/kitty/assertions.nix
+++ b/modules/terminal/kitty/assertions.nix
@@ -7,7 +7,7 @@ in
assertions = [
{
assertion =
- !(cfg.enable && config.terminal.kitty.settings.shell != null && !config.terminal.zsh.enable);
+ !(cfg.enable && config.programs.kitty.settings.shell != null && !config.terminal.zsh.enable);
message = ''
terminal.kitty.enable has shell explicitly set to zsh but terminal.zsh.enable is not set.
Enable terminal.zsh or configure a different shell for kitty.
diff --git a/users/arpit/default.nix b/users/arpit/default.nix
index 75cfcbc..de168be 100644
--- a/users/arpit/default.nix
+++ b/users/arpit/default.nix
@@ -66,8 +66,7 @@
networking.usque.warp.enable = true;
# Office
- office.calcurse.enable = true;
- office.calcurse.sync.enable = true;
+ office.khal.enable = true;
office.zathura.enable = true;
# Security