Did A BUNCH of semantic refactoring.

Added i3blocks config; not active.
This commit is contained in:
vorboyvo 2024-12-04 12:53:29 -05:00
parent dd1bd44945
commit a5349ca647
8 changed files with 569 additions and 450 deletions

View file

@ -1,24 +1,35 @@
{ config, lib, pkgs, ... }: { pkgs, ... }:
let rec {
scripts = ../../scripts;
extra = ../../extra;
terminal = pkgs.alacritty;
in {
imports = [ imports = [
../../snippets/gammastep.nix ../../snippets/defaults.nix
../../snippets/kdeconnect.nix ../../snippets/gammastep.nix
../../snippets/ssh.nix ../../snippets/kdeconnect.nix
../../snippets/zsh.nix ../../snippets/ssh.nix
../../snippets/taskwarrior.nix ../../snippets/zsh.nix
../../snippets/clifm.nix ../../snippets/taskwarrior.nix
../../snippets/git.nix ../../snippets/kakoune.nix
../../snippets/clifm.nix
../../snippets/git.nix
../../snippets/sway.nix
../../snippets/waybar.nix
# ../../snippets/i3blocks.nix
../../snippets/firefox.nix
../../snippets/thunderbird.nix
]; ];
home.username = "alice"; home.username = "alice";
home.homeDirectory = "/home/alice"; home.homeDirectory = "/home/alice";
home.stateVersion = "23.11"; home.stateVersion = "23.11";
# Configure default applications
defaultPrograms = with pkgs; {
terminal = alacritty;
editor = kakoune;
browser = firefox;
mail = thunderbird;
};
# Configure cursor # Configure cursor
home.pointerCursor = { home.pointerCursor = {
package = pkgs.vanilla-dmz; package = pkgs.vanilla-dmz;
@ -78,7 +89,7 @@ in {
] ++ # Basic utilities ] ++ # Basic utilities
[ bitwarden-cli htop snore hledger hledger-ui ] [ bitwarden-cli htop snore hledger hledger-ui ]
++ # Personalized selection of command-line (CLI/TUI) apps ++ # Personalized selection of command-line (CLI/TUI) apps
[ terminal ] ++ # Terminal emulator [ defaultPrograms.terminal ] ++ # Terminal emulator
[ [
evince evince
imv imv
@ -139,13 +150,6 @@ in {
# }; # };
# }; # };
wayland.windowManager.sway = import ../../snippets/sway.nix {
inherit scripts extra config lib pkgs terminal;
};
programs.waybar =
import ../../snippets/waybar.nix { inherit scripts config lib pkgs terminal; };
programs.swaylock = { programs.swaylock = {
enable = true; enable = true;
settings = { font-size = 14; }; settings = { font-size = 14; };
@ -167,14 +171,11 @@ in {
# configure fonts correctly # configure fonts correctly
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
xdg.configFile."fontconfig/conf.d/20-default.fonts.conf".source = xdg.configFile."fontconfig/conf.d/20-default.fonts.conf".source =
"${extra}/20-default-fonts.conf"; ../../extra/20-default-fonts.conf;
# terminal emulator # terminal emulator
programs.alacritty.enable = true; programs.alacritty.enable = true;
programs.kakoune = import ../../snippets/kakoune.nix pkgs;
xdg.configFile."kak-lsp/kak-lsp.toml".source =
../../snippets/kakoune/kak-lsp.toml;
xdg.desktopEntries.kakoune = { xdg.desktopEntries.kakoune = {
name = "Kakoune"; name = "Kakoune";
genericName = "Text Editor"; genericName = "Text Editor";
@ -229,8 +230,4 @@ in {
"-d 3" "-d 3"
]; ];
}; };
programs.firefox = import ../../snippets/firefox.nix { inherit pkgs; };
programs.thunderbird = import ../../snippets/thunderbird.nix;
} }

31
snippets/defaults.nix Normal file
View file

@ -0,0 +1,31 @@
{ lib, pkgs, ... } :
with lib;
{
options.defaultPrograms = {
terminal = mkOption {
type = types.nullOr types.package;
default = null;
description = "Terminal emulator";
example = pkgs.alacritty;
};
editor = mkOption {
type = types.nullOr types.package;
default = null;
description = "Text editor";
example = pkgs.kakoune;
};
browser = mkOption {
type = types.nullOr types.package;
default = null;
description = "Web browser";
example = pkgs.firefox;
};
mail = mkOption {
type = types.nullOr types.package;
default = null;
description = "Email client";
example = pkgs.thunderbird;
};
};
}

View file

@ -1,96 +1,99 @@
{ pkgs }: { { pkgs, ... }:
enable = true; {
profiles = { programs.firefox = {
default = { enable = true;
id = 0; profiles = {
name = "Main Profile"; default = {
isDefault = true; id = 0;
search = { name = "Main Profile";
force = true; isDefault = true;
default = "DuckDuckGo"; search = {
order = [ "DuckDuckGo" "Google" ]; force = true;
engines = { default = "DuckDuckGo";
"Nix Packages" = { order = [ "DuckDuckGo" "Google" ];
urls = [{ engines = {
template = "https://search.nixos.org/packages"; "Nix Packages" = {
params = [ urls = [{
{ template = "https://search.nixos.org/packages";
name = "type"; params = [
value = "packages"; {
} name = "type";
{ value = "packages";
name = "query"; }
value = "{searchTerms}"; {
} name = "query";
]; value = "{searchTerms}";
}]; }
icon = ];
"''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{
name = "type";
value = "options";
}
{
name = "query";
value = "{searchTerms}";
}
];
}];
icon =
"''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"HomeManager Unofficial Options" = {
urls = [{
template = "https://home-manager-options.extranix.com";
params = [{
name = "query";
value = "{searchTerms}";
}]; }];
}]; icon =
icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
"''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ];
definedAliases = [ "@hm" ]; };
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{
name = "type";
value = "options";
}
{
name = "query";
value = "{searchTerms}";
}
];
}];
icon =
"''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"HomeManager Unofficial Options" = {
urls = [{
template = "https://home-manager-options.extranix.com";
params = [{
name = "query";
value = "{searchTerms}";
}];
}];
icon =
"''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" ];
};
"Arch Wiki" = {
urls = [{
template =
"https://wiki.archlinux.org/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://wiki.archlinux.org/favicon.ico";
definedAliases = [ "@aw" ];
};
"GeoGuessr Join" = {
urls =
[{ template = "https://www.geoguessr.com/join/{searchTerms}"; }];
definedAliases = [ "@ggj" ];
};
"Google".metaData.alias =
"@g"; # builtin engines only support specifying one additional alias
}; };
"Arch Wiki" = {
urls = [{
template =
"https://wiki.archlinux.org/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://wiki.archlinux.org/favicon.ico";
definedAliases = [ "@aw" ];
};
"GeoGuessr Join" = {
urls =
[{ template = "https://www.geoguessr.com/join/{searchTerms}"; }];
definedAliases = [ "@ggj" ];
};
"Google".metaData.alias =
"@g"; # builtin engines only support specifying one additional alias
}; };
}; # extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# extensions = with pkgs.nur.repos.rycee.firefox-addons; [ # ublock-origin
# ublock-origin # bitwarden
# bitwarden # multi-account-containers
# multi-account-containers # ];
# ]; settings = {
settings = { "browser.search.region" = "CA";
"browser.search.region" = "CA"; "browser.search.isUS" = false;
"browser.search.isUS" = false; };
}; };
}; };
}; };

45
snippets/i3blocks.nix Normal file
View file

@ -0,0 +1,45 @@
{ pkgs, lib, config, ... }:
rec {
programs.i3blocks = {
enable = true;
bars = {
top = {
# The title block
title = {
interval = "persist";
command = "ls";
};
};
bottom = {
time = {
command = "date +%r";
interval = 1;
};
# Make sure this block comes after the time block
date = lib.hm.dag.entryAfter [ "time" ] {
command = "date +%d";
interval = 5;
};
# And this block after the example block
example = lib.hm.dag.entryAfter [ "date" ] {
command = "echo hi $(date +%s)";
interval = 3;
};
};
};
};
wayland.windowManager.sway.config.bars = [
{
statusCommand = "${pkgs.lib.getExe config.programs.i3blocks.package}"; # -c ${config.xdg.}";
position = "top";
fonts = config.wayland.windowManager.sway.config.fonts;
}
{
statusCommand = "${pkgs.lib.getExe config.programs.i3blocks.package} -c bottom";
position = "bottom";
fonts = config.wayland.windowManager.sway.config.fonts;
}
];
}

View file

@ -1,95 +1,129 @@
{ pkgs, ... }: { { pkgs, ... }:
enable = true; {
defaultEditor = true; programs.kakoune = {
plugins = with pkgs.kakounePlugins; enable = true;
[ kak-fzf byline-kak kakboard auto-pairs-kak ]; defaultEditor = true;
config = { plugins = with pkgs.kakounePlugins;
colorScheme = "tomorrow-night"; [ kak-fzf byline-kak kakboard auto-pairs-kak ];
numberLines = { config = {
enable = true; colorScheme = "tomorrow-night";
highlightCursor = true; numberLines = {
enable = true;
highlightCursor = true;
};
showMatching = true;
tabStop = 2;
indentWidth = 2;
hooks = [
{
name = "WinCreate";
commands = "kakboard-enable";
option = ".*";
}
{
name = "BufCreate";
commands = "set buffer filetype typst";
option = ".*\.typ";
}
{
# When the filetype=latex option is set in a buffer context (automatically), add a new hook to build the latex file on write
name = "BufSetOption";
option = "filetype=latex";
commands = "hook buffer BufWritePost .* %{ texlab-build }";
}
{
name = "BufSetOption";
option = "filetype=typst";
commands = "hook buffer BufWritePost .* %{ nop %sh{ typst compile $kak_buffile } }";
}
{
# When the filetype=markdown option is set (automatically), set word wrap on
name = "WinSetOption";
option = "filetype=markdown";
commands = "set-option window lintcmd \"proselint\"";
}
# {
# name = "BufSetOption";
# option = "filetype=markdown";
# commands = ''
# hook buffer BufWritePost .* %{ %sh{
#
# } };
# '';
# }
];
keyMappings = [
# Define select all
{
key = "a";
mode = "user";
effect = "*%s<ret>";
docstring = "Select all";
}
# Define usermode yank/copy and paste
{
key = "y";
mode = "user";
effect = "<a-|> wl-copy<ret>";
}
{
key = "p";
mode = "user";
effect = "<a-!> wl-paste -n<ret>";
}
{
key = "P";
mode = "user";
effect = "! wl-paste -n<ret>";
}
];
}; };
showMatching = true; extraConfig = ''
tabStop = 2; # highlight trailing whitespace
indentWidth = 2; add-highlighter global/trailing-whitespace regex '\h+$' 0:Error
hooks = [
{ # don't remove trailing indent
name = "WinCreate"; set global disabled_hooks .*-trim-indent
commands = "kakboard-enable"; source ${pkgs.writeText "kakoune-divider.kak" (builtins.readFile ./kakoune/divider.kak)}
option = ".*"; set-option global divider_face LineNumbers
} divider-on 80
{
name = "BufCreate"; # byline enables extending selection with x
commands = "set buffer filetype typst"; require-module byline
option = ".*\.typ";
} eval %sh{kak-lsp --kakoune -s $kak_session}
{ lsp-enable
# When the filetype=latex option is set in a buffer context (automatically), add a new hook to build the latex file on write '';
name = "BufSetOption";
option = "filetype=latex";
commands = "hook buffer BufWritePost .* %{ texlab-build }";
}
{
name = "BufSetOption";
option = "filetype=typst";
commands = "hook buffer BufWritePost .* %{ nop %sh{ typst compile $kak_buffile } }";
}
{
# When the filetype=markdown option is set (automatically), set word wrap on
name = "WinSetOption";
option = "filetype=markdown";
commands = "set-option window lintcmd \"proselint\"";
}
# {
# name = "BufSetOption";
# option = "filetype=markdown";
# commands = ''
# hook buffer BufWritePost .* %{ %sh{
#
# } };
# '';
# }
];
keyMappings = [
# Define select all
{
key = "a";
mode = "user";
effect = "*%s<ret>";
docstring = "Select all";
}
# Define usermode yank/copy and paste
{
key = "y";
mode = "user";
effect = "<a-|> wl-copy<ret>";
}
{
key = "p";
mode = "user";
effect = "<a-!> wl-paste -n<ret>";
}
{
key = "P";
mode = "user";
effect = "! wl-paste -n<ret>";
}
];
}; };
extraConfig = ''
# highlight trailing whitespace
add-highlighter global/trailing-whitespace regex '\h+$' 0:Error
# don't remove trailing indent xdg.configFile."kak-lsp/kak-lsp.toml".source =
set global disabled_hooks .*-trim-indent ./kakoune/kak-lsp.toml;
source ${pkgs.writeText "kakoune-divider.kak" (builtins.readFile ./kakoune/divider.kak)}
set-option global divider_face LineNumbers
divider-on 80
# byline enables extending selection with x xdg.desktopEntries.kakoune = {
require-module byline name = "Kakoune";
genericName = "Text Editor";
eval %sh{kak-lsp --kakoune -s $kak_session} comment = "Edit text files";
lsp-enable icon = "kak";
''; exec = "kak %F";
terminal = true;
mimeType = [
"text/english"
"text/plain"
"text/x-makefile"
"text/x-c++hdr"
"text/x-c++src"
"text/x-chdr"
"text/x-csrc"
"text/x-java"
"text/x-moc"
"text/x-pascal"
"text/x-tcl"
"text/x-tex"
"application/x-shellscript"
"text/x-c"
"text/x-c++"
"text/x-devicetree-source"
];
categories = [ "Utility" "TextEditor" ];
};
} }

View file

@ -1,115 +1,113 @@
{ scripts, extra, config, lib, pkgs, terminal, ... }@inputs: { lib, pkgs, ... }@inputs:
let let
extra = ../extra;
scripts = ../scripts;
dynscreenshot = pkgs.writeShellScript "dynscreenshot" dynscreenshot = pkgs.writeShellScript "dynscreenshot"
(builtins.readFile "${scripts}/dynscreenshot.sh"); (builtins.readFile "${scripts}/dynscreenshot.sh");
changebrightness = pkgs.writeShellScript "changebrightness" changebrightness = pkgs.writeShellScript "changebrightness"
(builtins.readFile "${scripts}/changebrightness.sh"); (builtins.readFile "${scripts}/changebrightness.sh");
mod = config.wayland.windowManager.sway.config.modifier; mod = "Mod4";
dmenuCommand = builtins.readFile "${scripts}/dmenu.sh"; dmenuCommand = builtins.readFile "${scripts}/dmenu.sh";
shutdownMenu = pkgs.writeShellScript "shutdownmenu" shutdownMenu = pkgs.writeShellScript "shutdownmenu"
(builtins.readFile "${scripts}/shutdownmenu.sh"); (builtins.readFile "${scripts}/shutdownmenu.sh");
backgroundImage = "${extra}/kuwaitboat.jpg"; backgroundImage = "${extra}/kuwaitboat.jpg";
in { in {
enable = true; wayland.windowManager.sway = {
config = rec { enable = true;
terminal = "${pkgs.lib.getExe inputs.terminal}"; config = rec {
modifier = "Mod4"; terminal = "${pkgs.lib.getExe inputs.config.defaultPrograms.terminal}";
fonts = { modifier = mod;
names = [ "Red Hat Display" ]; fonts = {
style = "Regular"; names = [ "Red Hat Display" ];
size = 12.0; style = "Regular";
}; size = 12.0;
input = {
"type:touchpad" = {
natural_scroll = "disabled";
dwt = "disabled";
click_method = "clickfinger";
scroll_factor = "0.5";
}; };
"type:keyboard" = { input = {
xkb_layout = "ca,ca"; "type:touchpad" = {
xkb_variant = ",eng"; natural_scroll = "disabled";
dwt = "disabled";
click_method = "clickfinger";
scroll_factor = "0.5";
};
"type:keyboard" = {
xkb_layout = "ca,ca";
xkb_variant = ",eng";
};
}; };
window = {
border = 2;
titlebar = true;
};
keybindings = let
screenshotPath =
"Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png";
in lib.mkOptionDefault ({ # Screenshot keybinds
"Print" =
"exec grim - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of whole screen, save it, and copy it to clipboard
"Shift+Print" = ''
exec swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | grim -g - | wl-copy && wl-paste > ${screenshotPath}''; # Take screenshot of current window, save it, and copy it to clipboard
"Ctrl+Print" =
"exec bash ${dynscreenshot} ${screenshotPath}"; # Take screenshot of selection, save it, and copy it to clipboard
} // rec { # Function Media Keys
XF86MonBrightnessUp = "exec bash ${changebrightness} 1";
XF86MonBrightnessDown = "exec bash ${changebrightness} -1";
XF86AudioMute = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
"${mod}+XF86AudioMute" =
"exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+";
XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-";
"${mod}+XF86AudioRaiseVolume" =
"exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+";
"${mod}+XF86AudioLowerVolume" =
"exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-";
"${mod}+Shift+e" = null;
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}";
"${mod}+Pause" = XF86PowerOff;
} // {
"${mod}+space" = ''input "*" xkb_switch_layout next'';
"${mod}+Shift+l" = "exec swaylock -f";
} // { });
menu = "j4-dmenu-desktop --no-generic --term=${
terminal
} --dmenu='${dmenuCommand}'";
focus.followMouse = false;
}; };
bars = let config = config; extraConfig = ''
in [{ output 'eDP-1' scale 1.50
command = "${pkgs.lib.getExe pkgs.waybar}"; '' + # Fractional scaling to 1.50
position = "top"; ''
inherit fonts; exec gammastep-indicator
}]; '' + # gammastep-indicator enables red shift
window = { ''
border = 2; exec dunst
titlebar = true; '' + # Enable notifications
}; ''
keybindings = let exec "activate-linux -c 0.5-0.5-0.5-0.5"
screenshotPath = '' + # Enable Activate Linux
"Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png"; ''
in lib.mkOptionDefault ({ # Screenshot keybinds bindgesture swipe:4:up focus parent
"Print" = bindgesture swipe:4:left workspace prev
"exec grim - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of whole screen, save it, and copy it to clipboard bindgesture swipe:4:right workspace next
"Shift+Print" = '' bindgesture swipe:3:up focus up
exec swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | grim -g - | wl-copy && wl-paste > ${screenshotPath}''; # Take screenshot of current window, save it, and copy it to clipboard bindgesture swipe:3:down focus down
"Ctrl+Print" = bindgesture swipe:3:left focus left
"exec bash ${dynscreenshot} ${screenshotPath}"; # Take screenshot of selection, save it, and copy it to clipboard bindgesture swipe:3:right focus right
} // rec { # Function Media Keys '' + # Multi-touch touchpad gestures
XF86MonBrightnessUp = "exec bash ${changebrightness} 1"; ''
XF86MonBrightnessDown = "exec bash ${changebrightness} -1"; exec swaybg -i ${backgroundImage}
XF86AudioMute = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; '' + # Background image
"${mod}+XF86AudioMute" = ''
"exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; focus_on_window_activation focus
XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; '' + # Focus on window activation lol
XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; ''
"${mod}+XF86AudioRaiseVolume" = set $laptop eDP-1
"exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+"; bindswitch --reload --locked lid:on output $laptop disable
"${mod}+XF86AudioLowerVolume" = bindswitch --reload --locked lid:off output $laptop enable
"exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-"; '' + # Clamshell mode
"${mod}+Shift+e" = null; "";
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}";
"${mod}+Pause" = XF86PowerOff;
} // {
"${mod}+space" = ''input "*" xkb_switch_layout next'';
"${mod}+Shift+l" = "exec swaylock -f";
} // { });
menu = "j4-dmenu-desktop --no-generic --term=${
pkgs.lib.getExe inputs.terminal
} --dmenu='${dmenuCommand}'";
focus.followMouse = false;
}; };
extraConfig = ''
output 'eDP-1' scale 1.50
'' + # Fractional scaling to 1.50
''
exec gammastep-indicator
'' + # gammastep-indicator enables red shift
''
exec dunst
'' + # Enable notifications
''
exec "activate-linux -c 0.5-0.5-0.5-0.5"
'' + # Enable Activate Linux
''
bindgesture swipe:4:up focus parent
bindgesture swipe:4:left workspace prev
bindgesture swipe:4:right workspace next
bindgesture swipe:3:up focus up
bindgesture swipe:3:down focus down
bindgesture swipe:3:left focus left
bindgesture swipe:3:right focus right
'' + # Multi-touch touchpad gestures
''
exec swaybg -i ${backgroundImage}
'' + # Background image
''
focus_on_window_activation focus
'' + # Focus on window activation lol
''
set $laptop eDP-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
'' + # Clamshell mode
"";
} }

