From 5bbf8cc19b5db380c706344840374b51bcb2be97 Mon Sep 17 00:00:00 2001 From: Mx Kookie Date: Fri, 25 Dec 2020 15:48:19 +0100 Subject: [PATCH] libkookie: i3: various updates to fonts, init config, and keybinding --- .../configuration/workstation/i3/tempest.nix | 5 +- .../modules/workstation/ui/i3/core/keys.nix | 5 +- .../modules/workstation/ui/i3/core/setup.nix | 73 +++++++++---------- .../ui/i3/core/tools/i3-scrcap.nix | 6 +- 4 files changed, 44 insertions(+), 45 deletions(-) diff --git a/infra/libkookie/configuration/workstation/i3/tempest.nix b/infra/libkookie/configuration/workstation/i3/tempest.nix index 831e5770ddb..6d52af7aa11 100644 --- a/infra/libkookie/configuration/workstation/i3/tempest.nix +++ b/infra/libkookie/configuration/workstation/i3/tempest.nix @@ -12,11 +12,14 @@ wallpaper = /home/Pictures/Wallpapers/small-memory.webp; # TODO: hook into the "fonts" module? - fonts = [ "Iosevka:12" ]; + fonts = [ "Iosevka Kookie:13" ]; networkmanager = false; term = pkgs.kitty; i3Status.segments = ["ipv6" "disk /" "ethernet _first_" "load" "tztime local"]; }; + + # ??? Why is this required + home.packages = [ pkgs.iosevka ]; } diff --git a/infra/libkookie/modules/workstation/ui/i3/core/keys.nix b/infra/libkookie/modules/workstation/ui/i3/core/keys.nix index 13bb7ee6ed2..89037f9acbf 100644 --- a/infra/libkookie/modules/workstation/ui/i3/core/keys.nix +++ b/infra/libkookie/modules/workstation/ui/i3/core/keys.nix @@ -61,5 +61,8 @@ # Some layout modifiers "${modifier}+3" = "layout default"; "${modifier}+4" = "layout tabbed"; - "${modifier}+5" = "layout stacked"; + "${modifier}+5" = "layout stacked"; + + # Select parent container + "${modifier}+a" = "focus parent"; } diff --git a/infra/libkookie/modules/workstation/ui/i3/core/setup.nix b/infra/libkookie/modules/workstation/ui/i3/core/setup.nix index 76b4b61ac69..1839869cb26 100644 --- a/infra/libkookie/modules/workstation/ui/i3/core/setup.nix +++ b/infra/libkookie/modules/workstation/ui/i3/core/setup.nix @@ -23,48 +23,41 @@ in extraConfig = with pkgs; let - fehCmd = "${feh}/bin/feh --bg-fill ${cfg.wallpaper}"; - picomCmd = ""; - nmCmd = if cfg.networkmanager - then "exec_always --no-startup-id ${networkmanagerapplet}/bin/nm-applet" - else ""; + fehCommand = "${feh}/bin/feh --bg-fill ${cfg.wallpaper}"; in - '' - # Setup compositor // TODO: gate this on the hm-module - exec_always --no-startup-id "${coreutils}/bin/pkill picom; ${picom}/bin/picom --config ~/.config/i3/picom.conf" - - # Make CAPSLOCK into ESC because it's 2018 - # - # Okay actually this is slightly more complicated than that. I'm binding - # CAPSLOCK to HYPER, so that I can use it as a modifier in emacs, but then - # using xcape(1) to also make short CAPSLOCK presses into ESCAPE. - - exec_always --no-startup-id "${xorg.xmodmap}/bin/setxkbmap -layout us -variant altgr-intl -option caps:hyper" - exec ${xcape}/bin/xcape -e "#66=Escape" -t 150 - - # Set the desired wallpaper - exec_always --no-startup-id ${fehCmd} - - # Start nm-applet if networkmanager is enabled - ${nmCmd} - - bar { - status_command ${i3status}/bin/i3status -c ~/.config/i3/i3status.conf - position bottom - bindsym button4 nop - bindsym button5 nop - colors { - background #0F0F0F - statusline #D5D5D5 - } + '' + # Setup compositor + exec_always --no-startup-id "${coreutils}/bin/pkill picom; ${picom}/bin/picom --config ~/.config/i3/picom.conf" + + # Make CAPSLOCK into ESC because it's 2018 + # + # Okay actually this is slightly more complicated than that. I'm binding + # CAPSLOCK to HYPER, so that I can use it as a modifier in emacs, but then + # using xcape(1) to also make short CAPSLOCK presses into ESCAPE. + + exec_always --no-startup-id "${xorg.xmodmap}/bin/setxkbmap -layout us -variant altgr-intl -option caps:hyper" + exec ${xcape}/bin/xcape -e "#66=Escape" -t 150 + + # Always set a wallpaper + exec_always --no-startup-id ${fehCommand} + + bar { + status_command ${i3status}/bin/i3status -c ~/.config/i3/i3status.conf + position bottom + bindsym button4 nop + bindsym button5 nop + colors { + background #0F0F0F + statusline #D5D5D5 } - - focus_follows_mouse no - - # Layout and design settings that should _really_ be in the module - default_border pixel 3 - client.focused #4c7899 #285577 #ffffff #F73E5F #666666 - ''; + } + + focus_follows_mouse no + + # Layout and design settings that should _really_ be in the module + default_border pixel 3 + client.focused #4c7899 #285577 #ffffff #F73E5F #666666 + ''; }; xdg.configFile."i3/picom.conf" = (import ./picom.nix args); diff --git a/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-scrcap.nix b/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-scrcap.nix index 7f23ef651a9..b42f1061c24 100644 --- a/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-scrcap.nix +++ b/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-scrcap.nix @@ -7,10 +7,10 @@ # TODO: this is broken and I don't know why... -{ pkgs, ... }: with pkgs; writeShellScript "libkookie-i3-move" '' +{ pkgs, ... }: with pkgs; writeShellScript "libkookie-i3-scrcap" '' echo "Taking screenshot at $(date)" >> /home/.local/scrcap.log - echo "${scrot}/bin/scrot" >> /home/.local/scrcap.log + echo "${gnome3.gnome-screenshot}/bin/gnome-screenshot" >> /home/.local/scrcap.log - ${scrot}/bin/scrot -D :0 -s >> /home/.local/scrcap.log + ${gnome3.gnome-screenshot}/bin/gnome-screenshot -a >> /home/.local/scrcap.log echo "scrot exit: $?" >> /home/.local/scrcap.log ''