1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

2 Commits

Author SHA1 Message Date
3d9a48c65e hyprland 2026-01-04 14:30:06 +01:00
ad7fc115c6 himalaya: fix config and add neovim wrapper 2026-01-04 12:36:51 +01:00
7 changed files with 322 additions and 7 deletions

View File

@@ -128,7 +128,6 @@
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-posteo.path}";
himalaya = {
enable = true;
settings.backend = "imap";
};
aerc.extraAccounts.pgp-key-id = "9EDE82CC72A343A95266D0F444857074A3ACC8B7";
};

View File

@@ -262,6 +262,7 @@ in
./htop.nix
./uni.nix
./i3.nix
./hyprland.nix
./i3status-rust.nix
./keyboard
./kdeconnect.nix

289
configs/hyprland.nix Normal file
View File

@@ -0,0 +1,289 @@
{
pkgs,
lib,
config,
...
}:
let
stylixColors = config.lib.stylix.colors;
ashellConfig = (pkgs.formats.toml { }).generate "config.toml" {
# position = "bottom";
modules = {
left = [
"Workspaces"
[
"WindowTitle"
]
];
center = [ "Clock" ];
right = [
"KeyboardLayout"
[
"Tray"
"SystemInfo"
"Settings"
"CustomNotifications"
]
];
};
workspaces = {
workspace_names = [
"١"
"٢"
"٣"
"٤"
"٥"
"٦"
"٧"
"٨"
"٩"
"١٠"
];
visibility_mode = "MonitorSpecific";
enable_workspace_filling = false;
disable_special_workspaces = true;
};
keyboard_layout.labels = {
"de" = "🇩🇪";
};
window_title = {
mode = "Title";
truncate_title_after_length = 75;
};
media_player = {
max_title_length = 40;
};
system_info.indicators = [
"Cpu"
"Memory"
{ Disk = "/"; }
];
clock.format = "%Y-%m-%d (%W %a) %H:%M";
settings.indicators = [
"IdleInhibitor"
"PowerProfile"
"Audio"
"Bluetooth"
"Network"
"Vpn"
"Battery"
];
appearance = {
font_name = config.stylix.fonts.sansSerif.name;
backdrop = 0.3;
scale_factor = 0.75;
# style = "Solid";
primary_color = "#" + stylixColors.base0D;
success_color = "#" + stylixColors.base0B;
text_color = "#" + stylixColors.base05;
workspace_colors = [ ("#" + stylixColors.base0E) ];
background_color = "#" + stylixColors.base00;
danger_color = "#" + stylixColors.base08;
secondary_color = "#" + stylixColors.base0A;
};
CustomModule = [
{
name = "CustomNotifications";
icon = "🔔";
command = "${lib.getExe' pkgs.swaynotificationcenter "swaync-client"} -t -sw";
listen_cmd = "${lib.getExe' pkgs.swaynotificationcenter "swaync-client"} -swb";
icons."dnd.*" = "🔕";
alert = ".*notification";
}
];
};
in
{
programs.hyprland = {
enable = true;
withUWSM = true;
xwayland.enable = true;
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
};
home-manager.users.me = {
home.file.".config/ashell/config.toml".source = ashellConfig;
services.swaync.enable = true;
services.mako.enable = true;
services.clipman.enable = true;
services.hyprsunset.enable = true;
services.hypridle = {
enable = true;
settings = {
general = {
after_sleep_cmd = "hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "hyprlock";
};
listener = [
{
timeout = 900;
on-timeout = "hyprlock";
}
{
timeout = 1200;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
};
};
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = !config.programs.hyprland.enable;
settings =
let
mod = "SUPER";
in
{
env = [
"XCURSOR_SIZE,${toString config.stylix.cursor.size}" # TODO
"HYPRCURSOR_SIZE,${toString config.stylix.cursor.size}" # TODO
"HYPRCURSOR_THEME,${config.stylix.cursor.name}"
"QT_QPA_PLATFORM=wayland"
"GDK_BACKEND=wayland"
"HYPRSHOT_DIR=${config.home-manager.users.me.xdg.userDirs.download}/Screenshots"
];
permission = [
"${lib.getExe pkgs.hyprshot}, screencopy, allow"
"${pkgs.xdg-desktop-portal-hyprland}/libexec/.xdg-desktop-portal-hyprland-wrapped, screencopy, allow"
];
monitor = ",preferred,auto,auto"; # TODO https://wiki.hypr.land/Configuring/Monitors/
exec-once = [
(lib.getExe pkgs.ashell)
"hyprctl dispatch exec \"[workspace special:obsidian silent] obsidian\""
];
general = {
gaps_in = 2;
gaps_out = 2;
border_size = 1;
resize_on_border = true;
allow_tearing = false;
layout = "dwindle";
};
decoration = {
rounding = 2;
rounding_power = 2;
active_opacity = 1.0;
inactive_opacity = 0.9;
shadow = {
enabled = true;
range = 4;
render_power = 3;
};
blur = {
enabled = true;
size = 3;
passes = 1;
vibrancy = 0.17;
};
};
animations = {
enabled = false;
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
master.new_status = "master";
gesture = [
"3, horizontal, workspace"
];
input = {
kb_layout = "de";
kb_variant = "T3";
kb_options = "compose:caps,grp:ctrls_toggle";
follow_mouse = 1;
sensitivity = 0;
touchpad.natural_scroll = false;
};
bindm = [
"${mod}, mouse:272, movewindow"
"${mod}, mouse:273, resizewindow"
];
bindel = [
",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+"
",XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-"
", Print, exec, ${lib.getExe pkgs.hyprshot} -m region --clipboard-only"
"${mod}, Print, exec, ${lib.getExe pkgs.hyprshot} -m region"
];
bindl = [
", XF86AudioNext, exec, playerctl next"
", XF86AudioPause, exec, playerctl play-pause"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
];
bind = [
"${mod}, Return, exec, ${lib.getExe pkgs.niveum-terminal}"
"${mod} SHIFT, Q, killactive,"
"${mod} SHIFT, R, exit,"
"${mod}, t, exec, ${lib.getExe pkgs.niveum-filemanager}"
"${mod}, Y, exec, ${lib.getExe pkgs.niveum-browser}"
"${mod}, Q, exec, ${lib.getExe pkgs.clipman} pick --tool=${lib.getExe pkgs.rofi}"
"${mod}, u, exec, ${lib.getExe pkgs.unicodmenu}"
"${mod}, p, exec, rofi-pass"
"${mod} Shift, Z, togglefloating,"
"${mod}, D, exec, ${lib.getExe pkgs.rofi} -show run"
"${mod}, P, pseudo," # dwindle
"${mod}, v, togglesplit," # dwindle
"${mod}, F, fullscreen"
"${mod}, h, movefocus, l"
"${mod}, l, movefocus, r"
"${mod}, k, movefocus, u"
"${mod}, j, movefocus, d"
"${mod} SHIFT, H, movewindow, l"
"${mod} SHIFT, L, movewindow, r"
"${mod} SHIFT, K, movewindow, u"
"${mod} SHIFT, J, movewindow, d"
"${mod}, S, togglespecialworkspace, magic"
"${mod} SHIFT, S, movetoworkspace, special:magic"
"${mod}, O, togglespecialworkspace, obsidian"
"${mod} SHIFT, O, movetoworkspace, special:obsidian"
]
++ lib.concatMap (
i:
let
key = lib.mod i 10;
in
[
"${mod}, ${toString key}, workspace, ${toString i}"
"${mod} SHIFT, ${toString key}, movetoworkspace, ${toString i}"
]
) (lib.range 1 10);
windowrule = [
"suppressevent maximize, class:.*" # ignore maximize requests from apps
"nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" # fix some dragging issues with wayyland
"float,title:^(Picture-in-Picture)$"
"pin,title:^(Picture-in-Picture)$"
"size 640 360,title:^(Picture-in-Picture)$"
"move 100%-640 100%-360,title:^(Picture-in-Picture)$"
];
};
};
};
}

View File

@@ -111,14 +111,17 @@ in
variant = if settings ? "variant" then settings.variant else "";
in
pkgs.writers.writeDashBin "kb-${language}" ''
if [ -z $SWAYSOCK ]; then
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage.code},${code} ${defaultLanguage.variant},${variant} ${
toString (map (option: "-option ${option}") xkbOptions)
}
else
if [ -n "$SWAYSOCK" ]; then
swaymsg -s $SWAYSOCK 'input * xkb_layout "${defaultLanguage.code},${code}"'
swaymsg -s $SWAYSOCK 'input * xkb_variant "${defaultLanguage.variant},${variant}"'
swaymsg -s $SWAYSOCK 'input * xkb_options "${lib.concatStringsSep "," xkbOptions}"'
elif [ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
hyprctl keyword input:kb_layout "${defaultLanguage.code},${code}"
hyprctl keyword input:kb_variant "${defaultLanguage.variant},${variant}"
elif [ -n "$DISPLAY" ]; then
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage.code},${code} ${defaultLanguage.variant},${variant} ${
toString (map (option: "-option ${option}") xkbOptions)
}
fi
''
) (languages // config.services.xserver.xkb.extraLayouts);

View File

@@ -56,7 +56,6 @@ in
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-meinhak99.path}";
himalaya = {
enable = true;
settings.backend = "imap";
};
}
)

View File

@@ -317,6 +317,7 @@
notemenu = prev.callPackage packages/notemenu.nix { };
obsidian-vim = prev.callPackage packages/obsidian-vim.nix { };
vim-typewriter = prev.callPackage packages/vim-typewriter.nix { };
vim-email = prev.callPackage packages/vim-email.nix { };
polyglot = prev.callPackage packages/polyglot.nix { };
q = prev.callPackage packages/q.nix { };
qrpaste = prev.callPackage packages/qrpaste.nix { };
@@ -569,6 +570,7 @@
vg
vim-kmein
vim-typewriter
vim-email
vimv
weechat-declarative
wttr

22
packages/vim-email.nix Normal file
View File

@@ -0,0 +1,22 @@
{
neovim,
vimPlugins,
writers,
...
}:
let
vim-email = neovim.override {
extraName = "-email";
configure = {
customRC = ''
source ${./vim-kmein/shared.vim}
autocmd VimEnter * Himalaya
'';
packages.nvim.start = [
vimPlugins.telescope-nvim
vimPlugins.himalaya-vim
];
};
};
in
vim-email