diff --git a/PC/configuration.nix b/PC/configuration.nix index 7839555..c2f1819 100644 --- a/PC/configuration.nix +++ b/PC/configuration.nix @@ -1,10 +1,14 @@ -{ config, pkgs, options, lib, ... }: -let +{ + config, + pkgs, + options, + lib, + ... +}: let # Set common boot paramaters commonKernelParams = [ # Nvidia settings "nvidia_drm.fbdev=1" - "nouveau.config=NvGspRm=1" # VM/GPU passthrough "amd_iommu=on" @@ -18,12 +22,11 @@ let "pcie_acs_override=downstream,multifunction" "pci=routeirq" ]; -in - -{ +in { # Import other nix files and firmware - imports = let - homeManager = fetchTarball + imports = let + homeManager = + fetchTarball "https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz"; in [ ./hardware-configuration.nix @@ -36,12 +39,18 @@ in config = { allowUnfree = true; packageOverrides = pkgs: { - unstable = import (fetchTarball - "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz" - ){ inherit pkgs; config.allowUnfree = true; }; - nur = import (fetchTarball - "https://github.com/nix-community/NUR/archive/master.tar.gz" - ){ inherit pkgs; }; + unstable = + import ( + fetchTarball + "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz" + ) { + inherit pkgs; + config.allowUnfree = true; + }; + nur = import ( + fetchTarball + "https://github.com/nix-community/NUR/archive/master.tar.gz" + ) {inherit pkgs;}; }; }; @@ -50,8 +59,7 @@ in # MPV scripts (self: super: { mpv = super.mpv.override { - scripts = with self.mpvScripts; - [ mpris sponsorblock thumbnail ]; + scripts = with self.mpvScripts; [mpris sponsorblock thumbnail]; }; }) ]; @@ -59,7 +67,7 @@ in # Allow flakes and enable garbage collection nix = { - settings.experimental-features = [ "nix-command" "flakes" ]; + settings.experimental-features = ["nix-command" "flakes"]; gc = { automatic = true; dates = "weekly"; @@ -71,9 +79,9 @@ in boot = { # Set a kernel version and load/blacklist drivers kernelPackages = pkgs.unstable.linuxPackages_zen; - blacklistedKernelModules = [ "pcspkr" ]; - kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:1f82,10de:10fa" ]; - initrd.kernelModules = [ "vfio" "vfio_pci" "vfio_iommu_type1" ]; + blacklistedKernelModules = ["pcspkr"]; + kernelParams = commonKernelParams ++ ["vfio-pci.ids=10de:1f82,10de:10fa"]; + initrd.kernelModules = ["vfio" "vfio_pci" "vfio_iommu_type1"]; kernel.sysctl."vm.max_map_count" = 2147483642; # Manage supported filesystems @@ -97,7 +105,7 @@ in # Additional entry to boot from the second GPU specialisation = { gputwo.configuration = { - boot.kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:2504,10de:228e" ]; + boot.kernelParams = commonKernelParams ++ ["vfio-pci.ids=10de:2504,10de:228e"]; }; }; @@ -105,7 +113,7 @@ in hardware.enableRedistributableFirmware = true; # Enable video drivers - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { modesetting.enable = true; nvidiaSettings = false; @@ -120,7 +128,11 @@ in enable = true; extraRules = [ # Give wheel root access, allow persistant session - { groups = [ "wheel" ]; keepEnv = true; persist = true; } + { + groups = ["wheel"]; + keepEnv = true; + persist = true; + } ]; }; }; @@ -138,17 +150,24 @@ in users.users.jimbo = { description = "Jimbo Awesome"; isNormalUser = true; - hashedPassword = - "$6$gYpE.pG/zPXgin06$2kydjDfd0K62Dhf9P0PFvJhRNz6xIC/bHYaf/XYqyKcLyZNzPQpy8uy9tCRcSYlj1wwBhzVtTRyItwajOHCEj0"; + hashedPassword = "$6$gYpE.pG/zPXgin06$2kydjDfd0K62Dhf9P0PFvJhRNz6xIC/bHYaf/XYqyKcLyZNzPQpy8uy9tCRcSYlj1wwBhzVtTRyItwajOHCEj0"; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKC8Uqxb09V3msBgDv6lD/nETMYr/X0OgtpDo8ldcMK jimbo@JimDebianServer" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDLe/HioxCOkszFQdm1vb3ZwuzLzsOThqHNvEI4IXeXZ JimPhone" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPeqiMCRXtpoP+BvKBmzvkL7oLKKCmbfdaQIF3yk/S8I jimbo@DV-JHAMPTON-NIXOS" ]; - extraGroups = [ - "wheel" "audio" "video" "input" "disk" - "dialout" "networkmanager" "rtkit" - "kvm" "libvirtd" "qemu-libvirtd" + extraGroups = [ + "wheel" + "audio" + "video" + "input" + "disk" + "dialout" + "networkmanager" + "rtkit" + "kvm" + "libvirtd" + "qemu-libvirtd" ]; uid = 1000; shell = pkgs.zsh; @@ -157,14 +176,19 @@ in # Install programs system-wide environment.systemPackages = with pkgs; [ # Essential system tools - cifs-utils parted git + cifs-utils + parted + git # Printer control system-config-printer # Virtual machines - virt-manager virtiofsd dnsmasq - spice-vdagent looking-glass-client + virt-manager + virtiofsd + dnsmasq + spice-vdagent + looking-glass-client ]; # Disable the HTML documentation link @@ -206,14 +230,14 @@ in ip saddr 10.0.0.2 accept comment "Accept Server Connections" ''; }; - + # Enable nftables over iptables nftables.enable = true; # Set hostnames hosts = { - "10.0.0.2" = [ "server" ]; - "10.0.0.3" = [ "pc" ]; + "10.0.0.2" = ["server"]; + "10.0.0.3" = ["pc"]; }; }; @@ -227,7 +251,7 @@ in }; # Enable lingering for Bluetooth and allow Looking-Glass permissions - systemd.tmpfiles.rules = [ + systemd.tmpfiles.rules = [ "f /var/lib/systemd/linger/jimbo" "f /dev/shm/looking-glass 0660 jimbo libvirtd -" ]; @@ -249,7 +273,7 @@ in destination = "/etc/udev/rules.d/10-pdp.rules"; }; in { - packages = [ oculusRules pdpRules ]; + packages = [oculusRules pdpRules]; }; # Enable audio @@ -271,10 +295,15 @@ in # Fonts fonts = { packages = with pkgs; [ - liberation_ttf twitter-color-emoji ubuntu_font_family noto-fonts sarasa-gothic - orbitron (nerdfonts.override { fonts = [ "UbuntuMono" ]; }) + liberation_ttf + twitter-color-emoji + ubuntu_font_family + noto-fonts + sarasa-gothic + orbitron + (nerdfonts.override {fonts = ["UbuntuMono"];}) ]; - fontconfig.defaultFonts.emoji = [ "Twitter Color Emoji" ]; + fontconfig.defaultFonts.emoji = ["Twitter Color Emoji"]; }; # Enable Dconf and some portals @@ -295,7 +324,7 @@ in }; }; }; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; + extraPortals = with pkgs; [xdg-desktop-portal-gtk]; }; # Configure greetd for remote login @@ -311,11 +340,11 @@ in else : fi - + # Sway/Wayland export XDG_CURRENT_DESKTOP=sway export QT_QPA_PLATFORM="wayland;xcb" - + # Start Sway sway --unsupported-gpu ''; @@ -345,7 +374,7 @@ in services = { printing = { enable = true; - drivers = with pkgs; [ hplip ]; + drivers = with pkgs; [hplip]; webInterface = false; }; avahi = { @@ -364,7 +393,7 @@ in qemu = { ovmf = { enable = true; - packages = [ pkgs.OVMFFull.fd ]; + packages = [pkgs.OVMFFull.fd]; }; swtpm.enable = true; }; @@ -392,8 +421,8 @@ in # Enable AppImages programs.appimage = { - enable = true; - binfmt = true; + enable = true; + binfmt = true; }; # Enable Sunshine as a service diff --git a/PC/hardware-configuration.nix b/PC/hardware-configuration.nix index 8d0b206..6c484a9 100644 --- a/PC/hardware-configuration.nix +++ b/PC/hardware-configuration.nix @@ -1,8 +1,11 @@ -# This file was generated by 'nixos-generate-config' -# and may be overwritten by future invocations. -{ config, lib, pkgs, modulesPath, ... }: - +# This file was generated by 'nixos-generate-config', try not to modify too much { + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -10,11 +13,11 @@ # Load kernel modules on boot boot = { initrd = { - availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - kernelModules = [ ]; + availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; + kernelModules = []; }; - kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; }; # Mount everything as necessary @@ -29,42 +32,42 @@ }; "/etc/libvirt" = { device = "/dev/disk/by-label/Qemu"; - options = [ "nosuid" "nodev" "nofail" ] ; + options = ["nosuid" "nodev" "nofail"]; }; "/var/lib/libvirt" = { - depends = [ "/etc/libvirt" ]; + depends = ["/etc/libvirt"]; device = "/etc/libvirt/varlibvirt"; - options = [ "bind" "rw" ]; + options = ["bind" "rw"]; }; "/mnt/Linux1" = { device = "/dev/disk/by-label/Linux1"; - options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ]; + options = ["nosuid" "nodev" "nofail" "x-gvfs-show"]; }; "/mnt/Linux2" = { device = "/dev/disk/by-label/Linux2"; - options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ]; + options = ["nosuid" "nodev" "nofail" "x-gvfs-show"]; }; "/mnt/Windows1" = { device = "/dev/disk/by-label/Windows1"; - options = [ "nosuid" "nodev" "noauto" ]; + options = ["nosuid" "nodev" "noauto"]; }; "/mnt/Windows2" = { device = "/dev/disk/by-label/Windows2"; - options = [ "nosuid" "nodev" "noauto" ]; + options = ["nosuid" "nodev" "noauto"]; }; "/home/jimbo/JimboNFS" = { device = "server:/export/JimboNFS"; fsType = "nfs4"; - options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + options = ["x-systemd.automount" "_netdev" "nofail" "noauto"]; }; }; # Set the swap partition swapDevices = [ - { device = "/dev/disk/by-uuid/2e4c5120-716d-4cdc-84a0-c9e6391760db"; } + {device = "/dev/disk/by-uuid/2e4c5120-716d-4cdc-84a0-c9e6391760db";} ]; - # Enables DHCP on each ethernet and wireless interface. + # Enables DHCP on each ethernet and wireless interface. networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp42s0.useDHCP = lib.mkDefault true; diff --git a/PC/jimbo.nix b/PC/jimbo.nix index a75e1b5..ac626ff 100644 --- a/PC/jimbo.nix +++ b/PC/jimbo.nix @@ -1,5 +1,9 @@ -{ config, pkgs, options, ... }: -let +{ + config, + pkgs, + options, + ... +}: let # Global color palette primeCol = ''3823C4''; #3823C4 accentCol = ''1B1F59''; #1B1F59 @@ -10,7 +14,7 @@ let lightCol = ''272b33''; #272B33 urgentCol = ''C43823''; #C43823 textCol = ''C7D3E3''; #C7D3E3 - + # Papirus icon theme color folderCol = ''indigo''; @@ -18,10 +22,10 @@ let themeSettings = { name = "Colloid-Dark"; package = pkgs.colloid-gtk-theme.override { - themeVariants = [ "default" ]; - colorVariants = [ "dark" ]; - sizeVariants = [ "standard" ]; - tweaks = [ "black" "rimless" "normal" ]; + themeVariants = ["default"]; + colorVariants = ["dark"]; + sizeVariants = ["standard"]; + tweaks = ["black" "rimless" "normal"]; }; }; @@ -29,28 +33,43 @@ let gitRepo = ''https://git.JimbosFiles.com/Jimbo/NixOS-Config''; # Wallpapers - wallpaper1 = pkgs.fetchurl { + wallpaper1 = pkgs.fetchurl { url = "${gitRepo}/raw/branch/main/Extras/Wallpapers/wallpaper1.png"; sha256 = "1zxb0p0fjsmccy4xv8yk3c4kc313k3lc3xhqmiv452f7sjqqbp25"; }; - wallpaper2 = pkgs.fetchurl { + wallpaper2 = pkgs.fetchurl { url = "${gitRepo}/raw/branch/main/Extras/Wallpapers/wallpaper2.png"; sha256 = "13jcllrs05d26iz2isvh1f8fqf20m23sps32kw7qz5iav8nhvsx7"; }; - wallpaper3 = pkgs.fetchurl { + wallpaper3 = pkgs.fetchurl { url = "${gitRepo}/raw/branch/main/Extras/Wallpapers/wallpaper3.png"; sha256 = "16r65qnr7f0md4bbjnzq6av4dgmqr3avkilw72qdmyrmh3xj03yw"; }; - lockpaper = pkgs.fetchurl { + lockpaper = pkgs.fetchurl { url = "${gitRepo}/raw/branch/main/Extras/Wallpapers/lockpaper.png"; sha256 = "1mqvp4bic46gc994fawkraqj76hxd11wdd43qakligchzd20xjd5"; }; # Define the workspace names - w0 = ''0:0''; w1 = ''1:1''; w2 = ''2:2''; w3 = ''3:3''; w4 = ''4:4''; - w5 = ''5:5''; w6 = ''6:6''; w7 = ''7:7''; w8 = ''8:8''; w9 = ''9:9''; - w1a = ''11:I''; w2a = ''22:II''; w3a = ''33:III''; w4a = ''44:IV''; - w5a = ''55:V''; w6a = ''66:VI''; w7a = ''77:VII''; w8a = ''88:VIII''; w9a = ''99:IX''; + w0 = ''0:0''; + w1 = ''1:1''; + w2 = ''2:2''; + w3 = ''3:3''; + w4 = ''4:4''; + w5 = ''5:5''; + w6 = ''6:6''; + w7 = ''7:7''; + w8 = ''8:8''; + w9 = ''9:9''; + w1a = ''11:I''; + w2a = ''22:II''; + w3a = ''33:III''; + w4a = ''44:IV''; + w5a = ''55:V''; + w6a = ''66:VI''; + w7a = ''77:VII''; + w8a = ''88:VIII''; + w9a = ''99:IX''; # Define the primary monitor display1 = ''DP-3''; @@ -107,14 +126,14 @@ let case $RET in Default) swaymsg reload ;; Wide) swaymsg " - output ${display1} enable pos 1680 0 mode 1680x1050@59.954Hz + output ${display1} enable pos 1680 0 mode 1680x1050@59.954Hz output ${display2} enable pos 0 0 mode 1680x1050@59.954Hz output ${display3} enable pos 3360 0 transform 0 - ";; + ";; GPU2) swaymsg " - output ${display2} enable pos 1680 0 mode 1920x1080@60Hz + output ${display2} enable pos 1680 0 mode 1920x1080@60Hz output ${display3} enable pos 0 0 transform 0 - ";; + ";; esac } @@ -140,7 +159,7 @@ let TEXT='#FFFFFFFF' WRONG='#${splitCol}FF' VERIFYING='#${accentCol}FF' - + ${pkgs.swaylock-effects}/bin/swaylock -f -e \ --key-hl-color=$VERIFYING \ --bs-hl-color=$WRONG \ @@ -171,7 +190,7 @@ let --timestr="%I:%M%p" \ --datestr="%a %b %d %Y" } - + # Handle whether to lock or sleep if [ "$1" == "--sleep" ]; then lockscript & @@ -187,10 +206,10 @@ let makoToggle = pkgs.writeScriptBin "makotoggle" '' # Run makoctl mode and store the output in a variable mode_output=$(makoctl mode) - + # Extract the second line after "default" mode_line=$(echo "$mode_output" | sed -n '/default/{n;p}') - + if [[ "$mode_line" == "do-not-disturb" ]]; then # Notifications are disabled, so we enable them makoctl mode -r do-not-disturb @@ -209,37 +228,37 @@ let handle_swappy() { # Create an imv window to act as a static screen grim -t jpeg - | imv -w "GlobalShot" - & imv_pid=$! - + # Capture the screenshot of the selected area and save to a temporary file selected_area=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"'\ | XCURSOR_SIZE=40 slurp -w ${borderWeight} -c ${primeCol} -B 00000066 -b 00000099) temp_file=$(mktemp -u).png grim -g "$selected_area" "$temp_file" - + # Kill the imv window kill $imv_pid - + # Copy the screenshot to the clipboard swappy -f - < "$temp_file" - + # Clean up the temporary file rm "$temp_file" } - + # Current handle_current() { # Take a screenshot and save it to the temporary file temp_file=$(mktemp -u).png grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') "$temp_file" - + # Check if the screenshot was successfully taken if [ $? -eq 0 ]; then # Copy the screenshot to the clipboard wl-copy < "$temp_file" - + # Show a notification with the screenshot notify-send -i "$temp_file" "Current screen copied." - + # Remove the temporary file rm "$temp_file" else @@ -247,21 +266,21 @@ let notify-send "Error: Unable to capture screenshot." fi } - + # All screens handle_all() { # Take a screenshot and save it to the temporary file temp_file=$(mktemp -u).png grim -t jpeg "$temp_file" - + # Check if the screenshot was successfully taken if [ $? -eq 0 ]; then # Copy the screenshot to the clipboard wl-copy < "$temp_file" - + # Show a notification with the screenshot notify-send -i "$temp_file" "All screen copied." - + # Remove the temporary file rm "$temp_file" else @@ -269,7 +288,7 @@ let notify-send "Error: Unable to capture screenshot." fi } - + # Check for command-line arguments if [ "$1" == "--swappy" ]; then handle_swappy @@ -288,14 +307,14 @@ let BookmarkOpenMethod=current_tab ConfirmDelete=true RecentFilesNumber=0 - + [Desktop] HideItems=false SortColumn=name SortFolderFirst=true SortHiddenLast=false SortOrder=ascending - + [FolderView] Mode=icon ScrollPerPixel=true @@ -308,20 +327,20 @@ let SortFolderFirst=true SortHiddenLast=false SortOrder=descending - + [Places] HiddenPlaces=menu://applications/, network:///, computer:///, /home/jimbo/Desktop - + [System] Archiver=file-roller Terminal=foot - + [Thumbnail] MaxExternalThumbnailFileSize=-1 MaxThumbnailFileSize=4096 ShowThumbnails=true ThumbnailLocalFilesOnly=true - + [Window] AlwaysShowTabs=false PathBarButtons=true @@ -678,7 +697,7 @@ let "compactType": "original", "key": "󰍹 " }, - + { "type": "custom", "format": "\u001b[1m—————————————————————————————————————" @@ -718,7 +737,7 @@ let "text": "date -d @$(stat -c %W /) '+%a %b %d %r %Z %Y'", "key": "󰶡 " }, - + { "type": "custom", "format": "\u001b[1m—————————————————————————————————————" @@ -732,7 +751,7 @@ let ''; # Small Neofetch config - pFetch = let + pFetch = let smallConf = pkgs.writeText "smallconf.jsonc" '' { "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", @@ -771,9 +790,10 @@ let ] } ''; - in pkgs.writeScriptBin "pfetch" + in + pkgs.writeScriptBin "pfetch" ''fastfetch --config ${smallConf}''; - + # Ranger's bookmarks rangerBookmarks = '' # Local files @@ -783,7 +803,7 @@ let L:/home/jimbo/.local D:/mnt n:/etc/nixos - + # Remote files a:/home/jimbo/JimboNFS K:/home/jimbo/JimboNFS/Downloads @@ -825,11 +845,11 @@ let quteFoxCSS = '' --tab-font: '${mainFont}'; --urlbar-font: '${mainFont}'; - + /* try increasing if you encounter problems */ --urlbar-height-setting: 24px; --tab-min-height: 20px !important; - + /* I don't recommend you touch this */ --arrowpanel-menuitem-padding: 2px !important; --arrowpanel-border-radius: 0px !important; @@ -840,22 +860,22 @@ let --toolbar-field-background-color: var(--urlbar-not-focused-bg-color) !important; --toolbar-field-focus-border-color: transparent !important; } - + /* --- General debloat ------------------------------ */ - + /* bottom left page loading status or url preview */ #statuspanel { display: none !important; } - + /* remove radius from right-click popup */ menupopup, panel { --panel-border-radius: 0px !important; } menu, menuitem, menucaption { border-radius: 0px !important; } - + /* no large buttons in right-click menu */ menupopup > #context-navigation { display: none !important; } menupopup > #context-sep-navigation { display: none !important; } - + /* --- Debloat navbar ------------------------------- */ - + #back-button { display: none; } #forward-button { display: none; } #reload-button { display: none; } @@ -865,12 +885,12 @@ let #fxa-toolbar-menu-button { display: none; } /* empty space before and after the url bar */ #customizableui-special-spring1, #customizableui-special-spring2 { display: none; } - + /* --- Style navbar -------------------------------- */ - + /* remove padding between toolbar buttons */ toolbar .toolbarbutton-1 { padding: 0 0 !important; } - + #urlbar-container { --urlbar-container-height: var(--urlbar-height-setting) !important; margin-left: 0 !important; @@ -880,36 +900,36 @@ let font-family: var(--urlbar-font, 'monospace'); font-size: 14px; } - + #urlbar { --urlbar-height: var(--urlbar-height-setting) !important; --urlbar-toolbar-height: var(--urlbar-height-setting) !important; min-height: var(--urlbar-height-setting) !important; border-color: var(--lwt-toolbar-field-border-color, hsla(240,5%,5%,.25)) !important; } - + #urlbar-input { margin-left: 0.8em !important; margin-right: 0.4em !important; } - + #navigator-toolbox { border: none !important; } - + /* keep pop-up menus from overlapping with navbar */ #widget-overflow { margin: 0 !important; } #appmenu-popup { margin: 0 !important; } #customizationui-widget-panel { margin: 0 !important; } #unified-extensions-panel { margin: 0 !important; } - + /* --- Unified extensions button -------------------- */ - + /* make extension icons smaller */ #unified-extensions-view { --uei-icon-size: 18px; } - + /* hide bloat */ .unified-extensions-item-message-deck, #unified-extensions-view > .panel-header, @@ -917,27 +937,27 @@ let #unified-extensions-manage-extensions { display: none !important; } - + /* add 3px padding on the top and the bottom of the box */ .panel-subview-body { padding: 3px 0px !important; } - + #unified-extensions-view .unified-extensions-item-menu-button { margin-inline-end: 0 !important; } - + #unified-extensions-view .toolbarbutton-icon { padding: 0 !important; } - + .unified-extensions-item-contents { line-height: 1 !important; white-space: nowrap !important; } - + /* --- Debloat URL bar ------------------------------- */ - + #identity-box { display: none; } #pageActionButton { display: none; } #pocket-button { display: none; } @@ -946,46 +966,46 @@ let #reader-mode-button{ display: none !important; } #star-button { display: none; } #star-button-box:hover { background: inherit !important; } - + /* Go to arrow button at the end of the urlbar when searching */ #urlbar-go-button { display: none; } - + /* remove container indicator from urlbar */ #userContext-label, #userContext-indicator { display: none !important;} - + /* --- Style tab toolbar ---------------------------- */ - + #titlebar { --proton-tab-block-margin: 0px !important; --tab-block-margin: 0px !important; } - + #TabsToolbar, .tabbrowser-tab { max-height: var(--tab-min-height) !important; font-size: 14px !important; outline: none !important; } - + /* Change color of normal tabs */ tab:not([selected="true"]) { background-color: var(--tab-inactive-bg-color) !important; color: var(--identity-icon-color, var(--tab-inactive-fg-fallback-color)) !important; } - + tab { font-family: var(--tab-font, monospace); border: none !important; } - + /* safari style tab width */ .tabbrowser-tab[fadein] { max-width: 100vw !important; border: none } - + /* Hide close button on tabs */ #tabbrowser-tabs .tabbrowser-tab .tab-close-button { display: none !important; } - + .tabbrowser-tab { /* remove border between tabs */ padding-inline: 0px !important; @@ -994,54 +1014,54 @@ let /* fix pinned tab behaviour on overflow */ overflow-clip-margin: 0px !important; } - + /* Tab: selected colors */ #tabbrowser-tabs .tabbrowser-tab[selected] .tab-content { background: var(--tab-active-bg-color) !important; color: var(--identity-icon-color, var(--tab-active-fg-fallback-color)) !important; } - + /* Tab: hovered colors */ #tabbrowser-tabs .tabbrowser-tab:hover:not([selected]) .tab-content { background: var(--tab-hover-bg-color) !important; } - + /* hide window controls */ .titlebar-buttonbox-container { display: none; } - + /* remove titlebar spacers */ .titlebar-spacer { display: none !important; } - + /* disable tab shadow */ #tabbrowser-tabs:not([noshadowfortests]) .tab-background:is([selected], [multiselected]) { box-shadow: none !important; } - + /* remove dark space between pinned tab and first non-pinned tab */ #tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) > #tabbrowser-arrowscrollbox > .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) { margin-inline-start: 0px !important; } - + /* remove dropdown menu button which displays all tabs on overflow */ #alltabs-button { display: none !important } - + /* fix displaying of pinned tabs on overflow */ #tabbrowser-tabs:not([secondarytext-unsupported]) .tab-label-container { height: var(--tab-min-height) !important; } - + /* remove overflow scroll buttons */ #scrollbutton-up, #scrollbutton-down { display: none !important; } - + /* remove new tab button */ #tabs-newtab-button { display: none !important; } - + /* --- Autohide Navbar ------------------------------ */ - + /* hide navbar unless focused */ #nav-bar { min-height: 0 !important; @@ -1050,7 +1070,7 @@ let --moz-transform: scaleY(0) !important; transform: scaleY(0) !important; } - + /* show on focus */ #nav-bar:focus-within { --moz-transform: scale(1) !important; @@ -1059,12 +1079,12 @@ let height: var(--urlbar-height-setting) !important; min-height: var(--urlbar-height-setting) !important; } - + #navigator-toolbox:focus-within > .browser-toolbar { transform: translateY(0); opacity: 1; } - + /* --- Hide tab bar on single tab ------------------- */ #tabbrowser-tabs .tabbrowser-tab:only-of-type, @@ -1083,65 +1103,114 @@ let overflow: hidden !important; } ''; -in - -{ +in { # Define home manager programs and configs home-manager = { useGlobalPkgs = true; useUserPackages = true; - users.jimbo = { config, pkgs, ... }: { + users.jimbo = { + config, + pkgs, + ... + }: { # Install user programs - home.packages = (with pkgs; [ + home.packages = with pkgs; [ # Useful programs - rofi-bluetooth bemoji imv qbittorrent - libreoffice-fresh easyeffects vesktop - element-desktop ffmpegthumbnailer thunderbird + rofi-bluetooth + bemoji + imv + qbittorrent + libreoffice-fresh + easyeffects + vesktop + element-desktop + ffmpegthumbnailer + thunderbird - # Terminal programs - dua vimv p7zip fastfetch gotop pciutils usbutils - pulsemixer tcptrack mpc-cli protonvpn-cli_2 + # Terminal programs + dua + vimv + p7zip + fastfetch + gotop + pciutils + usbutils + pulsemixer + tcptrack + mpc-cli + protonvpn-cli_2 - # Scripts as global programs - rofiScripts makoToggle swayLock screenShot pFetch + # Scripts as global programs + rofiScripts + makoToggle + swayLock + screenShot + pFetch # Production tools - krita inkscape audacity blender sunvox + krita + inkscape + audacity + blender + sunvox # File manager - pcmanfm-qt gnome.file-roller imagemagick poppler_utils + pcmanfm-qt + gnome.file-roller + imagemagick + poppler_utils # School tools - remmina freerdp globalprotect-openconnect python3 zoom-us + remmina + freerdp + globalprotect-openconnect + python3 + zoom-us # Audio/Video tools - yt-dlp spotdl ani-cli playerctl ffmpeg + yt-dlp + spotdl + ani-cli + playerctl + ffmpeg # Unlimited games - steam steam-run heroic prismlauncher + steam + steam-run + heroic + prismlauncher # Emulators #dolphin-emu cemu ryujinx duckstation pcsx2 unstable.lime3ds - # Remote desktop - #moonlight-qt + # Remote desktop + #moonlight-qt # Window manager apps - swaybg wdisplays wl-clipboard clipman - libnotify bc grim slurp swappy jq lm_sensors - ]); + swaybg + wdisplays + wl-clipboard + clipman + libnotify + bc + grim + slurp + swappy + jq + lm_sensors + ]; # Enable Sway and write some scripts wayland.windowManager.sway = let - # Define certain variables Sway will use + # Define certain variables Sway will use primeMod = "Mod4"; secMod = "Mod1"; - # Define scripts specific to Sway + # Define scripts specific to Sway pinWindow = pkgs.writeScript "pin-window" '' # Get the current border style of the focused window current_style=$(swaymsg -t get_tree | jq -r '.. | select(.focused?).border') - + # Toggle between "normal" (default) and "pixel ${borderWeight}" border styles if [ "$current_style" == "none" ]; then swaymsg "sticky disable, border pixel ${borderWeight}" @@ -1161,7 +1230,7 @@ in notify-send "$(echo -e "Window's app_id: $app_id\nWindow System: $system")" fi } - + # Kill a selected window swaykill() { selected_window=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | slurp -r -c ${primeCol} -B 00000066 -b 00000000) @@ -1170,7 +1239,7 @@ in kill -9 "$pid" fi } - + # Handle which tool we use if [ "$1" == "--prop" ]; then swayprop @@ -1180,73 +1249,73 @@ in ''; in { enable = true; - #package = pkgs.swayfx + package = pkgs.unstable.sway; wrapperFeatures.gtk = true; - checkConfig = false; - config = { - modifier = "${primeMod}"; - startup = [ - # Lock the screen on start, to allow an autostarted session - { command = "swaylock"; } + checkConfig = false; + config = { + modifier = "${primeMod}"; + startup = [ + # Lock the screen on start, to allow an autostarted session + {command = "swaylock";} - # Scratchpads - { command = "foot -a gotop -T Gotop gotop"; } - { command = "foot -a music -T Music ncmpcpp"; } - { command = "foot -a sound -T Sound pulsemixer"; } - { command = "easyeffects"; } + # Scratchpads + {command = "foot -a gotop -T Gotop gotop";} + {command = "foot -a music -T Music ncmpcpp";} + {command = "foot -a sound -T Sound pulsemixer";} + {command = "easyeffects";} - # Daemons and tray apps - { command = "wl-paste -t text --watch clipman store -P"; } - { command = "wl-copy"; } - { command = "mako"; } - { command = "${pkgs.rot8}/bin/rot8"; } + # Daemons and tray apps + {command = "wl-paste -t text --watch clipman store -P";} + {command = "wl-copy";} + {command = "mako";} + {command = "${pkgs.rot8}/bin/rot8";} - # Polkit agent - { command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"; } + # Polkit agent + {command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";} - # Foreground apps - { command = "librewolf -P Misc --name=MiscBrowser"; } - { command = "vesktop --ozone-platform-hint=auto"; } - { command = "element-desktop"; } - { command = "thunderbird"; } - ]; + # Foreground apps + {command = "librewolf -P Misc --name=MiscBrowser";} + {command = "vesktop --ozone-platform-hint=auto";} + {command = "element-desktop";} + {command = "thunderbird";} + ]; - # Use Waybar rather than Sway's - bars = [{ command = "waybar"; }]; + # Use Waybar rather than Sway's + bars = [{command = "waybar";}]; - # Define hardware - output = { + # Define hardware + output = { ${display1} = { pos = "1920 405"; - mode = "1920x1080@143.980Hz"; + mode = "1920x1080@143.980Hz"; max_render_time = "3"; bg = "${wallpaper1} fill"; - scale = "1"; - adaptive_sync = "on"; + scale = "1"; + adaptive_sync = "on"; }; ${display2} = { pos = "0 405"; - mode = "1920x1080@60Hz"; + mode = "1920x1080@60Hz"; max_render_time = "3"; - bg = "${wallpaper2} fill"; + bg = "${wallpaper2} fill"; }; ${display3} = { pos = "3840 0"; - mode = "1680x1050@59.883Hz"; - transform = "270"; + mode = "1680x1050@59.883Hz"; + transform = "270"; max_render_time = "3"; - bg = "${wallpaper3} fill"; + bg = "${wallpaper3} fill"; }; - ${displayTouch} = { - #scale = "1.4"; - }; - "*" = { - bg = "${wallpaper1} fill"; - }; - }; + ${displayTouch} = { + #scale = "1.4"; + }; + "*" = { + bg = "${wallpaper1} fill"; + }; + }; - # Mouse sensitivity, disable acceleration, allow touch while typing - input = { + # Mouse sensitivity, disable acceleration, allow touch while typing + input = { "9610:4103:SINOWEALTH_Game_Mouse" = { pointer_accel = "-0.9"; }; @@ -1254,577 +1323,619 @@ in pointer_accel = "-0.82"; }; "1452:627:bcm5974" = { - scroll_factor = "0.3"; + scroll_factor = "0.3"; }; "*" = { accel_profile = "flat"; - dwt = "disabled"; - natural_scroll = "disabled"; + dwt = "disabled"; + natural_scroll = "disabled"; }; - # Map touchscreen to output - "1386:806:Wacom_ISDv5_326_Finger" = { - map_to_output = "${displayTouch}"; - }; - }; + # Map touchscreen to output + "1386:806:Wacom_ISDv5_326_Finger" = { + map_to_output = "${displayTouch}"; + }; + }; - # Assign workspaces to outputs - workspaceOutputAssign = let - workspaces1 = [ "${w0}" "${w1}" "${w2}" "${w3}" "${w1a}" "${w2a}" "${w3a}" ]; - workspaces2 = [ "${w4}" "${w5}" "${w6}" "${w4a}" "${w5a}" "${w6a}" ]; - workspaces3 = [ "${w7}" "${w8}" "${w9}" "${w7a}" "${w8a}" "${w9a}" ]; - assign = output: workspaces: map (workspace: { inherit workspace; inherit output; }) workspaces; + # Assign workspaces to outputs + workspaceOutputAssign = let + workspaces1 = ["${w0}" "${w1}" "${w2}" "${w3}" "${w1a}" "${w2a}" "${w3a}"]; + workspaces2 = ["${w4}" "${w5}" "${w6}" "${w4a}" "${w5a}" "${w6a}"]; + workspaces3 = ["${w7}" "${w8}" "${w9}" "${w7a}" "${w8a}" "${w9a}"]; + assign = output: workspaces: + map (workspace: { + inherit workspace; + inherit output; + }) + workspaces; in (assign "${display1}" workspaces1) ++ (assign "${display2}" workspaces2) ++ (assign "${display3}" workspaces3); - - # Theming settings - fonts = { - names = [ "${mainFont}" ]; - size = 10.5; - }; - gaps = { - inner = 5; - smartGaps = true; - }; - focus = { - newWindow = "focus"; - }; - colors = { - focused = { - border = "#${primeCol}"; - background = "#${primeCol}"; - text = "#FFFFFF"; - indicator = "#${actSplitCol}"; - childBorder = "#${primeCol}"; - }; - focusedInactive = { - border = "#${accentCol}"; - background = "#${accentCol}"; - text = "#${textCol}"; - indicator = "#${splitCol}"; - childBorder = "#${accentCol}"; - }; - unfocused = { - border = "#${darkCol}"; - background = "#${darkCol}"; - text = "#${textCol}"; - indicator = "#${splitCol}"; - childBorder = "#${splitCol}"; - }; - urgent = { - border = "#${urgentCol}"; - background = "#${urgentCol}"; - text = "#${textCol}"; - indicator = "#${urgentCol}"; - childBorder = "#${urgentCol}"; - }; - }; - # Hotkeys - keybindings = let - resizeAmount = ''55''; - sendNotif = ''notify-send --expire-time=1500''; - in { - ## Launcher keys - - # LibreWolf profiles - "${primeMod}+F1" = ''exec librewolf -P Jimbo --name=JimBrowser | ${sendNotif} "Main Browser"''; - "${primeMod}+F2" = ''exec librewolf -P School --name=SchoolBrowser | ${sendNotif} "School Browser"''; - "${primeMod}+F3" = ''exec librewolf -P Misc --name=MiscBrowser | ${sendNotif} "Miscellaneous Browser"''; - - # Discord - "${primeMod}+F4" = ''exec vesktop --ozone-platform-hint=auto | ${sendNotif} "Discord"''; - - # Games - "${primeMod}+F5" = ''exec steam | ${sendNotif} "Steam"''; - "${primeMod}+F6" = ''exec heroic | ${sendNotif} "Heroic Games"''; - - # Looking glass for VMs - "${primeMod}+F7" = ''exec looking-glass-client input:rawMouse=yes | ${sendNotif} "Looking Glass"''; - - # Virtual Machines - "${primeMod}+F10" = ''exec virt-manager | ${sendNotif} "Virtual Machines"''; - - # BeMenu scripts - "${primeMod}+F11" = ''exec rofiscripts --scratchpads | ${sendNotif} "Scratchpads"''; - "${primeMod}+${secMod}+Ctrl+r" = ''exec rofiscripts --resolutions''; - - # Open NixOS configuration files - "${primeMod}+F12" = ''exec bash -c "foot nvim /etc/nixos/{configuration,jimbo,hardware-configuration}.nix" | ${sendNotif} "Nix Config"''; - - # Terminal, rofi, clipmenu, media script, power menu, show/hide waybar - "${primeMod}+Return" = ''exec foot''; - "${primeMod}+s" = ''exec rofi -show run -p Command''; - "${primeMod}+c" = ''exec clipman pick -t rofi''; - "${primeMod}+x" = ''exec rofiscripts --power''; - "${primeMod}+b" = ''exec pkill -USR1 waybar''; - "${primeMod}+Escape" = ''exec ${swayTools} --kill''; - - # PCManFM, Emoji Picker, Rofi Launcher, Bluetooth, Ranger - "${primeMod}+Shift+t" = ''exec pcmanfm-qt''; - "${primeMod}+Shift+e" = ''exec BEMOJI_PICKER_CMD="rofi -dmenu -i -p Emoji" bemoji -n -P 0''; - "${primeMod}+Shift+s" = ''exec rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history''; - "${primeMod}+Shift+b" = ''exec rofi-bluetooth''; - "${primeMod}+Shift+Return" = ''exec foot ranger''; - - # Swaytools prop, colorpicker, obs-cmd - "${primeMod}+Ctrl+x" = ''exec ${swayTools} --prop''; - "${primeMod}+Ctrl+c" = ''exec ${pkgs.hyprpicker}/bin/hyprpicker -an && ${sendNotif} "Color copied to clipboard"''; - "${primeMod}+Ctrl+Prior" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Main"''; - "${primeMod}+Ctrl+Next" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Guest"''; - - ## Media keys - - # Volume control - "XF86AudioRaiseVolume" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+''; - "XF86AudioLowerVolume" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-''; - - # MPV volume control - "${secMod}+XF86AudioRaiseVolume" = ''exec mpc volume +3''; - "${secMod}+XF86AudioLowerVolume" = ''exec mpc volume -3''; - - # Mute, Stop - "XF86AudioMute" = ''exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle''; - "XF86AudioStop" = ''exec mpc stop''; - - # Play MPD, Firefox, or MPV - "XF86AudioPlay" = ''exec mpc toggle''; - "${secMod}+XF86AudioPlay" = ''exec playerctl --player=librewolf play-pause''; - "Ctrl+XF86AudioPlay" = ''exec playerctl --player=mpv play-pause''; - - # Next/Previous - "XF86AudioNext" = ''exec mpc next''; - "XF86AudioPrev" = ''exec mpc prev''; - - # Seek - "${secMod}+Shift+XF86AudioNext" = ''exec mpc seek +5''; - "${secMod}+Shift+XF86AudioPrev" = ''exec mpc seek -5''; - - ## Notification keys - - # Toggle mako - "${primeMod}+n" = ''exec makotoggle''; - "${primeMod}+Shift+n" = ''exec makoctl restore''; - "${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a''; - - ## Miscellaneous keys - - # Screenshots - "Print" = ''exec screenshot --swappy''; - "${primeMod}+Shift+f" = ''exec screenshot --swappy''; - "Shift+Print" = ''exec screenshot --current''; - "Ctrl+Print" = ''exec screenshot --all''; - - # Server SSH - "${primeMod}+Ctrl+Return" = ''exec foot ssh server -p 2222''; - - # Display Brightness and Keyboard Brightness - "XF86MonBrightnessUp" = ''exec ${pkgs.light}/bin/light -A 5''; - "XF86MonBrightnessDown" = ''exec ${pkgs.light}/bin/light -U 5''; - "Shift+XF86MonBrightnessUp" = ''exec ${pkgs.light}/bin/light -A 1''; - "Shift+XF86MonBrightnessDown" = ''exec ${pkgs.light}/bin/light -U 1''; - "XF86KbdBrightnessUp" = ''exec ${pkgs.light}/bin/light -s sysfs/leds/smc::kbd_backlight -A 5''; - "XF86KbdBrightnessDown" = ''exec ${pkgs.light}/bin/light -s sysfs/leds/smc::kbd_backlight -U 5''; - - ## Window manager keys - "${primeMod}+q" = ''kill''; - "${primeMod}+Shift+r" = ''reload''; - - # Switch to workspaces - "${primeMod}+grave" = ''workspace ${w0}''; - "${primeMod}+1" = ''workspace ${w1}''; - "${primeMod}+2" = ''workspace ${w2}''; - "${primeMod}+3" = ''workspace ${w3}''; - "${primeMod}+4" = ''workspace ${w4}''; - "${primeMod}+5" = ''workspace ${w5}''; - "${primeMod}+6" = ''workspace ${w6}''; - "${primeMod}+7" = ''workspace ${w7}''; - "${primeMod}+8" = ''workspace ${w8}''; - "${primeMod}+9" = ''workspace ${w9}''; - - # Switch to alternate workspaces - "${secMod}+F1" = ''workspace ${w1a}''; - "${secMod}+F2" = ''workspace ${w2a}''; - "${secMod}+F3" = ''workspace ${w3a}''; - "${secMod}+F4" = ''workspace ${w4a}''; - "${secMod}+F5" = ''workspace ${w5a}''; - "${secMod}+F6" = ''workspace ${w6a}''; - "${secMod}+F7" = ''workspace ${w7a}''; - "${secMod}+F8" = ''workspace ${w8a}''; - "${secMod}+F9" = ''workspace ${w9a}''; - - # Move window to and focus new workspace - "${primeMod}+Shift+grave" = ''move container to workspace ${w0}; workspace ${w0}''; - "${primeMod}+Shift+1" = ''move container to workspace ${w1}; workspace ${w1}''; - "${primeMod}+Shift+2" = ''move container to workspace ${w2}; workspace ${w2}''; - "${primeMod}+Shift+3" = ''move container to workspace ${w3}; workspace ${w3}''; - "${primeMod}+Shift+4" = ''move container to workspace ${w4}; workspace ${w4}''; - "${primeMod}+Shift+5" = ''move container to workspace ${w5}; workspace ${w5}''; - "${primeMod}+Shift+6" = ''move container to workspace ${w6}; workspace ${w6}''; - "${primeMod}+Shift+7" = ''move container to workspace ${w7}; workspace ${w7}''; - "${primeMod}+Shift+8" = ''move container to workspace ${w8}; workspace ${w8}''; - "${primeMod}+Shift+9" = ''move container to workspace ${w9}; workspace ${w9}''; - - # Move window to and focus new alternate workspace - "${secMod}+Shift+F1" = ''move container to workspace ${w1a}; workspace ${w1a}''; - "${secMod}+Shift+F2" = ''move container to workspace ${w2a}; workspace ${w2a}''; - "${secMod}+Shift+F3" = ''move container to workspace ${w3a}; workspace ${w3a}''; - "${secMod}+Shift+F4" = ''move container to workspace ${w4a}; workspace ${w4a}''; - "${secMod}+Shift+F5" = ''move container to workspace ${w5a}; workspace ${w5a}''; - "${secMod}+Shift+F6" = ''move container to workspace ${w6a}; workspace ${w6a}''; - "${secMod}+Shift+F7" = ''move container to workspace ${w7a}; workspace ${w7a}''; - "${secMod}+Shift+F8" = ''move container to workspace ${w8a}; workspace ${w8a}''; - "${secMod}+Shift+F9" = ''move container to workspace ${w9a}; workspace ${w9a}''; - - # Change focus across windows - "${primeMod}+Up" = ''focus up''; - "${primeMod}+Down" = ''focus down''; - "${primeMod}+Left" = ''focus left''; - "${primeMod}+Right" = ''focus right''; - - # Switch focus across outputs - "${primeMod}+j" = ''focus output ${display2}''; - "${primeMod}+k" = ''focus output ${display1}''; - "${primeMod}+l" = ''focus output ${display3}''; - - # Move focused window - "${primeMod}+Shift+Up" = ''move up ${resizeAmount} px''; - "${primeMod}+Shift+Down" = ''move down ${resizeAmount} px''; - "${primeMod}+Shift+Left" = ''move left ${resizeAmount} px''; - "${primeMod}+Shift+Right" = ''move right ${resizeAmount} px''; - - # Move window across outputs - "${primeMod}+Shift+j" = ''move output ${display2}; focus output ${display2}''; - "${primeMod}+Shift+k" = ''move output ${display1}; focus output ${display1}''; - "${primeMod}+Shift+l" = ''move output ${display3}; focus output ${display3}''; - - # Change focus between floating/tiled, toggle floating - "${primeMod}+space" = ''focus mode_toggle''; - "${primeMod}+Shift+space" = ''floating toggle''; - - # Allow a window to be visible on all workspaces, toggle border - "${primeMod}+0" = ''exec ${pinWindow}''; - - # Toggle fullscreen - "${primeMod}+f" = ''fullscreen toggle''; - "${primeMod}+${secMod}+Ctrl+f" = ''fullscreen toggle global''; - - # Change container layout - "${primeMod}+w" = ''layout toggle split''; - "${primeMod}+e" = ''layout toggle tabbed stacking''; - - # Change split direction - "${primeMod}+h" = ''split h''; - "${primeMod}+v" = ''split v''; - - # Focus parent / child - "${primeMod}+a" = ''focus parent''; - "${primeMod}+d" = ''focus child''; - - # Resize windows - "${primeMod}+${secMod}+Up" = ''resize grow height ${resizeAmount} px or 5 ppt''; - "${primeMod}+${secMod}+Down" = ''resize shrink height ${resizeAmount} px or 5 ppt''; - "${primeMod}+${secMod}+Left" = ''resize shrink width ${resizeAmount} px or 5 ppt''; - "${primeMod}+${secMod}+Right" = ''resize grow width ${resizeAmount} px or 5 ppt''; - - # Adjust gap size - "${primeMod}+Shift+equal" = ''gaps inner current set 5''; - "${primeMod}+equal" = ''gaps inner current plus 5''; - "${primeMod}+minus" = ''gaps inner current minus 5''; - - # Scratchpads - "Ctrl+Shift+Escape" = ''[app_id="gotop"] scratchpad show, move position center, resize set 1216 888''; - "${primeMod}+Shift+m" = ''[app_id="music"] scratchpad show, move position center, resize set 1006 657''; - "${primeMod}+Shift+v" = ''[app_id="sound"] scratchpad show, move position center, resize set 1000 800''; - "${primeMod}+Shift+Backslash" = ''[app_id="com.github.wwmm.easyeffects"] scratchpad show, move position center, resize set 1000 800''; - }; - window = { - border = borderWeightInt; - titlebar = false; - commands = [ - # Scratchpads - { criteria = { con_mark = "scratchpad"; }; - command = ''floating enable, sticky enable, move scratchpad, mark borderless''; } - { criteria = { app_id = "gotop"; }; - command = ''mark scratchpad''; } - { criteria = { app_id = "music"; }; - command = ''mark scratchpad''; } - { criteria = { app_id = "sound"; }; - command = ''mark scratchpad''; } - { criteria = { app_id = "com.github.wwmm.easyeffects"; }; - command = ''mark scratchpad, opacity 0.9''; } - - # Create a "Scratchpad" for apps I don't want to be seen when launched - { criteria = { con_mark = "hiddenaway"; }; command = ''move scratchpad''; } - - # Give apps that don't have them borders - { criteria = { con_mark = "borderless"; }; command = ''border pixel ${borderWeight}''; } - { criteria = { app_id = "com.github.wwmm.easyeffects"; }; command = ''mark borderless''; } - { criteria = { class = "steam"; }; command = ''mark borderless''; } - { criteria = { app_id = "swappy"; }; command = ''mark borderless''; } - { criteria = { app_id = "virt-manager"; }; command = ''mark borderless''; } - { criteria = { window_role = "pop-up"; }; command = ''mark borderless''; } - - # Floating or fullscreen rules - { criteria = { app_id = "float"; }; command = ''floating enable''; } - { criteria = { title = "^GlobalShot"; }; command = ''floating enable, fullscreen enable global''; } - ]; + # Theming settings + fonts = { + names = ["${mainFont}"]; + size = 10.5; + }; + gaps = { + inner = 5; + smartGaps = true; + }; + focus = { + newWindow = "focus"; + }; + colors = { + focused = { + border = "#${primeCol}"; + background = "#${primeCol}"; + text = "#FFFFFF"; + indicator = "#${actSplitCol}"; + childBorder = "#${primeCol}"; + }; + focusedInactive = { + border = "#${accentCol}"; + background = "#${accentCol}"; + text = "#${textCol}"; + indicator = "#${splitCol}"; + childBorder = "#${accentCol}"; + }; + unfocused = { + border = "#${darkCol}"; + background = "#${darkCol}"; + text = "#${textCol}"; + indicator = "#${splitCol}"; + childBorder = "#${splitCol}"; + }; + urgent = { + border = "#${urgentCol}"; + background = "#${urgentCol}"; + text = "#${textCol}"; + indicator = "#${urgentCol}"; + childBorder = "#${urgentCol}"; + }; }; - assigns = { - # Browsers - "${w1}" = [{ app_id = "JimBrowser"; }]; - "${w1a}" = [{ app_id = "SchoolBrowser"; }]; - - # Communication - "${w3a}" = [{ class = "zoom"; }]; - "${w7}" = [{ app_id = "MiscBrowser"; } { app_id = "vesktop"; }]; - "${w8}" = [{ class = "Element"; }]; - "${w9}" = [{ app_id = "thunderbird"; }]; - # Else - "${w2}" = [{ class = "SDL Application"; } { class = "heroic"; }]; - "${w2a}" = [{ app_id = "looking-glass-client"; }]; - "${w4a}" = [{ app_id = "com.obsproject.Studio"; }]; - }; - }; - extraConfig = '' - # Options I can't find in Nix yet - default_floating_border pixel ${borderWeight} - hide_edge_borders --i3 smart - titlebar_padding 10 1 - primary_selection disabled + # Hotkeys + keybindings = let + resizeAmount = ''55''; + sendNotif = ''notify-send --expire-time=1500''; + in { + ## Launcher keys - # SwayFX specific options - #blur enable - #blur_passes 3 - #blur_radius 5 - #layer_effects 'rofi' blur enable - #layer_effects 'notifications' blur enable; blur_ignore_transparent enable - - # Include extra window icons - include ${pkgs.fetchurl { - url = "https://raw.githubusercontent.com/iguanajuice/sway-font-awesome/6b7a9d08974eea1b9cddb8d444e1c89d6837083a/icons"; - sha256 = "09ki5qw1h91kd33k3fwzq7cb6ck8sq4haswgizrsy387sfr2a75x"; - }} - - # Switch to workspace 1 - workspace ${w7} - workspace ${w1} - ''; + # LibreWolf profiles + "${primeMod}+F1" = ''exec librewolf -P Jimbo --name=JimBrowser | ${sendNotif} "Main Browser"''; + "${primeMod}+F2" = ''exec librewolf -P School --name=SchoolBrowser | ${sendNotif} "School Browser"''; + "${primeMod}+F3" = ''exec librewolf -P Misc --name=MiscBrowser | ${sendNotif} "Miscellaneous Browser"''; + + # Discord + "${primeMod}+F4" = ''exec vesktop --ozone-platform-hint=auto | ${sendNotif} "Discord"''; + + # Games + "${primeMod}+F5" = ''exec steam | ${sendNotif} "Steam"''; + "${primeMod}+F6" = ''exec heroic | ${sendNotif} "Heroic Games"''; + + # Looking glass for VMs + "${primeMod}+F7" = ''exec looking-glass-client input:rawMouse=yes | ${sendNotif} "Looking Glass"''; + + # Virtual Machines + "${primeMod}+F10" = ''exec virt-manager | ${sendNotif} "Virtual Machines"''; + + # BeMenu scripts + "${primeMod}+F11" = ''exec rofiscripts --scratchpads | ${sendNotif} "Scratchpads"''; + "${primeMod}+${secMod}+Ctrl+r" = ''exec rofiscripts --resolutions''; + + # Open NixOS configuration files + "${primeMod}+F12" = ''exec foot ranger /etc/nixos | ${sendNotif} "Nix Config"''; + + # Terminal, rofi, clipmenu, media script, power menu, show/hide waybar + "${primeMod}+Return" = ''exec foot''; + "${primeMod}+s" = ''exec rofi -show run -p Command''; + "${primeMod}+c" = ''exec clipman pick -t rofi''; + "${primeMod}+x" = ''exec rofiscripts --power''; + "${primeMod}+b" = ''exec pkill -USR1 waybar''; + "${primeMod}+Escape" = ''exec ${swayTools} --kill''; + + # PCManFM, Emoji Picker, Rofi Launcher, Bluetooth, Ranger + "${primeMod}+Shift+t" = ''exec pcmanfm-qt''; + "${primeMod}+Shift+e" = ''exec BEMOJI_PICKER_CMD="rofi -dmenu -i -p Emoji" bemoji -n -P 0''; + "${primeMod}+Shift+s" = ''exec rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history''; + "${primeMod}+Shift+b" = ''exec rofi-bluetooth''; + "${primeMod}+Shift+Return" = ''exec foot ranger''; + + # Swaytools prop, colorpicker, obs-cmd + "${primeMod}+Ctrl+x" = ''exec ${swayTools} --prop''; + "${primeMod}+Ctrl+c" = ''exec ${pkgs.hyprpicker}/bin/hyprpicker -an && ${sendNotif} "Color copied to clipboard"''; + "${primeMod}+Ctrl+Prior" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Main"''; + "${primeMod}+Ctrl+Next" = ''exec ${pkgs.obs-cmd}/bin/obs-cmd scene switch "Guest"''; + + ## Media keys + + # Volume control + "XF86AudioRaiseVolume" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+''; + "XF86AudioLowerVolume" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-''; + + # MPV volume control + "${secMod}+XF86AudioRaiseVolume" = ''exec mpc volume +3''; + "${secMod}+XF86AudioLowerVolume" = ''exec mpc volume -3''; + + # Mute, Stop + "XF86AudioMute" = ''exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle''; + "XF86AudioStop" = ''exec mpc stop''; + + # Play MPD, Firefox, or MPV + "XF86AudioPlay" = ''exec mpc toggle''; + "${secMod}+XF86AudioPlay" = ''exec playerctl --player=librewolf play-pause''; + "Ctrl+XF86AudioPlay" = ''exec playerctl --player=mpv play-pause''; + + # Next/Previous + "XF86AudioNext" = ''exec mpc next''; + "XF86AudioPrev" = ''exec mpc prev''; + + # Seek + "${secMod}+Shift+XF86AudioNext" = ''exec mpc seek +5''; + "${secMod}+Shift+XF86AudioPrev" = ''exec mpc seek -5''; + + ## Notification keys + + # Toggle mako + "${primeMod}+n" = ''exec makotoggle''; + "${primeMod}+Shift+n" = ''exec makoctl restore''; + "${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a''; + + ## Miscellaneous keys + + # Screenshots + "Print" = ''exec screenshot --swappy''; + "${primeMod}+Shift+f" = ''exec screenshot --swappy''; + "Shift+Print" = ''exec screenshot --current''; + "Ctrl+Print" = ''exec screenshot --all''; + + # Server SSH + "${primeMod}+Ctrl+Return" = ''exec foot ssh server -p 2222''; + + # Display Brightness and Keyboard Brightness + "XF86MonBrightnessUp" = ''exec ${pkgs.light}/bin/light -A 5''; + "XF86MonBrightnessDown" = ''exec ${pkgs.light}/bin/light -U 5''; + "Shift+XF86MonBrightnessUp" = ''exec ${pkgs.light}/bin/light -A 1''; + "Shift+XF86MonBrightnessDown" = ''exec ${pkgs.light}/bin/light -U 1''; + "XF86KbdBrightnessUp" = ''exec ${pkgs.light}/bin/light -s sysfs/leds/smc::kbd_backlight -A 5''; + "XF86KbdBrightnessDown" = ''exec ${pkgs.light}/bin/light -s sysfs/leds/smc::kbd_backlight -U 5''; + + ## Window manager keys + "${primeMod}+q" = ''kill''; + "${primeMod}+Shift+r" = ''reload''; + + # Switch to workspaces + "${primeMod}+grave" = ''workspace ${w0}''; + "${primeMod}+1" = ''workspace ${w1}''; + "${primeMod}+2" = ''workspace ${w2}''; + "${primeMod}+3" = ''workspace ${w3}''; + "${primeMod}+4" = ''workspace ${w4}''; + "${primeMod}+5" = ''workspace ${w5}''; + "${primeMod}+6" = ''workspace ${w6}''; + "${primeMod}+7" = ''workspace ${w7}''; + "${primeMod}+8" = ''workspace ${w8}''; + "${primeMod}+9" = ''workspace ${w9}''; + + # Switch to alternate workspaces + "${secMod}+F1" = ''workspace ${w1a}''; + "${secMod}+F2" = ''workspace ${w2a}''; + "${secMod}+F3" = ''workspace ${w3a}''; + "${secMod}+F4" = ''workspace ${w4a}''; + "${secMod}+F5" = ''workspace ${w5a}''; + "${secMod}+F6" = ''workspace ${w6a}''; + "${secMod}+F7" = ''workspace ${w7a}''; + "${secMod}+F8" = ''workspace ${w8a}''; + "${secMod}+F9" = ''workspace ${w9a}''; + + # Move window to and focus new workspace + "${primeMod}+Shift+grave" = ''move container to workspace ${w0}; workspace ${w0}''; + "${primeMod}+Shift+1" = ''move container to workspace ${w1}; workspace ${w1}''; + "${primeMod}+Shift+2" = ''move container to workspace ${w2}; workspace ${w2}''; + "${primeMod}+Shift+3" = ''move container to workspace ${w3}; workspace ${w3}''; + "${primeMod}+Shift+4" = ''move container to workspace ${w4}; workspace ${w4}''; + "${primeMod}+Shift+5" = ''move container to workspace ${w5}; workspace ${w5}''; + "${primeMod}+Shift+6" = ''move container to workspace ${w6}; workspace ${w6}''; + "${primeMod}+Shift+7" = ''move container to workspace ${w7}; workspace ${w7}''; + "${primeMod}+Shift+8" = ''move container to workspace ${w8}; workspace ${w8}''; + "${primeMod}+Shift+9" = ''move container to workspace ${w9}; workspace ${w9}''; + + # Move window to and focus new alternate workspace + "${secMod}+Shift+F1" = ''move container to workspace ${w1a}; workspace ${w1a}''; + "${secMod}+Shift+F2" = ''move container to workspace ${w2a}; workspace ${w2a}''; + "${secMod}+Shift+F3" = ''move container to workspace ${w3a}; workspace ${w3a}''; + "${secMod}+Shift+F4" = ''move container to workspace ${w4a}; workspace ${w4a}''; + "${secMod}+Shift+F5" = ''move container to workspace ${w5a}; workspace ${w5a}''; + "${secMod}+Shift+F6" = ''move container to workspace ${w6a}; workspace ${w6a}''; + "${secMod}+Shift+F7" = ''move container to workspace ${w7a}; workspace ${w7a}''; + "${secMod}+Shift+F8" = ''move container to workspace ${w8a}; workspace ${w8a}''; + "${secMod}+Shift+F9" = ''move container to workspace ${w9a}; workspace ${w9a}''; + + # Change focus across windows + "${primeMod}+Up" = ''focus up''; + "${primeMod}+Down" = ''focus down''; + "${primeMod}+Left" = ''focus left''; + "${primeMod}+Right" = ''focus right''; + + # Switch focus across outputs + "${primeMod}+j" = ''focus output ${display2}''; + "${primeMod}+k" = ''focus output ${display1}''; + "${primeMod}+l" = ''focus output ${display3}''; + + # Move focused window + "${primeMod}+Shift+Up" = ''move up ${resizeAmount} px''; + "${primeMod}+Shift+Down" = ''move down ${resizeAmount} px''; + "${primeMod}+Shift+Left" = ''move left ${resizeAmount} px''; + "${primeMod}+Shift+Right" = ''move right ${resizeAmount} px''; + + # Move window across outputs + "${primeMod}+Shift+j" = ''move output ${display2}; focus output ${display2}''; + "${primeMod}+Shift+k" = ''move output ${display1}; focus output ${display1}''; + "${primeMod}+Shift+l" = ''move output ${display3}; focus output ${display3}''; + + # Change focus between floating/tiled, toggle floating + "${primeMod}+space" = ''focus mode_toggle''; + "${primeMod}+Shift+space" = ''floating toggle''; + + # Allow a window to be visible on all workspaces, toggle border + "${primeMod}+0" = ''exec ${pinWindow}''; + + # Toggle fullscreen + "${primeMod}+f" = ''fullscreen toggle''; + "${primeMod}+${secMod}+Ctrl+f" = ''fullscreen toggle global''; + + # Change container layout + "${primeMod}+w" = ''layout toggle split''; + "${primeMod}+e" = ''layout toggle tabbed stacking''; + + # Change split direction + "${primeMod}+h" = ''split h''; + "${primeMod}+v" = ''split v''; + + # Focus parent / child + "${primeMod}+a" = ''focus parent''; + "${primeMod}+d" = ''focus child''; + + # Resize windows + "${primeMod}+${secMod}+Up" = ''resize grow height ${resizeAmount} px or 5 ppt''; + "${primeMod}+${secMod}+Down" = ''resize shrink height ${resizeAmount} px or 5 ppt''; + "${primeMod}+${secMod}+Left" = ''resize shrink width ${resizeAmount} px or 5 ppt''; + "${primeMod}+${secMod}+Right" = ''resize grow width ${resizeAmount} px or 5 ppt''; + + # Adjust gap size + "${primeMod}+Shift+equal" = ''gaps inner current set 5''; + "${primeMod}+equal" = ''gaps inner current plus 5''; + "${primeMod}+minus" = ''gaps inner current minus 5''; + + # Scratchpads + "Ctrl+Shift+Escape" = ''[app_id="gotop"] scratchpad show, move position center, resize set 1216 888''; + "${primeMod}+Shift+m" = ''[app_id="music"] scratchpad show, move position center, resize set 1006 657''; + "${primeMod}+Shift+v" = ''[app_id="sound"] scratchpad show, move position center, resize set 1000 800''; + "${primeMod}+Shift+Backslash" = ''[app_id="com.github.wwmm.easyeffects"] scratchpad show, move position center, resize set 1000 800''; + }; + window = { + border = borderWeightInt; + titlebar = false; + commands = [ + # Scratchpads + { + criteria = {con_mark = "scratchpad";}; + command = ''floating enable, sticky enable, move scratchpad, mark borderless''; + } + { + criteria = {app_id = "gotop";}; + command = ''mark scratchpad''; + } + { + criteria = {app_id = "music";}; + command = ''mark scratchpad''; + } + { + criteria = {app_id = "sound";}; + command = ''mark scratchpad''; + } + { + criteria = {app_id = "com.github.wwmm.easyeffects";}; + command = ''mark scratchpad, opacity 0.9''; + } + + # Create a "Scratchpad" for apps I don't want to be seen when launched + { + criteria = {con_mark = "hiddenaway";}; + command = ''move scratchpad''; + } + + # Give apps that don't have them borders + { + criteria = {con_mark = "borderless";}; + command = ''border pixel ${borderWeight}''; + } + { + criteria = {app_id = "com.github.wwmm.easyeffects";}; + command = ''mark borderless''; + } + { + criteria = {class = "steam";}; + command = ''mark borderless''; + } + { + criteria = {app_id = "swappy";}; + command = ''mark borderless''; + } + { + criteria = {app_id = "virt-manager";}; + command = ''mark borderless''; + } + { + criteria = {window_role = "pop-up";}; + command = ''mark borderless''; + } + + # Floating or fullscreen rules + { + criteria = {app_id = "float";}; + command = ''floating enable''; + } + { + criteria = {title = "^GlobalShot";}; + command = ''floating enable, fullscreen enable global''; + } + ]; + }; + assigns = { + # Browsers + "${w1}" = [{app_id = "JimBrowser";}]; + "${w1a}" = [{app_id = "SchoolBrowser";}]; + + # Communication + "${w3a}" = [{class = "zoom";}]; + "${w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";}]; + "${w8}" = [{class = "Element";}]; + "${w9}" = [{app_id = "thunderbird";}]; + + # Else + "${w2}" = [{class = "SDL Application";} {class = "heroic";}]; + "${w2a}" = [{app_id = "looking-glass-client";}]; + "${w4a}" = [{app_id = "com.obsproject.Studio";}]; + }; + }; + extraConfig = '' + # Options I can't find in Nix yet + default_floating_border pixel ${borderWeight} + hide_edge_borders --i3 smart + titlebar_padding 10 1 + primary_selection disabled + + # SwayFX specific options + #blur enable + #blur_passes 3 + #blur_radius 5 + #layer_effects 'rofi' blur enable + #layer_effects 'notifications' blur enable; blur_ignore_transparent enable + + # Include extra window icons + include ${pkgs.fetchurl { + url = "https://raw.githubusercontent.com/iguanajuice/sway-font-awesome/6b7a9d08974eea1b9cddb8d444e1c89d6837083a/icons"; + sha256 = "09ki5qw1h91kd33k3fwzq7cb6ck8sq4haswgizrsy387sfr2a75x"; + }} + + # Switch to workspace 1 + workspace ${w7} + workspace ${w1} + ''; }; # Define Waybar programs.waybar = let # Sway workspaces swayWorkspacesModule = { - format = "{name}"; + format = "{name}"; enable-bar-scroll = true; warp-on-scroll = false; disable-scroll-wraparound = true; }; - # Sway windows - swayWindowsModule = { - icon = true; - icon-size = 15; - all-outputs = true; - tooltip = false; - rewrite = { - "(.*) — LibreWolf" = " $1"; - "LibreWolf" = " Firefox"; - "(.*) - LibreWolf — Firefox" = "󰗃 $1"; - }; - }; + # Sway windows + swayWindowsModule = { + icon = true; + icon-size = 15; + all-outputs = true; + tooltip = false; + rewrite = { + "(.*) — LibreWolf" = " $1"; + "LibreWolf" = " Firefox"; + "(.*) - LibreWolf — Firefox" = "󰗃 $1"; + }; + }; - # Pipewire/Pulseaudio - pulseModule = { - format = "{icon} {volume}%"; - format-bluetooth = "{icon} {volume}%"; - format-muted = " muted"; - format-icons = { - headphone = "󰋋 "; - headset = "󰋋 "; - default = [ " " " " ]; - }; - on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - on-click-middle = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%"; - on-click-right = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 60%"; - ignored-sinks = [ "Easy Effects Sink" "USB FS AUDIO Analog Stereo" ]; - }; + # Pipewire/Pulseaudio + pulseModule = { + format = "{icon} {volume}%"; + format-bluetooth = "{icon} {volume}%"; + format-muted = " muted"; + format-icons = { + headphone = "󰋋 "; + headset = "󰋋 "; + default = [" " " "]; + }; + on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + on-click-middle = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%"; + on-click-right = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 60%"; + ignored-sinks = ["Easy Effects Sink" "USB FS AUDIO Analog Stereo"]; + }; - # CPU, Ram and Vram - cpuModule = { - format = " {usage}%"; - interval = 3; - }; - ramModule = { - format = " {used}G"; - tooltip = false; - }; - vramModule = { - exec = pkgs.writeScript "vramScript" '' - # Don't run the script if running on integrated graphics - if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null || lspci -k | grep "Kernel driver in use: amdgpu" &> /dev/null; then - - # Run the nvidia-smi command and capture the VRAM usage and GPU utilization output - if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then - vram_usage_mb=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits) - temperature=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits) + # CPU, Ram and Vram + cpuModule = { + format = " {usage}%"; + interval = 3; + }; + ramModule = { + format = " {used}G"; + tooltip = false; + }; + vramModule = { + exec = pkgs.writeScript "vramScript" '' + # Don't run the script if running on integrated graphics + if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null || lspci -k | grep "Kernel driver in use: amdgpu" &> /dev/null; then - # Check the drm memory if an AMD GPU is present - elif lspci -k | grep "Kernel driver in use: amdgpu" &> /dev/null; then - vram_usage_mb=$(echo "$(cat /sys/class/drm/card0/device/mem_info_vram_used || cat /sys/class/drm/card1/device/mem_info_vram_used) / 1024 / 1024" | bc) - temperature=$(sensors | grep 'edge' | awk '{print $2}' | sed 's/[^0-9.-]//g') - fi - - # Check if VRAM usage is under 1GB - if [ $vram_usage_mb -lt 1024 ]; then - vram_usage_display="$(echo $vram_usage_mb)M" - else - # Convert MB to GiB - vram_usage_gib=$(bc <<< "scale=2; $vram_usage_mb / 1024") - vram_usage_display="$(echo $vram_usage_gib)G" - fi - - # Print the VRAM usage in MB or GiB, and include GPU utilization and temperature - echo "{\"text\":\"󰢮 $(echo $vram_usage_display)\",\"tooltip\":\"$(echo $temperature)°C\"}" - else - : - fi - ''; - format = "{}"; - return-type = "json"; - interval = 3; - }; + # Run the nvidia-smi command and capture the VRAM usage and GPU utilization output + if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then + vram_usage_mb=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits) + temperature=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits) - # Clocks - longClockModule = { - exec = pkgs.writeScript "longClock" '' + # Check the drm memory if an AMD GPU is present + elif lspci -k | grep "Kernel driver in use: amdgpu" &> /dev/null; then + vram_usage_mb=$(echo "$(cat /sys/class/drm/card0/device/mem_info_vram_used || cat /sys/class/drm/card1/device/mem_info_vram_used) / 1024 / 1024" | bc) + temperature=$(sensors | grep 'edge' | awk '{print $2}' | sed 's/[^0-9.-]//g') + fi + + # Check if VRAM usage is under 1GB + if [ $vram_usage_mb -lt 1024 ]; then + vram_usage_display="$(echo $vram_usage_mb)M" + else + # Convert MB to GiB + vram_usage_gib=$(bc <<< "scale=2; $vram_usage_mb / 1024") + vram_usage_display="$(echo $vram_usage_gib)G" + fi + + # Print the VRAM usage in MB or GiB, and include GPU utilization and temperature + echo "{\"text\":\"󰢮 $(echo $vram_usage_display)\",\"tooltip\":\"$(echo $temperature)°C\"}" + else + : + fi + ''; + format = "{}"; + return-type = "json"; + interval = 3; + }; + + # Clocks + longClockModule = { + exec = pkgs.writeScript "longClock" '' # Long clock format, with a numeric date and military time tooltip time=$(date +'%a %b %d %l:%M:%S%p' | tr -s ' ') date=$(date "+%Y-%m-%d") echo "{\"text\":\" $time\",\"tooltip\":\"$date\"}" - ''; - on-click = ''wl-copy $(date "+%Y-%m-%d-%H%M%S"); notify-send "Date copied."''; - format = "{}"; - return-type = "json"; - interval = 1; - tooltip = true; - }; - shortClockModule = { - exec = "echo ' '$(date +'%l:%M%p' | sed 's/^ //')"; - on-click = ''wl-copy $(date "+%Y-%m-%d-%H%M%S"); notify-send "Date copied."''; - interval = 60; - tooltip = false; - }; - - # Tray, gamemode, bluetooth, and network tray modules - trayModule = { - spacing = 5; - }; - networkModule = { - format-ethernet = "󰈀"; - format-wifi = ""; - format-disconnected = "󰖪"; - format-linked = ""; - tooltip-format-ethernet = "{ipaddr}\n{ifname} "; - tooltip-format-wifi = "{ipaddr}\n{essid} ({signalStrength}%)"; - tooltip-format-disconnected = "Disconnected"; - }; - bluetoothModule = { - format = ""; - format-disabled = ""; - format-no-controller = ""; - tooltip-format-on = "No devices connected."; - tooltip-format-connected = "{num_connections} connected\n{device_enumerate}"; - tooltip-format-enumerate-connected = "{device_alias}"; - tooltip-format-enumerate-connected-battery = "{device_alias} {device_battery_percentage}%"; - on-click = "rofi-bluetooth"; - }; - scratchpadModule = { - format = " {count}"; - show-empty = false; - tooltip = true; - tooltip-format = "{title}"; - }; - gamemodeModule = { - format = "{glyph}"; - glyph = "󰖺"; - hide-not-running = true; - use-icon = true; - icon-spacing = 3; - icon-size = 19; - tooltip = true; - tooltip-format = "Gamemode On"; - }; - - # Special per-bar modules - mediaModule = { - exec-if = "mpc status | grep -q '^\\[playing\\] \\|^\\[paused\\]'"; - exec = pkgs.writeScript "mpvMetadata" '' - get_metadata() { - mpc --format "%file%" | head -n 1 | sed -E 's/\.(mp3|mp4|m4a|mov|flac|opus|oga)$//; s/&/&/g' - } - - truncate_string() { - local str="$1" - local max_length=30 - if [ $(expr length "$str") -gt $max_length ]; then - str=$(expr substr "$str" 1 $max_length)... - fi - echo "$str" - } - - if mpc status 2>/dev/null | grep -q playing; then - song_name=$(get_metadata | awk -F ' - ' '{print $2}') - if [ -z "$song_name" ]; then - song_name=$(get_metadata) - fi - echo "{\"text\":\"$(truncate_string " $song_name")\",\"tooltip\":\"$(get_metadata)\"}" - elif mpc status 2>/dev/null | grep -q paused; then - artist_name=$(get_metadata | awk -F ' - ' '{print $1}') - if [ -z "$artist_name" ]; then - artist_name=$(get_metadata) - fi - echo "{\"text\":\"$(truncate_string " $artist_name")\",\"tooltip\":\"$(get_metadata)\",\"class\":\"paused\"}" - fi ''; - format = "{}"; - return-type = "json"; - interval = 2; - max-length = 30; - on-click = "mpc toggle"; - }; - notificationModule = { - exec = pkgs.writeScript "notificationScript" '' + on-click = ''wl-copy $(date "+%Y-%m-%d-%H%M%S"); notify-send "Date copied."''; + format = "{}"; + return-type = "json"; + interval = 1; + tooltip = true; + }; + shortClockModule = { + exec = "echo ' '$(date +'%l:%M%p' | sed 's/^ //')"; + on-click = ''wl-copy $(date "+%Y-%m-%d-%H%M%S"); notify-send "Date copied."''; + interval = 60; + tooltip = false; + }; + + # Tray, gamemode, bluetooth, and network tray modules + trayModule = { + spacing = 5; + }; + networkModule = { + format-ethernet = "󰈀"; + format-wifi = ""; + format-disconnected = "󰖪"; + format-linked = ""; + tooltip-format-ethernet = "{ipaddr}\n{ifname} "; + tooltip-format-wifi = "{ipaddr}\n{essid} ({signalStrength}%)"; + tooltip-format-disconnected = "Disconnected"; + }; + bluetoothModule = { + format = ""; + format-disabled = ""; + format-no-controller = ""; + tooltip-format-on = "No devices connected."; + tooltip-format-connected = "{num_connections} connected\n{device_enumerate}"; + tooltip-format-enumerate-connected = "{device_alias}"; + tooltip-format-enumerate-connected-battery = "{device_alias} {device_battery_percentage}%"; + on-click = "rofi-bluetooth"; + }; + scratchpadModule = { + format = " {count}"; + show-empty = false; + tooltip = true; + tooltip-format = "{title}"; + }; + gamemodeModule = { + format = "{glyph}"; + glyph = "󰖺"; + hide-not-running = true; + use-icon = true; + icon-spacing = 3; + icon-size = 19; + tooltip = true; + tooltip-format = "Gamemode On"; + }; + + # Special per-bar modules + mediaModule = { + exec-if = "mpc status | grep -q '^\\[playing\\] \\|^\\[paused\\]'"; + exec = pkgs.writeScript "mpvMetadata" '' + get_metadata() { + mpc --format "%file%" | head -n 1 | sed -E 's/\.(mp3|mp4|m4a|mov|flac|opus|oga)$//; s/&/&/g' + } + + truncate_string() { + local str="$1" + local max_length=30 + if [ $(expr length "$str") -gt $max_length ]; then + str=$(expr substr "$str" 1 $max_length)... + fi + echo "$str" + } + + if mpc status 2>/dev/null | grep -q playing; then + song_name=$(get_metadata | awk -F ' - ' '{print $2}') + if [ -z "$song_name" ]; then + song_name=$(get_metadata) + fi + echo "{\"text\":\"$(truncate_string " $song_name")\",\"tooltip\":\"$(get_metadata)\"}" + elif mpc status 2>/dev/null | grep -q paused; then + artist_name=$(get_metadata | awk -F ' - ' '{print $1}') + if [ -z "$artist_name" ]; then + artist_name=$(get_metadata) + fi + echo "{\"text\":\"$(truncate_string " $artist_name")\",\"tooltip\":\"$(get_metadata)\",\"class\":\"paused\"}" + fi + ''; + format = "{}"; + return-type = "json"; + interval = 2; + max-length = 30; + on-click = "mpc toggle"; + }; + notificationModule = { + exec = pkgs.writeScript "notificationScript" '' # Run makoctl mode and store the output in a variable mode_output=$(makoctl mode) - + # Extract the second line after "default" mode_line=$(echo "$mode_output" | sed -n '/default/{n;p}') - + # Print the notification status with the tooltip if [[ "$mode_line" == "do-not-disturb" ]]; then printf '{"text":"󱆥 Off","class":"disabled","tooltip":"Notifications Disabled."}' else printf '{"text":" On","tooltip":"Notifications Enabled."}'; fi - ''; - format = "{}"; - return-type = "json"; - interval = 2; - on-click = "makotoggle"; - }; - weatherModule = { - exec = pkgs.writeScript "weatherScript" '' + ''; + format = "{}"; + return-type = "json"; + interval = 2; + on-click = "makotoggle"; + }; + weatherModule = { + exec = pkgs.writeScript "weatherScript" '' # Define variables CITY="Maple" API_KEY="18be8db3528f08c33ed9f95698335ea7" - + # Fetch weather data weather_data=$(curl -s "http://api.openweathermap.org/data/2.5/weather?q=$CITY&appid=$API_KEY") weather_condition=$(echo $weather_data | jq -r '.weather[0].main') - + # Map weather conditions to emojis case "$weather_condition" in "Clear") emoji="☀️";; @@ -1836,262 +1947,293 @@ in "Mist"|"Fog"|"Haze") emoji="🌫️";; *) emoji="🌍";; # Default emoji for unknown esac - + # Extract and format temperature in Celsius temperature_kelvin=$(echo $weather_data | jq -r '.main.temp') temperature_celsius=$(echo "$temperature_kelvin - 273.15" | bc) formatted_temperature=$(printf "%.0f" $temperature_celsius) - + # Display weather emoji and temperature echo {\"text\":\"$emoji $formatted_temperature°C\",\"tooltip\":\"Weather in $CITY: $weather_condition\"} - ''; - format = "{}"; - return-type = "json"; - on-click = "xdg-open https://openweathermap.org/city/6173577 | notify-send 'Opening weather'"; - interval = 150; - }; + ''; + format = "{}"; + return-type = "json"; + on-click = "xdg-open https://openweathermap.org/city/6173577 | notify-send 'Opening weather'"; + interval = 150; + }; - # Laptop modules - backlightModule = { - format = "{icon} {percent}%"; - format-icons = ["" "󰖨"]; - tooltip = false; - }; - batteryModule = { - interval = 60; - states = { - warning = 30; - critical = 15; - }; - format = "{icon} {capacity}%"; - format-icons = ["" "" "" "" ""]; - }; + # Laptop modules + backlightModule = { + format = "{icon} {percent}%"; + format-icons = ["" "󰖨"]; + tooltip = false; + }; + batteryModule = { + interval = 60; + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-icons = ["" "" "" "" ""]; + }; in { enable = true; - settings = { - display1 = { - name = "bar1"; - position = "top"; - layer = "bottom"; - output = [ display1 "VGA-1" ]; - modules-left = [ "sway/workspaces" "sway/window" ]; - modules-right = [ - "pulseaudio" "cpu" "memory" "custom/vram" "custom/clock-long" - "gamemode" "sway/scratchpad" "tray" "bluetooth" "network" - ]; - "sway/workspaces" = swayWorkspacesModule; - "sway/window" = swayWindowsModule; - "pulseaudio" = pulseModule; - "cpu" = cpuModule; - "memory" = ramModule; - "custom/vram" = vramModule; - "custom/clock-long" = longClockModule; - "gamemode" = gamemodeModule; - "sway/scratchpad" = scratchpadModule; - "tray" = trayModule; - "bluetooth" = bluetoothModule; - "network" = networkModule // { interface = "enp*"; }; - }; - display2 = { - name = "bar2"; - position = "top"; - layer = "bottom"; - output = [ display2 ]; - modules-left = [ "sway/workspaces" "sway/window" ]; - modules-right = [ - "pulseaudio" "custom/media" "custom/notifs" "cpu" - "memory" "custom/vram" "custom/clock-long" - ]; - "sway/workspaces" = swayWorkspacesModule; - "sway/window" = swayWindowsModule; - "pulseaudio" = pulseModule; - "custom/media" = mediaModule; - "custom/notifs" = notificationModule; - "cpu" = cpuModule; - "memory" = ramModule; - "custom/vram" = vramModule; - "custom/clock-long" = longClockModule; - }; - display3 = { - name = "bar3"; - position = "top"; - layer = "bottom"; - output = [ display3 ]; - modules-left = [ "sway/workspaces" "sway/window" ]; - modules-right = [ - "pulseaudio" "custom/weather" "cpu" "memory" "custom/vram" "custom/clock-short" - ]; - "sway/workspaces" = swayWorkspacesModule; - "sway/window" = swayWindowsModule; - "pulseaudio" = pulseModule; - "custom/weather" = weatherModule; - "cpu" = cpuModule; - "memory" = ramModule; - "custom/vram" = vramModule; - "custom/clock-short" = shortClockModule; - }; - displayLap = { - name = "laptop"; - position = "top"; - layer = "bottom"; - output = [ "eDP-1" "LVDS-1" "DSI-1" "HDMI-A-1" ]; - modules-left = [ "sway/workspaces" "sway/window" ]; - modules-right = [ - "pulseaudio" "custom/media" "custom/notifs" "custom/weather2" "cpu" "memory" "custom/vram" "backlight" - "battery" "custom/clock-long" "gamemode" "sway/scratchpad" "tray" "bluetooth" "network" - ]; - "sway/workspaces" = swayWorkspacesModule; - "sway/window" = swayWindowsModule; - "pulseaudio" = pulseModule; - "custom/media" = mediaModule; - "custom/notifs" = notificationModule; - "custom/weather2" = weatherModule; - "cpu" = cpuModule; - "memory" = ramModule; - "custom/vram" = vramModule; - "backlight" = backlightModule; - "battery" = batteryModule; - "custom/clock-long" = longClockModule; - "sway/scratchpad" = scratchpadModule; - "tray" = trayModule; - "bluetooth" = bluetoothModule; - "network" = networkModule; - }; - }; - style = '' - * { - border: 0; - border-radius: 0; - min-height: 0; - font-family: ${mainFont}, ${nerdFont}; - font-size: 15.5px; - color: #${textCol}; - } - #waybar { - background: #${darkCol}; - } - #workspaces { - padding: 0 6px 0 0; - } - #tray { - padding: 0 2px 0 5px; - } - #network { - padding: 0 10px 0 4px; - } - #network.disconnected,#bluetooth.off { - color: #424242; - } - #bluetooth { - margin: 0 6px 0 4px; - font-size: 13.4px; - } - #workspaces button { - padding: 0 3px; - color: white; - border-bottom: 3px solid transparent; - min-width: 20px; - } - #workspaces button.visible { - border-bottom: 3px solid #${primeCol}; - background: #${midCol}; - } - #workspaces button.urgent { - border-bottom: 3px solid #${urgentCol}; - } - #workspaces button:hover { - box-shadow: none; - background: #${lightCol}; - } - #scratchpad { - margin-left: 2px; - } - #cpu { - border-bottom: 3px solid #f90000; - margin: 0 5px 0 2px; - } - #memory { - border-bottom: 3px solid #4bffdc; - margin: 0 5px 0 2px; - } - #custom-vram { - border-bottom: 3px solid #33FF00; - margin: 0 5px 0 2px; - } - #custom-media { - border-bottom: 3px solid #ffb066; - margin: 0 5px 0 2px; - } - #custom-clock-long { - border-bottom: 3px solid #0a6cf5; - margin: 0 5px 0 2px; - } - #custom-clock-short { - border-bottom: 3px solid #0a6cf5; - margin: 0 5px 0 2px; - } - #backlight { - border-bottom: 3px solid #5ffca3; - margin: 0 5px 0 2px; - } - #battery { - border-bottom: 3px solid #fcfc16; - margin: 0 5px 0 2px; - } - #custom-media.paused { - color: #888; - } - #custom-weather { - border-bottom: 3px solid #${primeCol}; - margin: 0 5px 0 2px; - } - #custom-weather2 { - border-bottom: 3px solid #c75bd3; - margin: 0 5px 0 2px; - } - #custom-notifs { - border-bottom: 3px solid #${primeCol}; - margin: 0 5px 0 2px; - } - #custom-notifs.disabled { - color: #888; - } - #pulseaudio { - margin-right: 5px; - } - #pulseaudio.muted { - color: #424242; - } - ''; + settings = { + display1 = { + name = "bar1"; + position = "top"; + layer = "bottom"; + output = [display1 "VGA-1"]; + modules-left = ["sway/workspaces" "sway/window"]; + modules-right = [ + "pulseaudio" + "cpu" + "memory" + "custom/vram" + "custom/clock-long" + "gamemode" + "sway/scratchpad" + "tray" + "bluetooth" + "network" + ]; + "sway/workspaces" = swayWorkspacesModule; + "sway/window" = swayWindowsModule; + "pulseaudio" = pulseModule; + "cpu" = cpuModule; + "memory" = ramModule; + "custom/vram" = vramModule; + "custom/clock-long" = longClockModule; + "gamemode" = gamemodeModule; + "sway/scratchpad" = scratchpadModule; + "tray" = trayModule; + "bluetooth" = bluetoothModule; + "network" = networkModule // {interface = "enp*";}; + }; + display2 = { + name = "bar2"; + position = "top"; + layer = "bottom"; + output = [display2]; + modules-left = ["sway/workspaces" "sway/window"]; + modules-right = [ + "pulseaudio" + "custom/media" + "custom/notifs" + "cpu" + "memory" + "custom/vram" + "custom/clock-long" + ]; + "sway/workspaces" = swayWorkspacesModule; + "sway/window" = swayWindowsModule; + "pulseaudio" = pulseModule; + "custom/media" = mediaModule; + "custom/notifs" = notificationModule; + "cpu" = cpuModule; + "memory" = ramModule; + "custom/vram" = vramModule; + "custom/clock-long" = longClockModule; + }; + display3 = { + name = "bar3"; + position = "top"; + layer = "bottom"; + output = [display3]; + modules-left = ["sway/workspaces" "sway/window"]; + modules-right = [ + "pulseaudio" + "custom/weather" + "cpu" + "memory" + "custom/vram" + "custom/clock-short" + ]; + "sway/workspaces" = swayWorkspacesModule; + "sway/window" = swayWindowsModule; + "pulseaudio" = pulseModule; + "custom/weather" = weatherModule; + "cpu" = cpuModule; + "memory" = ramModule; + "custom/vram" = vramModule; + "custom/clock-short" = shortClockModule; + }; + displayLap = { + name = "laptop"; + position = "top"; + layer = "bottom"; + output = ["eDP-1" "LVDS-1" "DSI-1" "HDMI-A-1"]; + modules-left = ["sway/workspaces" "sway/window"]; + modules-right = [ + "pulseaudio" + "custom/media" + "custom/notifs" + "custom/weather2" + "cpu" + "memory" + "custom/vram" + "backlight" + "battery" + "custom/clock-long" + "gamemode" + "sway/scratchpad" + "tray" + "bluetooth" + "network" + ]; + "sway/workspaces" = swayWorkspacesModule; + "sway/window" = swayWindowsModule; + "pulseaudio" = pulseModule; + "custom/media" = mediaModule; + "custom/notifs" = notificationModule; + "custom/weather2" = weatherModule; + "cpu" = cpuModule; + "memory" = ramModule; + "custom/vram" = vramModule; + "backlight" = backlightModule; + "battery" = batteryModule; + "custom/clock-long" = longClockModule; + "sway/scratchpad" = scratchpadModule; + "tray" = trayModule; + "bluetooth" = bluetoothModule; + "network" = networkModule; + }; + }; + style = '' + * { + border: 0; + border-radius: 0; + min-height: 0; + font-family: ${mainFont}, ${nerdFont}; + font-size: 15.5px; + color: #${textCol}; + } + #waybar { + background: #${darkCol}; + } + #workspaces { + padding: 0 6px 0 0; + } + #tray { + padding: 0 2px 0 5px; + } + #network { + padding: 0 10px 0 4px; + } + #network.disconnected,#bluetooth.off { + color: #424242; + } + #bluetooth { + margin: 0 6px 0 4px; + font-size: 13.4px; + } + #workspaces button { + padding: 0 3px; + color: white; + border-bottom: 3px solid transparent; + min-width: 20px; + } + #workspaces button.visible { + border-bottom: 3px solid #${primeCol}; + background: #${midCol}; + } + #workspaces button.urgent { + border-bottom: 3px solid #${urgentCol}; + } + #workspaces button:hover { + box-shadow: none; + background: #${lightCol}; + } + #scratchpad { + margin-left: 2px; + } + #cpu { + border-bottom: 3px solid #f90000; + margin: 0 5px 0 2px; + } + #memory { + border-bottom: 3px solid #4bffdc; + margin: 0 5px 0 2px; + } + #custom-vram { + border-bottom: 3px solid #33FF00; + margin: 0 5px 0 2px; + } + #custom-media { + border-bottom: 3px solid #ffb066; + margin: 0 5px 0 2px; + } + #custom-clock-long { + border-bottom: 3px solid #0a6cf5; + margin: 0 5px 0 2px; + } + #custom-clock-short { + border-bottom: 3px solid #0a6cf5; + margin: 0 5px 0 2px; + } + #backlight { + border-bottom: 3px solid #5ffca3; + margin: 0 5px 0 2px; + } + #battery { + border-bottom: 3px solid #fcfc16; + margin: 0 5px 0 2px; + } + #custom-media.paused { + color: #888; + } + #custom-weather { + border-bottom: 3px solid #${primeCol}; + margin: 0 5px 0 2px; + } + #custom-weather2 { + border-bottom: 3px solid #c75bd3; + margin: 0 5px 0 2px; + } + #custom-notifs { + border-bottom: 3px solid #${primeCol}; + margin: 0 5px 0 2px; + } + #custom-notifs.disabled { + color: #888; + } + #pulseaudio { + margin-right: 5px; + } + #pulseaudio.muted { + color: #424242; + } + ''; }; # Define GTK theme settings gtk = { enable = true; - font = { + font = { name = "${mainFont}"; size = 11; - }; + }; theme = themeSettings; iconTheme = { - package = pkgs.papirus-icon-theme.override { color = "${folderCol}"; }; - name = "Papirus-Dark"; - }; + package = pkgs.papirus-icon-theme.override {color = "${folderCol}";}; + name = "Papirus-Dark"; + }; cursorTheme = { package = pkgs.simp1e-cursors; name = "Simp1e-Dark"; }; - # GTK app bookmarks - gtk3 = { - bookmarks = [ - # Local - "file:///home/jimbo/Downloads" - "file:///home/jimbo/Documents" - "file:///home/jimbo/Videos" - "file:///home/jimbo/Pictures/Screenshots" + # GTK app bookmarks + gtk3 = { + bookmarks = [ + # Local + "file:///home/jimbo/Downloads" + "file:///home/jimbo/Documents" + "file:///home/jimbo/Videos" + "file:///home/jimbo/Pictures/Screenshots" - # Remote + # Remote "file:///home/jimbo/JimboNFS/Downloads" "file:///home/jimbo/JimboNFS/Documents" "file:///home/jimbo/JimboNFS/Music" @@ -2099,22 +2241,22 @@ in "file:///home/jimbo/JimboNFS/Videos" "file:///home/jimbo/JimboNFS/Projects" - # Links and mounts + # Links and mounts "file:///home/jimbo/VMs" - # More important stuff + # More important stuff "file:///home/jimbo/JimboNFS/School" - ]; + ]; - # Disable shadows - extraCss = '' - * { outline-width: 0px; } - decoration { box-shadow: none; } - ''; - }; + # Disable shadows + extraCss = '' + * { outline-width: 0px; } + decoration { box-shadow: none; } + ''; + }; - # Stop gtk4 from being rounded - gtk4.extraCss = '' + # Stop gtk4 from being rounded + gtk4.extraCss = '' window { border-top-left-radius:0; border-top-right-radius:0; @@ -2134,66 +2276,84 @@ in # Set dconf settings dconf.settings = { - "org/gnome/desktop/interface/color-scheme" = { - color-scheme = "prefer-dark"; - }; - "org/virt-manager/virt-manager/connections" = { - autoconnect = [ "qemu:///system" ]; - uris = [ "qemu:///system" ]; + "org/gnome/desktop/interface/color-scheme" = { + color-scheme = "prefer-dark"; + }; + "org/virt-manager/virt-manager/connections" = { + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; }; }; # Enable Librewolf and extensions programs.firefox = let - commonExtensions = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin bitwarden darkreader sponsorblock return-youtube-dislikes no-pdf-download - ]; - commonSearch = { - force = true; - default = "Google"; - engines = { + commonExtensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + bitwarden + darkreader + sponsorblock + return-youtube-dislikes + no-pdf-download + ]; + commonSearch = { + force = true; + default = "Google"; + engines = { "Google" = { - urls = [{ - template = "https://www.google.com/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - ]; - }]; - definedAliases = [ "@g" ]; + urls = [ + { + template = "https://www.google.com/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; + definedAliases = ["@g"]; }; "NixPKGs" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@pkgs" ]; + definedAliases = ["@pkgs"]; }; - }; - }; + }; + }; commonSettings = { - "font.name.serif.x-western" = "${mainFont}"; - "font.name.sans-serif.x-western" = "${mainFont}"; - "font.name.monospace.x-western" = "${nerdFont}"; + "font.name.serif.x-western" = "${mainFont}"; + "font.name.sans-serif.x-western" = "${mainFont}"; + "font.name.monospace.x-western" = "${nerdFont}"; "general.autoScroll" = true; "browser.compactmode.show" = true; - "browser.uidensity" = 1; - "browser.startup.page" = 3; - "extensions.pocket.enabled" = false; + "browser.uidensity" = 1; + "browser.startup.page" = 3; + "extensions.pocket.enabled" = false; "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "privacy.userContext.newTabContainerOnLeftClick.enabled" = true; + "privacy.userContext.newTabContainerOnLeftClick.enabled" = true; "privacy.clearOnShutdown.history" = false; "privacy.clearOnShutdown.cookies" = false; "browser.toolbars.bookmarks.visibility" = "never"; "media.hardware-video-decoding.force-enabled" = true; - "svg.context-properties.content.enabled" = true; + "svg.context-properties.content.enabled" = true; "toolkit.tabbox.switchByScrolling" = true; "device.sensors.motion.enabled" = false; "extensions.autoDisableScopes" = 0; - "gnomeTheme.hideSingleTab" = true; + "gnomeTheme.hideSingleTab" = true; "browser.contentblocking.category" = "strict"; "urlclassifier.trackingSkipURLs" = "*.reddit.com, *.twitter.com, *.twimg.com, *.tiktok.com"; "urlclassifier.features.socialtracking.skipURLs" = "*.instagram.com, *.twitter.com, *.twimg.com"; @@ -2201,59 +2361,67 @@ in "browser.helperApps.deleteTempFileOnExit" = true; "privacy.globalprivacycontrol.enabled" = true; "privacy.globalprivacycontrol.functionality.enabled" = true; - #"webgl.disabled" = false; - }; + #"webgl.disabled" = false; + }; in { enable = true; - package = pkgs.librewolf; - profiles = { - Jimbo = { - id = 0; - extensions = commonExtensions; - search = commonSearch; - settings = commonSettings; - userChrome = '' - ${foxJimCol} - ${quteFoxCSS} - ''; - }; - School = { - id = 1; - extensions = commonExtensions; - search = commonSearch; - settings = commonSettings; - userChrome = '' - ${foxWorkCol} - ${quteFoxCSS} - ''; - }; - Misc = { - id = 2; - extensions = commonExtensions; - search = commonSearch; - settings = commonSettings; - containersForce = true; - containers = { - Google = { color = "green"; icon = "fingerprint"; id = 200; }; - Seneca = { color = "red"; icon = "briefcase"; id = 201; }; - }; - }; - }; + package = pkgs.librewolf; + profiles = { + Jimbo = { + id = 0; + extensions = commonExtensions; + search = commonSearch; + settings = commonSettings; + userChrome = '' + ${foxJimCol} + ${quteFoxCSS} + ''; + }; + School = { + id = 1; + extensions = commonExtensions; + search = commonSearch; + settings = commonSettings; + userChrome = '' + ${foxWorkCol} + ${quteFoxCSS} + ''; + }; + Misc = { + id = 2; + extensions = commonExtensions; + search = commonSearch; + settings = commonSettings; + containersForce = true; + containers = { + Google = { + color = "green"; + icon = "fingerprint"; + id = 200; + }; + Seneca = { + color = "red"; + icon = "briefcase"; + id = 201; + }; + }; + }; + }; }; # Enable a terminal emulator programs.foot = { enable = true; - server.enable = false; - settings = { - main = { + server.enable = false; + settings = { + main = { term = "xterm-256color"; font = "${nerdFont}:size=14.7"; - }; - cursor = { - style = "beam"; - }; - colors = { + }; + cursor = { + style = "beam"; + }; + colors = { alpha = "0.65"; background = "${darkCol}"; regular0 = "3f3f3f"; @@ -2272,11 +2440,11 @@ in bright5 = "b294bb"; bright6 = "93e0e3"; bright7 = "ffffff"; - }; - key-bindings = { + }; + key-bindings = { search-start = "Control+f"; - }; - }; + }; + }; }; # Install Neovim and plugins @@ -2286,26 +2454,33 @@ in viAlias = true; vimAlias = true; plugins = with pkgs.vimPlugins; [ - # Vim theme - vim-airline vim-airline-themes + # Vim theme + vim-airline + vim-airline-themes - # Internal clipboard - vim-vsnip cmp-vsnip + # Internal clipboard + vim-vsnip + cmp-vsnip - # Autocomplete manager + # Autocomplete manager lspkind-nvim - # Autocomplete plugins - cmp-nvim-lsp cmp-buffer cmp-path cmp-cmdline nvim-cmp + # Autocomplete plugins + cmp-nvim-lsp + cmp-buffer + cmp-path + cmp-cmdline + nvim-cmp - # Hex color visualizer and color theme - nvim-colorizer-lua vim-monokai-pro + # Hex color visualizer and color theme + nvim-colorizer-lua + vim-monokai-pro ]; extraConfig = '' lua <