Skip to content

Commit

Permalink
Merge pull request #5 from mardukpill/testing
Browse files Browse the repository at this point in the history
merge testing
  • Loading branch information
mardukpill authored Jul 17, 2024
2 parents 29072ef + 66c2600 commit b5b1ac6
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 6 deletions.
44 changes: 43 additions & 1 deletion modules/home/cli/git/default.nix
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
{ }
{
lib,
pkgs,
namespace,
config,
...
}:
let
inherit (lib) mkIf types;
inherit (lib.${namespace}) mkOpt;

cfg = config.${namespace}.cli.git;
in
{
options.${namespace}.cli.git = {
manage = mkOpt types.bool true "whether to manage git home configuration";
};

config = mkIf cfg.manage {
programs.git = {
enable = true;

delta = {
enable = true;

options = {
dark = true;
line-numbers = true;
};
};

extraConfig = {
init = {
defaultBranch = "main";
};

push = {
autoSetupRemote = true;
};
};
};
};
}
1 change: 0 additions & 1 deletion modules/home/wms/hyprland/binds.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
}:
let
inherit (lib) mkIf;
grimblast = inputs.hyprland-contrib.packages.${pkgs.hostPlatform.system}.grimblast;

cfg = config.${namespace}.wms.hyprland;
in
Expand Down
5 changes: 2 additions & 3 deletions modules/home/wms/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ let
inherit (lib) mkIf mkEnableOption;
inherit (lib.${namespace}) enabled;
inherit (inputs) hyprland;
cfg = config.${namespace}.wms.hyprland;
grimblast = inputs.hyprland-contrib.packages.${pkgs.hostPlatform.system}.grimblast;

cfg = config.${namespace}.wms.hyprland;
in
{
options.${namespace}.wms.hyprland = {
Expand All @@ -52,7 +51,7 @@ in
hyprpicker

grimblast
# hyprzoom
dotties.hyprzoom

swappy
gtk-engine-murrine # TODO: move to dedicated file
Expand Down
5 changes: 4 additions & 1 deletion modules/nixos/wms/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
...
}:
let
inherit (lib) mkIf mkEnableOption enabled;
inherit (lib) mkIf mkEnableOption;

cfg = config.${namespace}.wms.hyprland;
in
Expand All @@ -16,6 +16,9 @@ in
};

config = mkIf cfg.enable {

environment.systemPackages = with pkgs; [ ];

programs.hyprland.enable = true;
programs.hyprland.portalPackage = pkgs.xdg-desktop-portal-gtk;

Expand Down
44 changes: 44 additions & 0 deletions packages/hyprzoom/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
pkgs,
lib,
namespace,
...
}:
pkgs.writeShellScriptBin "hyprzoom" ''
if [ "$#" -ne 1 ]; then
echo "Usage: $0 {in|out}"
exit 1
fi
get_zoom_factor() {
hyprctl getoption cursor:zoom_factor | grep -oP '\d+(\.\d+)?'
}
zoom_step=0.5
current_zoom=$(get_zoom_factor)
# Check if the current zoom factor is retrieved successfully
if [ -z "$current_zoom" ]; then
echo "Error: Could not retrieve the current zoom factor."
exit 1
fi
# Adjust the zoom factor based on the argument
if [ "$1" == "in" ]; then
new_zoom=$(echo "$current_zoom + $zoom_step" | ${pkgs.bc}/bin/bc)
elif [ "$1" == "out" ]; then
new_zoom=$(echo "$current_zoom - $zoom_step" | ${pkgs.bc}/bin/bc)
else
echo "Usage: $0 {in|out}"
exit 1
fi
# use bc, due to bash being unable to handle floats
if (( $(echo "$new_zoom < 1" | ${pkgs.bc}/bin/bc -l) )); then
new_zoom=1
fi
${pkgs.hyprland}/bin/hyprctl keyword cursor:zoom_factor $new_zoom
''

0 comments on commit b5b1ac6

Please sign in to comment.