aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@proton.me>2026-03-12 22:50:38 +0530
committerArpit Chakladar <arpitchakladar@proton.me>2026-03-12 22:50:38 +0530
commitfb6fae78379276b8d8be97ac6fe7a4771cc61b0d (patch)
tree988aace684f155303c211bcbeecbc6128199d65d /modules/desktop
parent532107493512bb56581df1c60166830e44bd5076 (diff)
downloadhome-manager-config-fb6fae78379276b8d8be97ac6fe7a4771cc61b0d.tar.gz
home-manager-config-fb6fae78379276b8d8be97ac6fe7a4771cc61b0d.zip
Added formatter and performed formatting
Diffstat (limited to 'modules/desktop')
-rw-r--r--modules/desktop/bspwm/default.nix24
-rw-r--r--modules/desktop/default.nix7
-rw-r--r--modules/desktop/gtk/default.nix7
-rw-r--r--modules/desktop/polybar/bar/main.nix3
-rw-r--r--modules/desktop/polybar/default.nix15
-rw-r--r--modules/desktop/sxhkd/default.nix57
-rw-r--r--modules/desktop/sxhkd/keybindings/brightnessctl.nix19
-rw-r--r--modules/desktop/sxhkd/keybindings/bspwm.nix61
-rw-r--r--modules/desktop/sxhkd/keybindings/maim.nix23
-rw-r--r--modules/desktop/sxhkd/keybindings/pamixer.nix24
-rw-r--r--modules/desktop/sxhkd/keybindings/playerctl.nix14
11 files changed, 134 insertions, 120 deletions
diff --git a/modules/desktop/bspwm/default.nix b/modules/desktop/bspwm/default.nix
index 1248946..19fdf2a 100644
--- a/modules/desktop/bspwm/default.nix
+++ b/modules/desktop/bspwm/default.nix
@@ -1,4 +1,9 @@
-{ config, lib, pkgs, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
{
config = lib.mkIf config.desktop.enable {
@@ -33,14 +38,17 @@
};
xsession.windowManager.bspwm.extraConfig = ''
-for monitor in $(xrandr -q | grep -w 'connected' | cut -d' ' -f1); do
- bspc monitor "$monitor" -d '1' '2' '3' '4' '5' '6'
-done
+ for monitor in $(xrandr -q | grep -w 'connected' | cut -d' ' -f1); do
+ bspc monitor "$monitor" -d '1' '2' '3' '4' '5' '6'
+ done
-${config.services.polybar.script}
-${if config.tools.feh.enable then
- "${pkgs.feh}/bin/feh --bg-scale ${../../../assets/skeleton-mage.png}"
-else "xsetroot -solid \"${config.scheme.withHashtag.base00}\""}
+ ${config.services.polybar.script}
+ ${
+ if config.tools.feh.enable then
+ "${pkgs.feh}/bin/feh --bg-scale ${../../../assets/skeleton-mage.png}"
+ else
+ "xsetroot -solid \"${config.scheme.withHashtag.base00}\""
+ }
'';
};
}
diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix
index 143978c..2856d45 100644
--- a/modules/desktop/default.nix
+++ b/modules/desktop/default.nix
@@ -1,4 +1,9 @@
-{ lib, config, pkgs, ... }:
+{
+ lib,
+ config,
+ pkgs,
+ ...
+}:
{
imports = [
diff --git a/modules/desktop/gtk/default.nix b/modules/desktop/gtk/default.nix
index 3e32a2a..5147bf5 100644
--- a/modules/desktop/gtk/default.nix
+++ b/modules/desktop/gtk/default.nix
@@ -1,4 +1,9 @@
-{ config, lib, pkgs, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
{
config = lib.mkIf config.desktop.enable {
diff --git a/modules/desktop/polybar/bar/main.nix b/modules/desktop/polybar/bar/main.nix
index d96fe09..8b52fab 100644
--- a/modules/desktop/polybar/bar/main.nix
+++ b/modules/desktop/polybar/bar/main.nix
@@ -3,7 +3,8 @@
with config.scheme.withHashtag;
let
largerFontSize = toString (builtins.ceil (config.fonts.size * 9.0 / 8.0));
-in {
+in
+{
width = "100%:-20";
fixed-center = false;
height = 35;
diff --git a/modules/desktop/polybar/default.nix b/modules/desktop/polybar/default.nix
index ec8d4f5..9aeb772 100644
--- a/modules/desktop/polybar/default.nix
+++ b/modules/desktop/polybar/default.nix
@@ -1,11 +1,18 @@
-{ config, lib, pkgs, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
{
config = lib.mkIf config.desktop.enable {
services.polybar.enable = true;
- services.polybar.package = (pkgs.polybar.override {
- pulseSupport = true;
- });
+ services.polybar.package = (
+ pkgs.polybar.override {
+ pulseSupport = true;
+ }
+ );
services.polybar.script = "${config.services.polybar.package}/bin/polybar main &";
services.polybar.config = lib.mkMerge [
(import ./bar { inherit config lib; })
diff --git a/modules/desktop/sxhkd/default.nix b/modules/desktop/sxhkd/default.nix
index 19bc540..fe8acbb 100644
--- a/modules/desktop/sxhkd/default.nix
+++ b/modules/desktop/sxhkd/default.nix
@@ -1,42 +1,39 @@
-{ pkgs, config, lib, ... }:
+{
+ pkgs,
+ config,
+ lib,
+ ...
+}:
{
config = lib.mkIf config.desktop.enable {
services.sxhkd.enable = true;
services.sxhkd.keybindings =
- let
- modKey = "super";
- createKeybinding = keybinding: createKeybindingBase "${modKey} + ${keybinding}";
- createKeybindingBase = keybinding: description: command: {
- "# ${description}\n${keybinding}" = command;
- };
- in lib.mkMerge [
- (import ./keybindings/brightnessctl.nix { inherit pkgs createKeybindingBase lib; })
- (import ./keybindings/bspwm.nix { inherit pkgs createKeybinding lib; })
- (import ./keybindings/maim.nix { inherit pkgs createKeybinding lib; })
- (import ./keybindings/pamixer.nix { inherit pkgs createKeybindingBase lib; })
- (import ./keybindings/playerctl.nix { inherit pkgs createKeybindingBase lib; })
+ let
+ modKey = "super";
+ createKeybinding = keybinding: createKeybindingBase "${modKey} + ${keybinding}";
+ createKeybindingBase = keybinding: description: command: {
+ "# ${description}\n${keybinding}" = command;
+ };
+ in
+ lib.mkMerge [
+ (import ./keybindings/brightnessctl.nix { inherit pkgs createKeybindingBase lib; })
+ (import ./keybindings/bspwm.nix { inherit pkgs createKeybinding lib; })
+ (import ./keybindings/maim.nix { inherit pkgs createKeybinding lib; })
+ (import ./keybindings/pamixer.nix { inherit pkgs createKeybindingBase lib; })
+ (import ./keybindings/playerctl.nix { inherit pkgs createKeybindingBase lib; })
- (createKeybinding
- "s"
- "Show keybindings."
- "kitty --title 'Keybindings' --class floating-termial -e ${pkgs.writeShellScript "keybindings.sh" (builtins.readFile ./scripts/keybindings.sh)}"
+ (createKeybinding "s" "Show keybindings."
+ "kitty --title 'Keybindings' --class floating-termial -e ${pkgs.writeShellScript "keybindings.sh" (builtins.readFile ./scripts/keybindings.sh)}"
)
- (createKeybinding
- "r"
- "Application launcher."
- "rofi -show drun")
+ (createKeybinding "r" "Application launcher." "rofi -show drun")
- (createKeybinding
- "t"
- "Launch terminal."
- "kitty")
+ (createKeybinding "t" "Launch terminal." "kitty")
- (createKeybinding
- "f"
- "Launch File Manager."
- "kitty --title 'File Manager' --class floating-termial -e nnn")
- ];
+ (createKeybinding "f" "Launch File Manager."
+ "kitty --title 'File Manager' --class floating-termial -e nnn"
+ )
+ ];
};
}
diff --git a/modules/desktop/sxhkd/keybindings/brightnessctl.nix b/modules/desktop/sxhkd/keybindings/brightnessctl.nix
index bc508e6..c48c86b 100644
--- a/modules/desktop/sxhkd/keybindings/brightnessctl.nix
+++ b/modules/desktop/sxhkd/keybindings/brightnessctl.nix
@@ -1,15 +1,14 @@
-{ createKeybindingBase, pkgs, lib }:
+{
+ createKeybindingBase,
+ pkgs,
+ lib,
+}:
let
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
-in lib.mkMerge [
- (createKeybindingBase
- "XF86MonBrightnessDown"
- "Decrease brightness."
- "${brightnessctl} set 5%-")
+in
+lib.mkMerge [
+ (createKeybindingBase "XF86MonBrightnessDown" "Decrease brightness." "${brightnessctl} set 5%-")
- (createKeybindingBase
- "XF86MonBrightnessUp"
- "Increase brightness."
- "${brightnessctl} set +5%")
+ (createKeybindingBase "XF86MonBrightnessUp" "Increase brightness." "${brightnessctl} set +5%")
]
diff --git a/modules/desktop/sxhkd/keybindings/bspwm.nix b/modules/desktop/sxhkd/keybindings/bspwm.nix
index cd838a3..097b976 100644
--- a/modules/desktop/sxhkd/keybindings/bspwm.nix
+++ b/modules/desktop/sxhkd/keybindings/bspwm.nix
@@ -1,45 +1,36 @@
-{ createKeybinding, pkgs, lib }:
+{
+ createKeybinding,
+ pkgs,
+ lib,
+}:
let
bspc = "${pkgs.bspwm}/bin/bspc";
-in lib.mkMerge [
- (createKeybinding
- "q"
- "Kill current window."
- "${bspc} node -c")
+in
+lib.mkMerge [
+ (createKeybinding "q" "Kill current window." "${bspc} node -c")
- (createKeybinding
- "{1-9,0}"
- "Switch workspace."
- "${bspc} desktop -f {1-9,10}")
+ (createKeybinding "{1-9,0}" "Switch workspace." "${bspc} desktop -f {1-9,10}")
- (createKeybinding
- "shift + {1-9,0}"
- "Move window to workspace."
- "${bspc} node -d {1-9,10} --follow")
+ (createKeybinding "shift + {1-9,0}" "Move window to workspace." "${bspc} node -d {1-9,10} --follow")
- (createKeybinding
- "{n,d,m}"
- "Set current window mode (tiled, floating, fullscreen)."
- "${bspc} node focused -t {tiled,floating,fullscreen}")
+ (createKeybinding "{n,d,m}" "Set current window mode (tiled, floating, fullscreen)."
+ "${bspc} node focused -t {tiled,floating,fullscreen}"
+ )
- (createKeybinding
- "{_,shift + }{h,j,k,l}"
- "Navigate between windows."
- "${bspc} node --{focus,swap} {west,south,north,east}")
+ (createKeybinding "{_,shift + }{h,j,k,l}" "Navigate between windows."
+ "${bspc} node --{focus,swap} {west,south,north,east}"
+ )
# the indentation for each line is required to work with the help prompt
- (createKeybinding
- "ctrl + {h,j,k,l}"
- "Resize current window."
- ''
- ${bspc} node {@parent/second -z left -20 0; \
- @parent/first -z right -20 0, \
- @parent/second -z top 0 +20; \
- @parent/first -z bottom 0 +20, \
- @parent/first -z bottom 0 -20; \
- @parent/second -z top 0 -20, \
- @parent/first -z right +20 0; \
- @parent/second -z left +20 0}
-'')
+ (createKeybinding "ctrl + {h,j,k,l}" "Resize current window." ''
+ ${bspc} node {@parent/second -z left -20 0; \
+ @parent/first -z right -20 0, \
+ @parent/second -z top 0 +20; \
+ @parent/first -z bottom 0 +20, \
+ @parent/first -z bottom 0 -20; \
+ @parent/second -z top 0 -20, \
+ @parent/first -z right +20 0; \
+ @parent/second -z left +20 0}
+ '')
]
diff --git a/modules/desktop/sxhkd/keybindings/maim.nix b/modules/desktop/sxhkd/keybindings/maim.nix
index 2092a71..0f0b3d8 100644
--- a/modules/desktop/sxhkd/keybindings/maim.nix
+++ b/modules/desktop/sxhkd/keybindings/maim.nix
@@ -1,15 +1,18 @@
-{ createKeybinding, pkgs, lib }:
+{
+ createKeybinding,
+ pkgs,
+ lib,
+}:
let
maim = "${pkgs.maim}/bin/maim";
-in lib.mkMerge [
- (createKeybinding
- "p"
- "Take screenshot of selected area and save to clipboard"
- "${maim} -s | xclip -selection clipboard -t image/png")
+in
+lib.mkMerge [
+ (createKeybinding "p" "Take screenshot of selected area and save to clipboard"
+ "${maim} -s | xclip -selection clipboard -t image/png"
+ )
- (createKeybinding
- "shift + p"
- "Take screenshot of selected area and save to ~/Pictures/Screenshots"
- "mkdir -p ~/Pictures/Screenshots && ${maim} -s ~/Pictures/Screenshots/screenshot-$(date +%Y%m%d-%H%M%S).png")
+ (createKeybinding "shift + p" "Take screenshot of selected area and save to ~/Pictures/Screenshots"
+ "mkdir -p ~/Pictures/Screenshots && ${maim} -s ~/Pictures/Screenshots/screenshot-$(date +%Y%m%d-%H%M%S).png"
+ )
]
diff --git a/modules/desktop/sxhkd/keybindings/pamixer.nix b/modules/desktop/sxhkd/keybindings/pamixer.nix
index e7f056e..4b495aa 100644
--- a/modules/desktop/sxhkd/keybindings/pamixer.nix
+++ b/modules/desktop/sxhkd/keybindings/pamixer.nix
@@ -1,20 +1,16 @@
-{ createKeybindingBase, pkgs, lib }:
+{
+ createKeybindingBase,
+ pkgs,
+ lib,
+}:
let
pamixer = "${pkgs.pamixer}/bin/pamixer";
-in lib.mkMerge [
- (createKeybindingBase
- "XF86AudioLowerVolume"
- "Decrease volume."
- "${pamixer} --decrease 5")
+in
+lib.mkMerge [
+ (createKeybindingBase "XF86AudioLowerVolume" "Decrease volume." "${pamixer} --decrease 5")
- (createKeybindingBase
- "XF86AudioRaiseVolume"
- "Increase volume."
- "${pamixer} --increase 5")
+ (createKeybindingBase "XF86AudioRaiseVolume" "Increase volume." "${pamixer} --increase 5")
- (createKeybindingBase
- "XF86AudioMute"
- "Mute audio."
- "${pamixer} --toggle-mute")
+ (createKeybindingBase "XF86AudioMute" "Mute audio." "${pamixer} --toggle-mute")
]
diff --git a/modules/desktop/sxhkd/keybindings/playerctl.nix b/modules/desktop/sxhkd/keybindings/playerctl.nix
index 7c3b796..e9d744e 100644
--- a/modules/desktop/sxhkd/keybindings/playerctl.nix
+++ b/modules/desktop/sxhkd/keybindings/playerctl.nix
@@ -1,10 +1,12 @@
-{ createKeybindingBase, pkgs, lib }:
+{
+ createKeybindingBase,
+ pkgs,
+ lib,
+}:
let
playerctl = "${pkgs.playerctl}/bin/playerctl";
-in lib.mkMerge [
- (createKeybindingBase
- "XF86AudioPlay"
- "Toggle video / audio player."
- "${playerctl} play-pause")
+in
+lib.mkMerge [
+ (createKeybindingBase "XF86AudioPlay" "Toggle video / audio player." "${playerctl} play-pause")
]