1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
This commit is contained in:
2025-07-08 20:56:40 +02:00
parent e8e165ff03
commit e4543eeb0b
4 changed files with 93 additions and 23 deletions

View File

@@ -98,6 +98,8 @@ in {
}; };
}; };
security.pam.services.swaylock = {};
services.xserver = { services.xserver = {
monitorSection = ''Option "DPMS" "false"''; monitorSection = ''Option "DPMS" "false"'';
serverFlagsSection = '' serverFlagsSection = ''
@@ -269,6 +271,8 @@ in {
# XF86Launch1 (thinkvantage) # XF86Launch1 (thinkvantage)
}; };
in { in {
programs.swaylock.enable = true;
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
config = { config = {
@@ -279,6 +283,15 @@ in {
xkb_layout = "de"; xkb_layout = "de";
xkb_variant = "T3"; xkb_variant = "T3";
}; };
"type:keyboard" = {
repeat_rate = "50";
};
"type:touchpad" = {
dwt = "enabled";
dwtp = "enabled";
tap = "enabled";
tap_button_map = "lrm";
};
}; };
terminal = (defaultApplications pkgs).terminal; terminal = (defaultApplications pkgs).terminal;
up = "k"; up = "k";

View File

@@ -2,27 +2,63 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
commaSep = builtins.concatStringsSep ","; commaSep = builtins.concatStringsSep ",";
xkbOptions = ["compose:caps" "terminate:ctrl_alt_bksp" "grp:ctrls_toggle"]; xkbOptions = [
"compose:caps"
"terminate:ctrl_alt_bksp"
"grp:ctrls_toggle"
];
languages = { languages = {
deutsch = { code = "de"; variant = "T3"; }; deutsch = {
greek = { code = "gr"; variant = "polytonic"; }; code = "de";
russian = { code = "ru"; variant = "phonetic"; }; variant = "T3";
arabic = { code = "ara"; variant = "buckwalter"; }; # ../lib/keyboards/arabic; };
greek = {
code = "gr";
variant = "polytonic";
};
russian = {
code = "ru";
variant = "phonetic";
};
arabic = {
code = "ara";
variant = "buckwalter";
}; # ../lib/keyboards/arabic;
coptic = ../lib/keyboards/coptic; coptic = ../lib/keyboards/coptic;
avestan = ../lib/keyboards/avestan; avestan = ../lib/keyboards/avestan;
gothic = ../lib/keyboards/gothic; gothic = ../lib/keyboards/gothic;
farsi = { code = "ir"; variant = "qwerty"; }; farsi = {
syriac = { code = "sy"; variant = "syc_phonetic"; }; code = "ir";
sanskrit = { code = "in"; variant = "san-kagapa"; }; variant = "qwerty";
gujarati = {code = "in"; variant = "guj-kagapa"; }; };
urdu = {code = "in"; variant = "urd-phonetic"; }; syriac = {
hebrew = {code = "il"; variant = "phonetic";}; code = "sy";
variant = "syc_phonetic";
};
sanskrit = {
code = "in";
variant = "san-kagapa";
};
gujarati = {
code = "in";
variant = "guj-kagapa";
};
urdu = {
code = "in";
variant = "urd-phonetic";
};
hebrew = {
code = "il";
variant = "phonetic";
};
}; };
defaultLanguage = languages.deutsch; defaultLanguage = languages.deutsch;
in { in
{
services.libinput.enable = true; services.libinput.enable = true;
# man 7 xkeyboard-config # man 7 xkeyboard-config
@@ -41,7 +77,8 @@ in {
lib.mapAttrsToList (name: value: { lib.mapAttrsToList (name: value: {
name = "symbols/${name}"; name = "symbols/${name}";
path = value; path = value;
}) (lib.filterAttrs (_: value: !(value ? "code")) languages) ++ [ }) (lib.filterAttrs (_: value: !(value ? "code")) languages)
++ [
{ {
name = "symbols/ir"; name = "symbols/ir";
path = ../lib/keyboards/farsi; path = ../lib/keyboards/farsi;
@@ -54,25 +91,40 @@ in {
environment.etc."x11-locale".source = toString pkgs.xorg.libX11 + "share/X11/locale"; environment.etc."x11-locale".source = toString pkgs.xorg.libX11 + "share/X11/locale";
home-manager.users.me = {
home.file =
lib.mapAttrs' (name: path: lib.nameValuePair ".xkb/symbols/${name}" { source = path; })
(lib.filterAttrs (_: value: !(value ? "code")) languages) // {
".xkb/symbols/ir".source = ../lib/keyboards/farsi;
};
};
console.keyMap = "de"; console.keyMap = "de";
environment.systemPackages = environment.systemPackages = lib.mapAttrsToList (
lib.mapAttrsToList language: settings:
(language: settings:
let let
code = if settings ? "code" then settings.code else language; code = if settings ? "code" then settings.code else language;
variant = if settings ? "variant" then settings.variant else ""; variant = if settings ? "variant" then settings.variant else "";
in in
pkgs.writers.writeDashBin "kb-${language}" '' pkgs.writers.writeDashBin "kb-${language}" ''
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage.code},${code} ${defaultLanguage.variant},${variant} ${toString (map (option: "-option ${option}") xkbOptions)} if [ -z $SWAYSOCK ]; then
'') ${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage.code},${code} ${defaultLanguage.variant},${variant} ${
languages; toString (map (option: "-option ${option}") xkbOptions)
}
else
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}"'
fi
''
) languages;
# improve held key rate # improve held key rate
services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50"; services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50";
systemd.user.services.gxkb = { systemd.user.services.gxkb = {
wantedBy = ["graphical-session.target"]; wantedBy = [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
SyslogIdentifier = "gxkb"; SyslogIdentifier = "gxkb";
ExecStart = "${pkgs.gxkb}/bin/gxkb"; ExecStart = "${pkgs.gxkb}/bin/gxkb";

View File

@@ -94,6 +94,7 @@ in {
# HARDWARE TOOLS # HARDWARE TOOLS
gnome-disk-utility gnome-disk-utility
arandr # xrandr for noobs arandr # xrandr for noobs
wdisplays
libnotify # for notify-send libnotify # for notify-send
xclip # clipboard CLI xclip # clipboard CLI
xdragon # drag and drop xdragon # drag and drop

View File

@@ -17,7 +17,11 @@ in {
chmod o+rx ${stateDir} chmod o+rx ${stateDir}
cd ${stateDir} cd ${stateDir}
(${pkgs.curl}/bin/curl -s -o wallpaper.tmp -z wallpaper.tmp ${lib.escapeShellArg url} && cp wallpaper.tmp wallpaper) || : (${pkgs.curl}/bin/curl -s -o wallpaper.tmp -z wallpaper.tmp ${lib.escapeShellArg url} && cp wallpaper.tmp wallpaper) || :
${pkgs.feh}/bin/feh --no-fehbg --bg-scale wallpaper if [ -z $SWAYSOCK ]; then
${pkgs.feh}/bin/feh --no-fehbg --bg-scale wallpaper
else
${pkgs.sway}/bin/swaymsg -s $SWAYSOCK 'output * bg ${stateDir}/wallpaper fill'
fi
''; '';
startAt = "*:00,10,20,30,40,50"; startAt = "*:00,10,20,30,40,50";
serviceConfig = { serviceConfig = {