View file

@ -1,4 +1,6 @@
{ { ... }: {
enable = true; programs.thunderbird = {
profiles = { main = { isDefault = true; }; }; enable = true;
profiles = { main = { isDefault = true; }; };
};
} }

View file

@ -1,142 +1,151 @@
{ scripts, config, lib, pkgs, terminal, ... }: { pkgs, config, ... }:
let terminalExec = "${pkgs.lib.getExe terminal} -e"; let terminalExec = "${pkgs.lib.getExe config.defaultPrograms.terminal} -e";
in { in
enable = true; rec {
settings = [{ programs.waybar = {
modules-left = [ "sway/workspaces" ]; enable = true;
modules-right = [ settings = [{
"pulseaudio" modules-left = [ "sway/workspaces" ];
"bluetooth" modules-right = [
"network" "pulseaudio"
"cpu" "bluetooth"
"memory" "network"
"disk" "cpu"
"battery" "memory"
"tray" "disk"
"sway/language" "battery"
"clock" "tray"
]; "sway/language"
"sway/workspaces" = { "clock"
enable-bar-scroll = true; ];
disable-scroll-wraparound = true; "sway/workspaces" = {
smooth-scrolling-threshold = 2.0; enable-bar-scroll = true;
}; disable-scroll-wraparound = true;
pulseaudio = { smooth-scrolling-threshold = 2.0;
format = "{volume}% {icon} {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}";
format-muted = "{volume}% {format_source}";
format-source = "{volume}% ";
format-source-muted = "{volume}% ";
format-icons = [ "" "" ];
on-click = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
on-click-right = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
on-click-middle = "exec pavucontrol";
on-scroll-up = "";
on-scroll-down = "";
};
network = {
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
tooltip-format = "{ifname} via {gwaddr} ";
format-linked = "{ifname} (No IP) ";
format-disconnected = "Disconnected ";
format-alt = "{ifname}: {ipaddr}/{cidr}";
on-click-right = "exec ${terminalExec} nmtui";
};
bluetooth = {
format = " {status}";
format-disabled = ""; # hide module
format-connected = " {num_connections}";
tooltip-format = "{controller_alias} {controller_address}";
tooltip-format-connected = ''
{controller_alias} {controller_address}
{device_enumerate}'';
tooltip-format-enumerate-connected = "{device_alias} {device_address}";
on-click = "exec blueman-manager";
on-click-right = "exec bluetoothctl disconnect";
};
cpu = { format = "{usage}% "; };
memory = { format = "{used:0.1f}GB/{total:0.1f}GB "; };
disk = {
format = "{used} ";
path = "/";
};
battery = {
states = {
good = 95;
warning = 20;
critical = 10;
}; };
format = "{capacity}% {icon}"; pulseaudio = {
format-charging = "{capacity}% "; format = "{volume}% {icon} {format_source}";
format-plugged = "{capacity}% "; format-bluetooth = "{volume}% {icon} {format_source}";
# format-alt = "{time} {icon}"; format-muted = "{volume}% {format_source}";
format-icons = [ "" "" "" "" "" ]; format-source = "{volume}% ";
on-click = ""; format-source-muted = "{volume}% ";
}; format-icons = [ "" "" ];
tray = { on-click = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
icon-size = 20; on-click-right = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
spacing = 5; on-click-middle = "exec pavucontrol";
}; on-scroll-up = "";
"sway/language" = { on-scroll-down = "";
format = "{shortDescription}"; };
tooltip-format = "{long}"; network = {
on-click = ''swaymsg input "*" xkb_switch_layout next''; format-wifi = "{essid} ({signalStrength}%) ";
}; format-ethernet = "{ipaddr}/{cidr} ";
clock = { tooltip-format = "{ifname} via {gwaddr} ";
interval = 1; format-linked = "{ifname} (No IP) ";
format = "<span size='10pt' font='Red Hat Mono'>{:L%H:%M:%S %a %F}</span>"; format-disconnected = "Disconnected ";
locale = format-alt = "{ifname}: {ipaddr}/{cidr}";
"fr_CA.utf8"; # TODO fix this; I don't want it to be hardcoded but rather tied to i18n.defaultLocale on-click-right = "exec ${terminalExec} nmtui";
tooltip-format = '' };
<big>{:L%Y %B}</big> bluetooth = {
<tt><small>{calendar}</small></tt>''; format = " {status}";
}; format-disabled = ""; # hide module
format-connected = " {num_connections}";
tooltip-format = "{controller_alias} {controller_address}";
tooltip-format-connected = ''
{controller_alias} {controller_address}
{device_enumerate}'';
tooltip-format-enumerate-connected = "{device_alias} {device_address}";
on-click = "exec blueman-manager";
on-click-right = "exec bluetoothctl disconnect";
};
cpu = { format = "{usage}% "; };
memory = { format = "{used:0.1f}GB/{total:0.1f}GB "; };
disk = {
format = "{used} ";
path = "/";
};
battery = {
states = {
good = 95;
warning = 20;
critical = 10;
};
format = "{capacity}% {icon}";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
# format-alt = "{time} {icon}";
format-icons = [ "" "" "" "" "" ];
on-click = "";
};
tray = {
icon-size = 20;
spacing = 5;
};
"sway/language" = {
format = "{shortDescription}";
tooltip-format = "{long}";
on-click = ''swaymsg input "*" xkb_switch_layout next'';
};
clock = {
interval = 1;
format = "<span size='10pt' font='Red Hat Mono'>{:L%H:%M:%S %a %F}</span>";
locale =
"fr_CA.utf8"; # TODO fix this; I don't want it to be hardcoded but rather tied to i18n.defaultLocale
tooltip-format = ''
<big>{:L%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
};
}];
style = ''
* {
font-family: FontAwesome, Red Hat Display, sans-serif;
font-size: 12pt;
min-height: 20pt;
}
'' + ''
window#waybar {
background: rgba(34, 34, 34, 1);
color: white;
}
'' + ''
#workspaces button {
padding: 0 3px;
background: rgba(34, 34, 34, 1);
border-style: hidden;
border-radius: 0;
color: white;
}
'' + ''
#workspaces button.focused {
background: rgba(40, 85, 119, 1);
}
.modules-right label,
.modules-right box {
border-left: 1px solid #d3d3d3;
padding-left: 5px;
padding-right: 5px;
}
'' + ''
#battery.warning:not(.charging) {
background: rgba(140, 0, 0, 1);
}
#battery.critical:not(.charging) {
background: #ffffff;
color: black;
}
'' + ''
#language {
min-width: 30px;
}
'' + "";
};
wayland.windowManager.sway.config.bars = [{
command = "${pkgs.lib.getExe config.programs.waybar.package}";
position = "top";
fonts = config.wayland.windowManager.sway.config.fonts;
}]; }];
style = ''
* {
font-family: FontAwesome, Red Hat Display, sans-serif;
font-size: 12pt;
min-height: 20pt;
}
'' + ''
window#waybar {
background: rgba(34, 34, 34, 1);
color: white;
}
'' + ''
#workspaces button {
padding: 0 3px;
background: rgba(34, 34, 34, 1);
border-style: hidden;
border-radius: 0;
color: white;
}
'' + ''
#workspaces button.focused {
background: rgba(40, 85, 119, 1);
}
.modules-right label,
.modules-right box {
border-left: 1px solid #d3d3d3;
padding-left: 5px;
padding-right: 5px;
}
'' + ''
#battery.warning:not(.charging) {
background: rgba(140, 0, 0, 1);
}
#battery.critical:not(.charging) {
background: #ffffff;
color: black;
}
'' + ''
#language {
min-width: 30px;
}
'' + "";
} }