Changed locale settings to French.

Abandoned fcitx5 and switched to wayland-native keyboard layout management.
Changed various other settings to help with the last.
Added gammastep for night shift.
This commit is contained in:
vorboyvo 2024-04-13 23:18:20 -04:00
parent ce67ebfeb8
commit 0c0e98b61a
5 changed files with 49 additions and 28 deletions

View file

@ -45,7 +45,7 @@
time.timeZone = "America/Montreal"; time.timeZone = "America/Montreal";
# Select internationalization properties. # Select internationalization properties.
i18n.defaultLocale = "en_CA.UTF-8"; i18n.defaultLocale = "fr_CA.UTF-8";
console = { console = {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";
keyMap = "us"; keyMap = "us";

View file

@ -8,7 +8,7 @@ in
{ {
home.username = "alice"; home.username = "alice";
home.homeDirectory = "/home/alice"; home.homeDirectory = "/home/alice";
home.stateVersion = "23.11"; home.stateVersion = "23.11";
# Configure cursor # Configure cursor
@ -27,11 +27,25 @@ in
}; };
}; };
# Configure internationalization
# i18n.inputMethod.enabled = "fcitx5";
# Configure xdg-desktop-portal (for file picker, etc.) # Configure xdg-desktop-portal (for file picker, etc.)
# xdg.portal = { # xdg.portal = {
# enable = true; # enable = true;
# }; # };
# Configure gammastep (night shift)
services.gammastep = {
enable = true;
temperature.day = 6500;
temperature.night = 4000;
# boul robert-bourassa/boul rené-lévesque : 45.498743909804354, -73.5703457606738
latitude = 45.4987;
longitude = -73.5703;
tray = true;
};
# Install packages # Install packages
home.packages = home.packages =
with pkgs; with pkgs;
@ -53,15 +67,15 @@ in
[ firefox cinnamon.nemo gnome.file-roller cinnamon.nemo-fileroller evince imv vlc pavucontrol ] ++ # Basic graphical apps [ firefox cinnamon.nemo gnome.file-roller cinnamon.nemo-fileroller evince imv vlc pavucontrol ] ++ # Basic graphical apps
[ libreoffice signal-desktop element-desktop prismlauncher mumble gimp inkscape deluge-gtk shotwell lorien ] ++ # Personalized selection of graphical apps [ libreoffice signal-desktop element-desktop prismlauncher mumble gimp inkscape deluge-gtk shotwell lorien ] ++ # Personalized selection of graphical apps
[ mons ] ++ # Games [ mons ] ++ # Games
[ swaybg bemenu j4-dmenu-desktop fcitx5-with-addons ] ++ # Sway- and Wayland-related packages [ swaybg bemenu j4-dmenu-desktop ] ++ # Sway- and Wayland-related packages
[ noto-fonts redhat-official-fonts overpass ibm-plex rubik archivo font-awesome ] ++ # Fonts [ noto-fonts redhat-official-fonts overpass ibm-plex rubik archivo font-awesome ] ++ # Fonts
# [ papirus-icon-theme ] ++ # Icons # [ papirus-icon-theme ] ++ # Icons
# [ vanilla-dmz ] ++ # Cursor # [ vanilla-dmz ] ++ # Cursor
[ ] ++ # Temp [ ] ++ # Temp
[ ]; [ ];
programs.home-manager.enable = true; programs.home-manager.enable = true;
# Enabling bash from home-manager means environment variables set by HM get set correctly # Enabling bash from home-manager means environment variables set by HM get set correctly
# Worst case, fallback to bash. # Worst case, fallback to bash.
programs.zsh = { programs.zsh = {
@ -72,10 +86,6 @@ in
''; '';
profileExtra = '' profileExtra = ''
export VISUAL=nvim export VISUAL=nvim
# Enable fcitx for sway
#export GTK_IM_MODULE=fcitx
#export QT_IM_MODULE=fcitx
#export XMODIFIERS=@im=fcitx
# If running from tty1 start sway # If running from tty1 start sway
[ "$(tty)" = "/dev/tty1" ] && exec sway [ "$(tty)" = "/dev/tty1" ] && exec sway
''; '';
@ -90,9 +100,9 @@ in
core.editor = "kak"; core.editor = "kak";
}; };
}; };
wayland.windowManager.sway = import ./programs/sway.nix { inherit scripts extra config lib pkgs terminal; }; wayland.windowManager.sway = import ./programs/sway.nix { inherit scripts extra config lib pkgs terminal; };
programs.waybar = import ./programs/waybar.nix { inherit scripts config lib pkgs terminal; }; programs.waybar = import ./programs/waybar.nix { inherit scripts config lib pkgs terminal; };
programs.swaylock = { programs.swaylock = {
@ -111,7 +121,7 @@ in
home.sessionVariables = { home.sessionVariables = {
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
}; };
# configure fonts correctly # configure fonts correctly
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
xdg.configFile."fontconfig/conf.d/20-default.fonts.conf".source = "${extra}/20-default-fonts.conf"; xdg.configFile."fontconfig/conf.d/20-default.fonts.conf".source = "${extra}/20-default-fonts.conf";

View file

@ -1,6 +1,5 @@
{ scripts, extra, config, lib, pkgs, terminal, ... }@inputs: { scripts, extra, config, lib, pkgs, terminal, ... }@inputs:
let let
dynscreenshot = pkgs.writeShellScript "dynscreenshot" (builtins.readFile "${scripts}/dynscreenshot.sh"); dynscreenshot = pkgs.writeShellScript "dynscreenshot" (builtins.readFile "${scripts}/dynscreenshot.sh");
changebrightness = pkgs.writeShellScript "changebrightness" (builtins.readFile "${scripts}/changebrightness.sh"); changebrightness = pkgs.writeShellScript "changebrightness" (builtins.readFile "${scripts}/changebrightness.sh");
@ -18,11 +17,17 @@ in {
style = "Regular"; style = "Regular";
size = 12.0; size = 12.0;
}; };
input."type:touchpad" = { input = {
"type:touchpad" = {
natural_scroll = "disabled"; natural_scroll = "disabled";
dwt = "disabled"; dwt = "disabled";
click_method = "clickfinger"; click_method = "clickfinger";
scroll_factor = "0.5"; scroll_factor = "0.5";
};
"*" = {
xkb_layout = "ca,ca";
xkb_variant = ",eng";
};
}; };
bars = let config = config; in [{ bars = let config = config; in [{
command = "${pkgs.lib.getExe pkgs.waybar}"; command = "${pkgs.lib.getExe pkgs.waybar}";
@ -50,7 +55,7 @@ in {
XF86AudioMedia = "dunstctl set-paused toggle; dunstify -a 'dunst_mute_key' -u low -h string:x-dunst-stack-tag:dunst_mute_key 'Notifications mute toggled'"; XF86AudioMedia = "dunstctl set-paused toggle; dunstify -a 'dunst_mute_key' -u low -h string:x-dunst-stack-tag:dunst_mute_key 'Notifications mute toggled'";
XF86PowerOff = "exec DMENU_COMMAND='${dmenuCommand}' bash ${shutdownMenu}"; XF86PowerOff = "exec DMENU_COMMAND='${dmenuCommand}' bash ${shutdownMenu}";
} // { } // {
"${mod}+space" = "exec fcitx5-remote -t"; "${mod}+space" = "input \"*\" xkb_switch_layout next";
} // { } // {
}); });
menu = "j4-dmenu-desktop --no-generic --term=${pkgs.lib.getExe inputs.terminal} --dmenu='${dmenuCommand}'"; menu = "j4-dmenu-desktop --no-generic --term=${pkgs.lib.getExe inputs.terminal} --dmenu='${dmenuCommand}'";
@ -61,8 +66,8 @@ in {
output 'eDP-1' scale 1.50 output 'eDP-1' scale 1.50
'' + # Fractional scaling to 1.50 '' + # Fractional scaling to 1.50
'' ''
exec fcitx5 exec gammastep-indicator
'' + # Fcitx5 enables input method switching '' + # gammastep-indicator enables red shift
'' ''
exec dunst exec dunst
'' + # Enable notifications '' + # Enable notifications

View file

@ -7,7 +7,7 @@ in
enable = true; enable = true;
settings = [{ settings = [{
modules-left = [ "sway/workspaces" ]; modules-left = [ "sway/workspaces" ];
modules-right = [ "pulseaudio" "bluetooth" "network" "cpu" "memory" "disk" "battery" "tray" "clock" ]; modules-right = [ "pulseaudio" "bluetooth" "network" "cpu" "memory" "disk" "battery" "tray" "sway/language" "clock" ];
"sway/workspaces" = { "sway/workspaces" = {
enable-bar-scroll = true; enable-bar-scroll = true;
disable-scroll-wraparound = true; disable-scroll-wraparound = true;
@ -71,9 +71,15 @@ in
icon-size = 20; icon-size = 20;
spacing = 5; spacing = 5;
}; };
"sway/language" = {
format = "eriuu";
tooltip-format = "boofer";
on-click = "swaymsg input \"*\" xkb_switch_layout next";
};
clock = { clock = {
interval = 1; interval = 1;
format = "{:%H:%M:%S %a %F}"; format = "{:L%H:%M:%S %a %F}";
locale = "fr_CA.utf8"; # TODO fix this; I don't want it to be hardcoded but rather tied to i18n.defaultLocale
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
}; };
}]; }];

View file

@ -1,17 +1,17 @@
case `printf "Cancel\nSuspend\nPower Off\nReboot\nLog Out" | $DMENU_COMMAND` in case `printf "Annuler\nSuspendre\nÉteindre\nRedémarrer\nQuitter" | $DMENU_COMMAND` in
"Cancel") "Annuler")
: :
;; ;;
"Suspend") "Suspendre")
systemctl suspend systemctl suspend
;; ;;
"Power Off") "Éteindre")
systemctl poweroff systemctl poweroff
;; ;;
"Reboot") "Redémarrer")
systemctl reboot systemctl reboot
;; ;;
"Log Out") "Quitter")
swaymsg exit swaymsg exit
;; ;;
esac esac