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

View File

@@ -2,27 +2,63 @@
pkgs,
lib,
...
}: let
}:
let
commaSep = builtins.concatStringsSep ",";
xkbOptions = ["compose:caps" "terminate:ctrl_alt_bksp" "grp:ctrls_toggle"];
xkbOptions = [
"compose:caps"
"terminate:ctrl_alt_bksp"
"grp:ctrls_toggle"
];
languages = {
deutsch = { code = "de"; variant = "T3"; };
greek = { code = "gr"; variant = "polytonic"; };
russian = { code = "ru"; variant = "phonetic"; };
arabic = { code = "ara"; variant = "buckwalter"; }; # ../lib/keyboards/arabic;
deutsch = {
code = "de";
variant = "T3";
};
greek = {
code = "gr";
variant = "polytonic";
};
russian = {
code = "ru";
variant = "phonetic";
};
arabic = {
code = "ara";
variant = "buckwalter";
}; # ../lib/keyboards/arabic;
coptic = ../lib/keyboards/coptic;
avestan = ../lib/keyboards/avestan;
gothic = ../lib/keyboards/gothic;
farsi = { code = "ir"; variant = "qwerty"; };
syriac = { 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";};
farsi = {
code = "ir";
variant = "qwerty";
};
syriac = {
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;
in {
in
{
services.libinput.enable = true;
# man 7 xkeyboard-config
@@ -41,7 +77,8 @@ in {
lib.mapAttrsToList (name: value: {
name = "symbols/${name}";
path = value;
}) (lib.filterAttrs (_: value: !(value ? "code")) languages) ++ [
}) (lib.filterAttrs (_: value: !(value ? "code")) languages)
++ [
{
name = "symbols/ir";
path = ../lib/keyboards/farsi;
@@ -54,25 +91,40 @@ in {
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";
environment.systemPackages =
lib.mapAttrsToList
(language: settings:
environment.systemPackages = lib.mapAttrsToList (
language: settings:
let
code = if settings ? "code" then settings.code else language;
variant = if settings ? "variant" then settings.variant else "";
in
pkgs.writers.writeDashBin "kb-${language}" ''
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage.code},${code} ${defaultLanguage.variant},${variant} ${toString (map (option: "-option ${option}") xkbOptions)}
'')
languages;
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
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
services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50";
systemd.user.services.gxkb = {
wantedBy = ["graphical-session.target"];
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
SyslogIdentifier = "gxkb";
ExecStart = "${pkgs.gxkb}/bin/gxkb";

View File

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

View File

@@ -17,7 +17,11 @@ in {
chmod o+rx ${stateDir}
cd ${stateDir}
(${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";
serviceConfig = {