commit 2ca6fed6b9559c649f188026207cccaac8490519
parent 7181b50533511c08c725dddbb2efa1c242ed8636
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 4 Dec 2020 11:56:46 +0100
Add a i3 "temporary" system profile
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
5 files changed, 74 insertions(+), 32 deletions(-)
diff --git a/systems/modules/profiles/default.nix b/systems/modules/profiles/default.nix
@@ -13,6 +13,7 @@
./gnome.nix
./home.nix
./i18n.nix
+ ./i3.nix
./ipfs.nix
./laptop.nix
./mail.nix
diff --git a/systems/modules/profiles/i3.nix b/systems/modules/profiles/i3.nix
@@ -0,0 +1,23 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+ cfg = config.profiles.desktop.i3;
+in
+{
+ options = {
+ profiles.desktop.i3 = {
+ enable = mkEnableOption "Enable i3 desktop profile";
+ };
+ };
+
+ config = mkIf cfg.enable {
+ profiles = {
+ desktop.enable = true;
+ avahi.enable = true;
+ };
+ services = {
+ xserver.enable = true;
+ };
+ };
+}
diff --git a/systems/naruhodo.nix b/systems/naruhodo.nix
@@ -62,7 +62,7 @@ in
services.hardware.bolt.enable = true;
profiles = {
- desktop.gnome.enable = true;
+ desktop.i3.enable = true;
laptop.enable = true;
home = true;
dev.enable = true;
diff --git a/users/vincent/default.nix b/users/vincent/default.nix
@@ -52,6 +52,7 @@ in
++ optionals config.profiles.dev.enable [ (import ./dev) ]
++ optionals config.profiles.desktop.enable [ (import ./desktop) ]
++ optionals config.profiles.desktop.gnome.enable [ (import ./desktop/gnome.nix) ]
+ ++ optionals config.profiles.desktop.i3.enable [ (import ./desktop/i3.nix) ]
++ optionals (config.networking.hostName == "wakasu") [
{
home.packages = with pkgs; [
diff --git a/users/vincent/desktop/i3.nix b/users/vincent/desktop/i3.nix
@@ -2,6 +2,7 @@
with lib;
let
+ # FIXME(change this at some point)
powermenu = pkgs.writeScript "powermenu.sh" ''
#!${pkgs.stdenv.shell}
MENU="$(${pkgs.rofi}/bin/rofi -sep "|" -dmenu -i -p 'System' -location 3 -xoffset -10 -yoffset 32 -width 20 -hide-scrollbar -line-padding 4 -padding 20 -lines 5 <<< "Suspend|Hibernate|Reboot|Shutdown")"
@@ -15,13 +16,36 @@ let
lockCommand = "${pkgs.i3lock-color}/bin/i3lock-color -c 666666";
in
{
+ home.sessionVariables = { WEBKIT_DISABLE_COMPOSITING_MODE = 1; };
home.packages = with pkgs; [
alacritty
arandr
+ # TODO switch to betterlockscreen
i3lock-color
libnotify
maim
slop
+ # Gnome3 relica
+ gnome3.dconf-editor
+ gnome3.pomodoro
+ # FIXME move this elsewhere
+ pop-gtk-theme
+ pop-icon-theme
+ pinentry-gnome
+ # tilix
+
+ aspell
+ aspellDicts.en
+ aspellDicts.fr
+ hunspell
+ hunspellDicts.en_US-large
+ hunspellDicts.en_GB-ize
+ hunspellDicts.fr-any
+ wmctrl
+ xclip
+ xdg-user-dirs
+ xdg_utils
+ xsel
];
programs.rofi.enable = true;
services = {
@@ -182,7 +206,7 @@ in
package = pkgs.i3-gaps;
enable = true;
config = {
- fonts = [ "Fira Code 10" ];
+ fonts = [ "Ubuntu Mono 10" ];
focus = {
followMouse = false;
};
@@ -223,8 +247,8 @@ in
"Mod4+Mod1+46" = "gaps outer current plus 5";
"Mod4+Mod1+47" = "gaps outer current minus 5";
# Split
- "Mod4+43" = "split h";
- "Mod4+55" = "split v";
+ #"Mod4+43" = "split h";
+ #"Mod4+55" = "split v";
# Fullscreen
"Mod4+41" = "fullscreen toggle";
# Change container layout
@@ -246,7 +270,7 @@ in
"Mod4+Shift+114" = "focus output right";
# Custom keybinding
"Mod4+Shift+32" = "exec ${lockCommand}";
- "Mod4+Shift+39" = "exec ~/.screenlayout/home-work.sh && systemctl --user start random-background.service";
+ # "Mod4+Shift+39" = "exec ~/.screenlayout/home-work.sh && systemctl --user start random-background.service";
"Mod4+24" = "border toggle";
};
modes = { };
@@ -261,7 +285,7 @@ in
];
};
extraConfig = ''
- set $mod Mod4
+ set $mod Mod4
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
@@ -301,8 +325,8 @@ in
bindcode $mod+Shift+18 move container to workspace $WS9
bindcode $mod+Shift+19 move container to workspace $WS0
- assign [class="Firefox" window_role="browser"] → $WS1
- assign [class="Google-chrome" window_role="browser"] → $WS1
+ #assign [class="Firefox" window_role="browser"] → $WS1
+ #assign [class="Google-chrome" window_role="browser"] → $WS1
## quick terminal (tmux)
exec --no-startup-id alacritty --title metask --class metask --command tmux
@@ -385,8 +409,25 @@ in
}
bindsym $mod+o mode "resize"
+ # System menu
+ set $sysmenu "system: [s]uspend [l]ock [r]estart [b]lank-screen [p]oweroff reload-[c]onf e[x]it"
+ bindsym $mod+q mode $sysmenu
+ mode $sysmenu {
+ # restart i3 inplace (preserves your layout/session)
+ bindsym s exec ~/.i3/status_scripts/ambisleep; mode "default"
+ bindsym l exec i3lock -c 5a5376; mode "default"
+ bindsym r restart
+ bindsym b exec "xset dpms force off"; mode "default"
+ bindsym p exec systemctl shutdown
+ bindsym c reload; mode "default"
+ bindsym x exit
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+ bindsym $mod+q mode "default"
+ }
'';
};
+ # FIXME switch to polybar ?
xdg.configFile."i3status/config".text = ''
# i3status configuration file.
# see "man i3status" for documentation.
@@ -401,27 +442,11 @@ in
interval = 2
}
- #order += "disk /"
- #order += "run_watch 🐳"
order += "path_exists 🔑"
- #order += "wireless _first_"
- #order += "ethernet _first_"
- #order += "volume master"
order += "battery 0"
order += "load"
order += "tztime local"
- wireless _first_ {
- format_up = "W: (%quality at %essid) %ip"
- format_down = "W: down"
- }
-
- ethernet _first_ {
- # if you use %speed, i3status requires root privileges
- format_up = "E: %ip (%speed)"
- format_down = "E: down"
- }
-
battery 0 {
format = "%status %percentage %remaining"
format_down = "No battery"
@@ -457,13 +482,5 @@ in
disk "/" {
format = "%avail"
}
-
- volume master {
- format = "♪: %volume"
- format_muted = "♪: muted (%volume)"
- device = "default"
- mixer = "Master"
- mixer_idx = 0
- }
'';
}