diff --git a/flake.nix b/flake.nix index ba6f713..c640e42 100644 --- a/flake.nix +++ b/flake.nix @@ -11,47 +11,52 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; -# never got nixvim to wokrs. ): -# nixvim = { -# url = "github:nix-community/nixvim/nixos-25.11"; - # }; + # never got nixvim to wokrs. ): + # nixvim = { + # url = "github:nix-community/nixvim/nixos-25.11"; + # }; - outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, nixos-grub-themes, ... }@inputs: - let + outputs = { + self, + nixpkgs, + nixpkgs-unstable, + home-manager, + nixos-grub-themes, + ... + } @ inputs: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; pkgs-unstable = import nixpkgs-unstable { inherit system; config.allowUnfree = false; }; - in - { + in { nixosConfigurations = { laptop = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs pkgs-unstable;}; - modules = [ - ./hosts/laptop/configuration.nix + specialArgs = {inherit inputs pkgs-unstable;}; + modules = [ + ./hosts/laptop/configuration.nix ]; }; }; -# we use home-manager directly inside of configuration.nix -# last time i tried to use flake i broke everything ): -# homeManagerConfigurations = { -# tomasr = home-manager.lib.homeManagerConfiguration { -# pkgs = pkgs; -# system = "x86_64-linux"; -# username = "tomasr"; -# homeDirectory = "/home/tomasr"; -# modules = [ -# ./hosts/laptop/home.nix -# #nixvim.homeModules.default -#]; - # Import your Home Manager module - # configuration = ./hosts/laptop/home.nix; + # we use home-manager directly inside of configuration.nix + # last time i tried to use flake i broke everything ): + # homeManagerConfigurations = { + # tomasr = home-manager.lib.homeManagerConfiguration { + # pkgs = pkgs; + # system = "x86_64-linux"; + # username = "tomasr"; + # homeDirectory = "/home/tomasr"; + # modules = [ + # ./hosts/laptop/home.nix + # #nixvim.homeModules.default + #]; + # Import your Home Manager module + # configuration = ./hosts/laptop/home.nix; - # extraSpecialArgs = { inherit inputs; }; - # }; + # extraSpecialArgs = { inherit inputs; }; + # }; #}; - #}; -}; + #}; + }; } diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 5c96f7d..a4cedbe 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -1,52 +1,52 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, pkgs-unstable, libs, inputs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - inputs.home-manager.nixosModules.default - ../../modules/nixos/battery.nix + config, + pkgs, + pkgs-unstable, + libs, + inputs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + inputs.home-manager.nixosModules.default + ../../modules/nixos/battery.nix #../../modules/nixos/ly.nix ../../modules/nixos/lyminimal.nix ../../modules/nixos/anki.nix ../../modules/nixos/udevsimple.nix ]; + documentation.man.generateCaches = true; # used for the man script -documentation.man.generateCaches = true; # used for the man script - -# grub theme -boot.loader.grub = { + # grub theme + boot.loader.grub = { theme = inputs.nixos-grub-themes.packages.${pkgs.system}.nixos; # if you want to use nixos grub theme -}; - + }; nix.nixPath = [ "nixpkgs=${inputs.nixpkgs.outPath}" "home-manager=${inputs.home-manager.outPath}" ]; #manix is unhappy without this + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users = { + tomasr = ./home.nix; + }; + extraSpecialArgs = {inherit pkgs-unstable;}; + }; - -home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users = { - tomasr = ./home.nix; - }; - extraSpecialArgs = { inherit pkgs-unstable; }; -}; - - -environment.pathsToLink = [ - "/share/applications" - "/share/xdg-desktop-portal" -]; -# removes uxterm -services.xserver.excludePackages = [ pkgs.xterm ]; + environment.pathsToLink = [ + "/share/applications" + "/share/xdg-desktop-portal" + ]; + # removes uxterm + services.xserver.excludePackages = [pkgs.xterm]; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -72,30 +72,27 @@ services.xserver.excludePackages = [ pkgs.xterm ]; # zsh dont want to work if it is not initialzed here. programs.zsh.enable = true; - -# Enable the GNOME Desktop Environment. -# services.displayManager.gdm.enable = true; -# services.desktopManager.gnome.enable = true; -# we dont use gnome but some utils yes -> see pckgs -#enable sddm -#services.displayManager.sddm = { -# enable = true; -# wayland.enable = true; -#}; -# we use ly as the displayManager. see ../../modules/nixos/ly.nix + # Enable the GNOME Desktop Environment. + # services.displayManager.gdm.enable = true; + # services.desktopManager.gnome.enable = true; + # we dont use gnome but some utils yes -> see pckgs + #enable sddm + #services.displayManager.sddm = { + # enable = true; + # wayland.enable = true; + #}; + # we use ly as the displayManager. see ../../modules/nixos/ly.nix -# enable hyprland WM -programs.hyprland = { + # enable hyprland WM + programs.hyprland = { enable = true; package = pkgs-unstable.hyprland; # we use the unstable branch to get the latest features withUWSM = true; xwayland.enable = true; -}; + }; - - -services.upower.enable = true; + services.upower.enable = true; # Configure keymap in X11 services.xserver.xkb = { @@ -132,13 +129,12 @@ services.upower.enable = true; users.users.tomasr = { isNormalUser = true; description = "Tomas Rivera"; - extraGroups = [ "networkmanager" "wheel" ]; #wheel allow to use sudo + extraGroups = ["networkmanager" "wheel"]; #wheel allow to use sudo shell = pkgs.zsh; }; - #adds nixos experimental features: - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - + #adds nixos experimental features: + nix.settings.experimental-features = ["nix-command" "flakes"]; # Garbage collector of generations nix.gc = { @@ -153,71 +149,71 @@ services.upower.enable = true; # Allow unfree packages nixpkgs.config.allowUnfree = false; - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ -# use pkgs-unstable if you want the package from the unstable channel -#we need to install gnome and kde utils individually as we dont use gnome -gnome-calculator -snapshot -gnome-characters -gnome-disk-utility -kdePackages.okular -nautilus -gnome-font-viewer -wget -tree # shows dir in tree -zsh # better bash -brightnessctl # control brightness -pulseaudio # sound server -playerctl # controls media player -blueman # GTK-based Bluetooth Manager -udiskie # removable disk automounter for udisks -networkmanagerapplet # NetworkManager control applet -cliphist # Wayland clipboard manager -wl-clipboard # cli copy/past utilities for Wayland -jp # lightweight and flexible cli JSON parser -notepad-next -libnotify # Library that sends desktop notifications to a notification daemon -hyprkeys # keybind helper -cowsay -cmatrix -swww #wallpaper daemon -socat # Utility for bidirectional data transfer between two independent data channels (used to communicate between hyprland and swww to change wallpapers dinamically) -gcc # GNU C compiler -libreoffice -gruvbox-gtk-theme -hyprpicker -powertop -inetutils # collections of network programs such as telnet -python313Packages.pygments # used for ccat (comment of colorize plugin from oh-my-zsh) -fzf -jq # json parser used in some scripts -bottom # Cross-platform graphical process/system monitor with a customizable interface -cmatrix -tomato-c # pomodoro timer -pavucontrol # PulseAudio Volume Control -hyprshot -hyprcursor -vial # Open-source GUI and QMK fork for configuring your keyboard in real time -mplayer # Movie player that supports many video formats -chromium # used only to flash the firmware on my framework laptop 16 (keyboard.frame.work) as only chromium based browser support webHID. -capitaine-cursors-themed # cursor theme -usbutils # used for lsusb -# used for the framework 16 laptop -framework-tool -framework-tool-tui + # use pkgs-unstable if you want the package from the unstable channel + #we need to install gnome and kde utils individually as we dont use gnome + gnome-calculator + snapshot + gnome-characters + gnome-disk-utility + kdePackages.okular + nautilus + gnome-font-viewer + wget + tree # shows dir in tree + zsh # better bash + brightnessctl # control brightness + pulseaudio # sound server + playerctl # controls media player + blueman # GTK-based Bluetooth Manager + udiskie # removable disk automounter for udisks + networkmanagerapplet # NetworkManager control applet + cliphist # Wayland clipboard manager + wl-clipboard # cli copy/past utilities for Wayland + jp # lightweight and flexible cli JSON parser + notepad-next + libnotify # Library that sends desktop notifications to a notification daemon + hyprkeys # keybind helper + cowsay + cmatrix + swww #wallpaper daemon + socat # Utility for bidirectional data transfer between two independent data channels (used to communicate between hyprland and swww to change wallpapers dinamically) + gcc # GNU C compiler + libreoffice + gruvbox-gtk-theme + hyprpicker + powertop + inetutils # collections of network programs such as telnet + python313Packages.pygments # used for ccat (comment of colorize plugin from oh-my-zsh) + fzf + jq # json parser used in some scripts + bottom # Cross-platform graphical process/system monitor with a customizable interface + cmatrix + tomato-c # pomodoro timer + pavucontrol # PulseAudio Volume Control + hyprshot + hyprcursor + vial # Open-source GUI and QMK fork for configuring your keyboard in real time + mplayer # Movie player that supports many video formats + chromium # used only to flash the firmware on my framework laptop 16 (keyboard.frame.work) as only chromium based browser support webHID. + capitaine-cursors-themed # cursor theme + usbutils # used for lsusb + # used for the framework 16 laptop + framework-tool + framework-tool-tui -#some nix tools -manix -deadnix -]; + #some nix tools + manix + deadnix + alejandra + ]; -# fonts -fonts.packages = with pkgs; [ -nerd-fonts._0xproto -]; + # fonts + fonts.packages = with pkgs; [ + nerd-fonts._0xproto + ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. @@ -236,7 +232,7 @@ nerd-fonts._0xproto # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; # Or disable the firewall altogether. - networking.firewall.enable = false; + networking.firewall.enable = false; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions @@ -245,5 +241,4 @@ nerd-fonts._0xproto # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "25.11"; # Did you read the comment? - } diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix index 2bc11c6..5702a78 100755 --- a/hosts/laptop/hardware-configuration.nix +++ b/hosts/laptop/hardware-configuration.nix @@ -1,30 +1,34 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/6aa664c2-8b23-4e20-b6e9-1806bf0f8df2"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/6aa664c2-8b23-4e20-b6e9-1806bf0f8df2"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/A59A-7AFA"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/A59A-7AFA"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; - swapDevices = [ ]; + swapDevices = []; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 4f9f026..c1f014f 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -1,163 +1,159 @@ -{ config, pkgs, inputs, ... }: - { -# every import imports a specific module for an app. This module contains the enabling of this app and its settings. -# So if you want to add an home-manager app create a module which enables it and configures it and import it. -imports = [ -# app modules -../../modules/home-manager/kitty.nix # terminal # use absolute path with --impure flag or go back to /etc/nixos and use relative -../../modules/home-manager/zoxide.nix # better cd -../../modules/home-manager/zsh.nix # better bash -../../modules/home-manager/git.nix -../../modules/home-manager/ssh.nix -../../modules/home-manager/fastfetch.nix -../../modules/home-manager/hyprland.nix -../../modules/home-manager/wlogout.nix # logout utility -../../modules/home-manager/rofi.nix # launcher and keybindings helper -../../modules/home-manager/swaync.nix # notification daemon -../../modules/home-manager/neovim.nix # dont use nixvim. broken -#../../modules/home-manager/neovim2.nix # ./neovim2.nix uses vim plug instead of the nix repository as with ./neovim.nix see the begining of neovim2 for an explanation -../../modules/home-manager/rclone.nix -../../modules/home-manager/waybar.nix -#../../modules/home-manager/oh-my-posh.nix # zsh customizer -../../modules/home-manager/oh-my-zsh.nix # another zsh customizer -../../modules/home-manager/hypridle.nix -../../modules/home-manager/swaylock.nix -../../modules/home-manager/anki.nix # we use only for some settings. see ../../modules/nixos/anki.nix for activating -../../modules/home-manager/librewolf.nix # privacy browser -../../modules/home-manager/cursor.nix # cursor (the icon not the app) -../../modules/home-manager/ripgrep.nix # better grep -]; + config, + pkgs, + inputs, + ... +}: { + # every import imports a specific module for an app. This module contains the enabling of this app and its settings. + # So if you want to add an home-manager app create a module which enables it and configures it and import it. + imports = [ + # app modules + ../../modules/home-manager/kitty.nix # terminal # use absolute path with --impure flag or go back to /etc/nixos and use relative + ../../modules/home-manager/zoxide.nix # better cd + ../../modules/home-manager/zsh.nix # better bash + ../../modules/home-manager/git.nix + ../../modules/home-manager/ssh.nix + ../../modules/home-manager/fastfetch.nix + ../../modules/home-manager/hyprland.nix + ../../modules/home-manager/wlogout.nix # logout utility + ../../modules/home-manager/rofi.nix # launcher and keybindings helper + ../../modules/home-manager/swaync.nix # notification daemon + ../../modules/home-manager/neovim.nix # dont use nixvim. broken + #../../modules/home-manager/neovim2.nix # ./neovim2.nix uses vim plug instead of the nix repository as with ./neovim.nix see the begining of neovim2 for an explanation + ../../modules/home-manager/rclone.nix + ../../modules/home-manager/waybar.nix + #../../modules/home-manager/oh-my-posh.nix # zsh customizer + ../../modules/home-manager/oh-my-zsh.nix # another zsh customizer + ../../modules/home-manager/hypridle.nix + ../../modules/home-manager/swaylock.nix + ../../modules/home-manager/anki.nix # we use only for some settings. see ../../modules/nixos/anki.nix for activating + ../../modules/home-manager/librewolf.nix # privacy browser + ../../modules/home-manager/cursor.nix # cursor (the icon not the app) + ../../modules/home-manager/ripgrep.nix # better grep + ]; - - - -#programs.nixvim = { -# enable = true; -# imports = [ ../../modules/nixvim/neovim.nix ]; -# package = pkgs.neovim; -#}; -# Home Manager needs a bit of information about you and the paths it should + #programs.nixvim = { + # enable = true; + # imports = [ ../../modules/nixvim/neovim.nix ]; + # package = pkgs.neovim; + #}; + # Home Manager needs a bit of information about you and the paths it should # Required for Home Manager home.username = "tomasr"; home.homeDirectory = "/home/tomasr"; - home.stateVersion = "25.11"; # match your Home Manager release + home.stateVersion = "25.11"; # match your Home Manager release -# This value determines the Home Manager release that your configuration is -# compatible with. This helps avoid breakage when a new Home Manager release -# introduces backwards incompatible changes. -# -# You should not change this value, even if you update Home Manager. If you do -# want to update the value, then make sure to first check the Home Manager -# release notes. + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. -# The home.packages option allows you to install Nix packages into your -# environment. -home.packages = [ -#scritps -(pkgs.callPackage ../../modules/scripts/dontkillsteam.nix {}) # kill app (if it is steam put it in some background -(pkgs.callPackage ../../modules/scripts/batterynotify.nix {}) -(pkgs.callPackage ../../modules/scripts/batterywarning.nix {}) -(pkgs.callPackage ../../modules/scripts/weather.nix {}) -(pkgs.callPackage ../../modules/scripts/cowsay.nix {}) -(pkgs.callPackage ../../modules/scripts/wallpaper.nix {}) -(pkgs.callPackage ../../modules/scripts/mountkdrive.nix {}) -(pkgs.callPackage ../../modules/scripts/weatherwaybar.nix {}) -(pkgs.callPackage ../../modules/scripts/colorpicker.nix {}) -(pkgs.callPackage ../../modules/scripts/killall.nix {}) # kill all windows except focused window -(pkgs.callPackage ../../modules/scripts/launch.nix {}) # necessary for the apps i launch with hyprland at every start -(pkgs.callPackage ../../modules/scripts/gitnotify.nix {}) -(pkgs.callPackage ../../modules/scripts/tomato.nix {}) -(pkgs.callPackage ../../modules/scripts/librewolfprofiles.nix {}) -(pkgs.callPackage ../../modules/scripts/performance-mode.nix {}) -(pkgs.callPackage ../../modules/scripts/btm.nix {}) -(pkgs.callPackage ../../modules/scripts/manix.nix {}) -(pkgs.callPackage ../../modules/scripts/man.nix {}) -#pkgs -pkgs.gruvbox-gtk-theme -# # Adds the 'hello' command to your environment. It prints a friendly -# # "Hello, world!" when run. -# pkgs.hello + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = [ + #scritps + (pkgs.callPackage ../../modules/scripts/dontkillsteam.nix {}) # kill app (if it is steam put it in some background + (pkgs.callPackage ../../modules/scripts/batterynotify.nix {}) + (pkgs.callPackage ../../modules/scripts/batterywarning.nix {}) + (pkgs.callPackage ../../modules/scripts/weather.nix {}) + (pkgs.callPackage ../../modules/scripts/cowsay.nix {}) + (pkgs.callPackage ../../modules/scripts/wallpaper.nix {}) + (pkgs.callPackage ../../modules/scripts/mountkdrive.nix {}) + (pkgs.callPackage ../../modules/scripts/weatherwaybar.nix {}) + (pkgs.callPackage ../../modules/scripts/colorpicker.nix {}) + (pkgs.callPackage ../../modules/scripts/killall.nix {}) # kill all windows except focused window + (pkgs.callPackage ../../modules/scripts/launch.nix {}) # necessary for the apps i launch with hyprland at every start + (pkgs.callPackage ../../modules/scripts/gitnotify.nix {}) + (pkgs.callPackage ../../modules/scripts/tomato.nix {}) + (pkgs.callPackage ../../modules/scripts/librewolfprofiles.nix {}) + (pkgs.callPackage ../../modules/scripts/performance-mode.nix {}) + (pkgs.callPackage ../../modules/scripts/btm.nix {}) + (pkgs.callPackage ../../modules/scripts/manix.nix {}) + (pkgs.callPackage ../../modules/scripts/man.nix {}) + #pkgs + pkgs.gruvbox-gtk-theme + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello -# # It is sometimes useful to fine-tune packages, for example, by applying -# # overrides. You can do that directly here, just don't forget the -# # parentheses. Maybe you want to install Nerd Fonts with a limited number of -# # fonts? -# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) -# # You can also create simple shell scripts directly inside your -# # configuration. For example, this adds a command 'my-hello' to your -# # environment: -# (pkgs.writeShellScriptBin "my-hello" '' -# echo "Hello, ${config.home.username}!" -# '') -]; + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; -#maybe migrate both of them in a separate file -# gtk config -gtk.theme = { -enable = true; -Gruvbox-GTK-Theme-BL-MB = { -enable = true; -name = "Gruvbox-GTK-Theme-BL-MB"; -package = pkgs.gruvbox-gtk-theme; -}; -}; + #maybe migrate both of them in a separate file + # gtk config + gtk.theme = { + enable = true; + Gruvbox-GTK-Theme-BL-MB = { + enable = true; + name = "Gruvbox-GTK-Theme-BL-MB"; + package = pkgs.gruvbox-gtk-theme; + }; + }; -# ssh config + # ssh config -programs.ssh.enable = true; -services.ssh-agent.enable = true; + programs.ssh.enable = true; + services.ssh-agent.enable = true; -home.file.".ssh/config".text = '' -Host * - AddKeysToAgent yes - IdentityFile ~/.ssh/id_ed25519 -''; - + home.file.".ssh/config".text = '' + Host * + AddKeysToAgent yes + IdentityFile ~/.ssh/id_ed25519 + ''; + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; -# Home Manager is pretty good at managing dotfiles. The primary way to manage -# plain files is through 'home.file'. -home.file = { -# # Building this configuration will create a copy of 'dotfiles/screenrc' in -# # the Nix store. Activating the configuration will then make '~/.screenrc' a -# # symlink to the Nix store copy. -# ".screenrc".source = dotfiles/screenrc; + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; -# # You can also set the file content immediately. -# ".gradle/gradle.properties".text = '' -# org.gradle.console=verbose -# org.gradle.daemon.idletimeout=3600000 -# ''; -}; - - -# Home Manager can also manage your environment variables through -# 'home.sessionVariables'. These will be explicitly sourced when using a -# shell provided by Home Manager. If you don't want to manage your shell -# through Home Manager then you have to manually source 'hm-session-vars.sh' -# located at either -# -# ~/.nix-profile/etc/profile.d/hm-session-vars.sh -# -# or -# -# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh -# -# or -# -# /etc/profiles/per-user/tomasr/etc/profile.d/hm-session-vars.sh -# -home.sessionVariables = { + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/tomasr/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { EDITOR = "neovim"; # Git update function # Prompts for commit message; defaults if empty TERMINAL = "kitty"; }; - -# Let Home Manager install and manage itself. -programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; } diff --git a/modules/home-manager/anki.nix b/modules/home-manager/anki.nix index 290c51f..21d9dd3 100644 --- a/modules/home-manager/anki.nix +++ b/modules/home-manager/anki.nix @@ -1,5 +1,8 @@ -{ config, pkgs, ... }: { + config, + pkgs, + ... +}: { programs.anki = { # we enable system wide with nixpkgs because it offers some addon configuration. We just use this for some config #enable = true; diff --git a/modules/home-manager/batsignal.nix b/modules/home-manager/batsignal.nix index b8f7c25..fa02b0c 100644 --- a/modules/home-manager/batsignal.nix +++ b/modules/home-manager/batsignal.nix @@ -1,7 +1,9 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { services.batsignal = { enable = true; -}; + }; } diff --git a/modules/home-manager/cursor.nix b/modules/home-manager/cursor.nix index 896f48b..dbb6bb5 100644 --- a/modules/home-manager/cursor.nix +++ b/modules/home-manager/cursor.nix @@ -1,5 +1,8 @@ -{ config, pkgs, ... }: { + config, + pkgs, + ... +}: { home.pointerCursor = { hyprcursor.enable = true; enable = true; diff --git a/modules/home-manager/fastfetch.nix b/modules/home-manager/fastfetch.nix index 4909566..c892b37 100644 --- a/modules/home-manager/fastfetch.nix +++ b/modules/home-manager/fastfetch.nix @@ -1,7 +1,9 @@ -{ config, pkgs, ... }: - { -# Adapted from https://github.com/dacrab/fastfetch-config/blob/main/config.jsonc + config, + pkgs, + ... +}: { + # Adapted from https://github.com/dacrab/fastfetch-config/blob/main/config.jsonc programs.fastfetch = { enable = true; @@ -12,7 +14,6 @@ }; modules = [ - # ───────────── Hardware ───────────── { @@ -161,14 +162,14 @@ #{ # type = "custom"; - # format = '' - # {#0} {#1} {#2} {#3} {#4} {#5} {#6} {#7} - # ''; - #} #for some reason dont work - { - type = "colors"; - symbol = "diamond"; - } + # format = '' + # {#0} {#1} {#2} {#3} {#4} {#5} {#6} {#7} + # ''; + #} #for some reason dont work + { + type = "colors"; + symbol = "diamond"; + } "break" ]; diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix index 7087de2..e0b95b1 100644 --- a/modules/home-manager/git.nix +++ b/modules/home-manager/git.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.git = { enable = true; settings = { diff --git a/modules/home-manager/hypridle.nix b/modules/home-manager/hypridle.nix index 0a077c2..c2ee302 100644 --- a/modules/home-manager/hypridle.nix +++ b/modules/home-manager/hypridle.nix @@ -1,23 +1,24 @@ -{ config, pkgs, ... }: - { - + config, + pkgs, + ... +}: { services.hypridle = { enable = true; settings = { - general = { - lock_cmd = "notify-send 'lock!'"; # dbus/sysd lock command (loginctl lock-session) - unlock_cmd = "notify-send 'unlock!'"; # same as above, but unlock - before_sleep_cmd = "notify-send 'Zzz'"; # command ran before sleep - after_sleep_cmd = "notify-send 'Awake!"; # command ran after sleep - ignore_dbus_inhibit = false; # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam) - ignore_systemd_inhibit = false; # whether to ignore systemd-inhibit --what=idle inhibitors - }; - listener = { - timeout = 500; # in seconds - on-timeout = "notify-send 'You are idle!'"; # command to run when timeout has passed - on-resume = "notify-send 'Welcome back!'"; # command to run when activity is detected after timeout has fired. - }; + general = { + lock_cmd = "notify-send 'lock!'"; # dbus/sysd lock command (loginctl lock-session) + unlock_cmd = "notify-send 'unlock!'"; # same as above, but unlock + before_sleep_cmd = "notify-send 'Zzz'"; # command ran before sleep + after_sleep_cmd = "notify-send 'Awake!"; # command ran after sleep + ignore_dbus_inhibit = false; # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam) + ignore_systemd_inhibit = false; # whether to ignore systemd-inhibit --what=idle inhibitors + }; + listener = { + timeout = 500; # in seconds + on-timeout = "notify-send 'You are idle!'"; # command to run when timeout has passed + on-resume = "notify-send 'Welcome back!'"; # command to run when activity is detected after timeout has fired. + }; }; }; } diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index 1e66be7..074a421 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -1,436 +1,428 @@ -{ config, pkgs, pkgs-unstable, ... }: - -let - wallpaper = ../../assets/wallpaper1.jpg; -in { + config, + pkgs, + pkgs-unstable, + ... +}: let + wallpaper = ../../assets/wallpaper1.jpg; +in { + #refer to https://wiki.hypr.land/Nix/Hyprland-on-Home-Manager/ + wayland.windowManager.hyprland.enable = true; + wayland.windowManager.hyprland.package = pkgs-unstable.hyprland; + #hint Electron apps to use on wayland; + home.sessionVariables.NIXOS_OZONE_WL = "1"; + wayland.windowManager.hyprland.plugins = [ + #pkgs-unstable.hyprlandPlugins.hyprspace # currently broken + #pkgs-unstable.hyprlandPlugins.hypr-dynamic-cursors # currently broken + ]; + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + "$term" = "kitty"; + "$editor" = "nvim"; + "$file" = "nautilus"; + "$browser" = "kitty --class \"custom-librewolfprofiles\" --name \"Select LibreWolf profile\" --hold custom-librewolfprofiles"; + # ▄▀█ █▄░█ █ █▀▄▀█ ▄▀█ ▀█▀ █ █▀█ █▄░█ + # █▀█ █░▀█ █ █░▀░█ █▀█ ░█░ █ █▄█ █░▀█ + animations = { + enabled = true; + bezier = [ + "wind, 0.05, 0.9, 0.1, 1.05" + "winIn, 0.1, 1.1, 0.1, 1.1" + "winOut, 0.3, -0.3, 0, 1" + "liner, 1, 1, 1, 1" + ]; + animation = [ + "windows, 1, 6, wind, slide" + "windowsIn, 1, 6, winIn, slide" + "windowsOut, 1, 5, winOut, slide" + "windowsMove, 1, 5, wind, slide" + "border, 1, 1, liner" + "borderangle, 1, 30, liner, loop" + "fade, 1, 10, default" + "workspaces, 1, 5, wind" + ]; + }; - #refer to https://wiki.hypr.land/Nix/Hyprland-on-Home-Manager/ - wayland.windowManager.hyprland.enable = true; - wayland.windowManager.hyprland.package = pkgs-unstable.hyprland; - #hint Electron apps to use on wayland; - home.sessionVariables.NIXOS_OZONE_WL="1"; + # █▀▀ █▄░█ █░█ + # ██▄ █░▀█ ▀▄▀ - wayland.windowManager.hyprland.plugins = [ - #pkgs-unstable.hyprlandPlugins.hyprspace # currently broken - #pkgs-unstable.hyprlandPlugins.hypr-dynamic-cursors # currently broken - ]; - wayland.windowManager.hyprland.settings = { - "$mod" = "SUPER"; - "$term" = "kitty"; - "$editor" = "nvim"; - "$file" = "nautilus"; - "$browser" = "kitty --class \"custom-librewolfprofiles\" --name \"Select LibreWolf profile\" --hold custom-librewolfprofiles"; -# ▄▀█ █▄░█ █ █▀▄▀█ ▄▀█ ▀█▀ █ █▀█ █▄░█ -# █▀█ █░▀█ █ █░▀░█ █▀█ ░█░ █ █▄█ █░▀█ - animations = { - enabled = true; - bezier = [ - "wind, 0.05, 0.9, 0.1, 1.05" - "winIn, 0.1, 1.1, 0.1, 1.1" - "winOut, 0.3, -0.3, 0, 1" - "liner, 1, 1, 1, 1" - ]; - animation = [ - "windows, 1, 6, wind, slide" - "windowsIn, 1, 6, winIn, slide" - "windowsOut, 1, 5, winOut, slide" - "windowsMove, 1, 5, wind, slide" - "border, 1, 1, liner" - "borderangle, 1, 30, liner, loop" - "fade, 1, 10, default" - "workspaces, 1, 5, wind" - ]; - }; + # See https://wiki.hyprland.org/Configuring/Environment-variables/ + env = [ + "PATH, $PATH:$scrPath" + "XDG_CURRENT_DESKTOP,Hyprland" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + "QT_QPA_PLATFORM,wayland;xcb" + "QT_QPAPLATFORMTHEME,qt6ct" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "MOZ_ENABLE_WAYLAND,1" + "GDK_SCALE,1" + ]; -# █▀▀ █▄░█ █░█ -# ██▄ █░▀█ ▀▄▀ + # █ █▄░█ █▀█ █░█ ▀█▀ + # █ █░▀█ █▀▀ █▄█ ░█░ - # See https://wiki.hyprland.org/Configuring/Environment-variables/ - env = [ - "PATH, $PATH:$scrPath" - "XDG_CURRENT_DESKTOP,Hyprland" - "XDG_SESSION_TYPE,wayland" - "XDG_SESSION_DESKTOP,Hyprland" - "QT_QPA_PLATFORM,wayland;xcb" - "QT_QPAPLATFORMTHEME,qt6ct" - "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" - "MOZ_ENABLE_WAYLAND,1" - "GDK_SCALE,1" - ]; + input = { + kb_layout = ["ch"]; + follow_mouse = 1; + sensitivity = 0; + force_no_accel = 1; + }; -# █ █▄░█ █▀█ █░█ ▀█▀ -# █ █░▀█ █▀▀ █▄█ ░█░ + # █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀ + # █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█ + # binds to do - input = { - kb_layout = [ "ch" ]; - follow_mouse = 1; - sensitivity = 0; - force_no_accel = 1; - }; + bind = [ + #hyprland/utility keybindings + "$mod, W, togglefloating" + "$mod, G, togglegroup" + "Alt, Return, fullscreen" + "$mod, Left, movefocus, l" + "$mod, Right, movefocus, r" + "$mod, Up, movefocus, u" + "$mod, Down, movefocus, d" + "Alt, Tab, movefocus, d" + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + "$mod+Ctrl, Right, workspace, r+1" + "$mod+Ctrl, Left, workspace, r-1" + "$mod+Ctrl, Doown, workspace, empty" + "$mod+Shift, 1, movetoworkspace, 1" + "$mod+Shift, 2, movetoworkspace, 2" + "$mod+Shift, 3, movetoworkspace, 3" + "$mod+Shift, 4, movetoworkspace, 4" + "$mod+Shift, 5, movetoworkspace, 5" + "$mod+Shift, 6, movetoworkspace, 6" + "$mod+Shift, 7, movetoworkspace, 7" + "$mod+Shift, 8, movetoworkspace, 8" + "$mod+Shift, 9, movetoworkspace, 9" + "$mod+Shift, 0, movetoworkspace, 10" + "$mod+Ctrl+Alt, Right, movetoworkspace, r+1" + "$mod+Ctrl+Alt, Left, movetoworkspace, r-1" + "$mod, Backspace, exec, wlogout -b 4 -T 600 -B 600" + "$mod+Shift+Ctrl, Left, movewindow, l" + "$mod+Shift+Ctrl, Right, movewindow, r" + "$mod+Shift+Ctrl, Up, movewindow, u" + "$mod+Shift+Ctrl, Down, movewindow, d" + "$mod, mouse_down, workspace, e+1" + "$mod, mouse_up, workspace, e-1" + "$mod, V, exec, cliphist list | rofi -dmenu| cliphist decode | wl-copy" # copy paste + "$mod, B, exec, hyprkeys -bkr | rofi -dmenu" + #"$mod, A, tagwindow, noborder" # used to not apply image border + "$mod, S, togglespecialworkspace," + "Alt+$mod, S, movetoworkspace, special" + # for the scrolling layout + "$mod, A, layoutmsg, move -col" + "$mod, D, layoutmsg, move +col" + #apps keybindings + "$mod, T, exec, $term" + "$mod, E, exec, $file" + "$mod, F, exec, $browser" + "$mod+Shift, A, exec, rofi -show drun" + "$mod, Q, exec, custom-dontkillsteam" + "Ctrl+Alt, W, exec, pkill waybar || waybar" + "$mod, L, exec, swaylock -eFLK -i ${wallpaper}" + "$mod, F11, exec, hyprshot -m window" + ", F11, exec, hyprshot -m output" + "$mod_SHIFT, S, exec, hyprshot -m region --clipboard only" + # framework 16 rgb macropad + "Ctrl+$mod, 6, exec, custom-killall" # pos 1 1 killall apps except focused one + "Ctrl+Alt, 7, exec, custom-performance" # pos 2 1 start performance mode + # reloads the autostart programs # pos 3 1 + "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=16 -e sh -c 'custom-weather'" + "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=11 -e sh -c 'custom-cowsay'" + "Ctrl+$mod, 4, exec, kitty -e 'custom-launch'" + "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=5 -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T " + "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=1 -e sh -c 'cmatrix -br'" + "Ctrl+Alt, 1, exec, swaync-client -t" # pos 4 1 notification center + "Ctrl+$mod, 3, exec, pavucontrol" # pos 1 2 audiocontrol + "Ctrl+$mod, 5, exec, gnome-characters" # pos 2 2 special chars + "Ctrl+Alt, 8, exec, hyprpicker | tee >(wl-copy) | cliphist store" # pos 3 2 colorpicker + "Ctrl+Alt, 0, exec, custom-tomato" # pos 1 3 pomodoro app + "Ctrl+Alt, 2, exec, custom-bottom" # pos 2 3 btm (like htop but cleaner) + "Ctrl+Alt, 9, exec, anki" + # if hyprexpo plugin enabled bind = $mainMod, Space, hyprexpo:expo, toggle + # maybe exec sudo framework-tools-tui -# █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀ -# █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█ - # binds to do - - bind = [ - #hyprland/utility keybindings - "$mod, W, togglefloating" - "$mod, G, togglegroup" - "Alt, Return, fullscreen" - "$mod, Left, movefocus, l" - "$mod, Right, movefocus, r" - "$mod, Up, movefocus, u" - "$mod, Down, movefocus, d" - "Alt, Tab, movefocus, d" - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - "$mod+Ctrl, Right, workspace, r+1" - "$mod+Ctrl, Left, workspace, r-1" - "$mod+Ctrl, Doown, workspace, empty" - "$mod+Shift, 1, movetoworkspace, 1" - "$mod+Shift, 2, movetoworkspace, 2" - "$mod+Shift, 3, movetoworkspace, 3" - "$mod+Shift, 4, movetoworkspace, 4" - "$mod+Shift, 5, movetoworkspace, 5" - "$mod+Shift, 6, movetoworkspace, 6" - "$mod+Shift, 7, movetoworkspace, 7" - "$mod+Shift, 8, movetoworkspace, 8" - "$mod+Shift, 9, movetoworkspace, 9" - "$mod+Shift, 0, movetoworkspace, 10" - "$mod+Ctrl+Alt, Right, movetoworkspace, r+1" - "$mod+Ctrl+Alt, Left, movetoworkspace, r-1" - "$mod, Backspace, exec, wlogout -b 4 -T 600 -B 600" - "$mod+Shift+Ctrl, Left, movewindow, l" - "$mod+Shift+Ctrl, Right, movewindow, r" - "$mod+Shift+Ctrl, Up, movewindow, u" - "$mod+Shift+Ctrl, Down, movewindow, d" - "$mod, mouse_down, workspace, e+1" - "$mod, mouse_up, workspace, e-1" - "$mod, V, exec, cliphist list | rofi -dmenu| cliphist decode | wl-copy" # copy paste - "$mod, B, exec, hyprkeys -bkr | rofi -dmenu" - #"$mod, A, tagwindow, noborder" # used to not apply image border - "$mod, S, togglespecialworkspace," - "Alt+$mod, S, movetoworkspace, special" - # for the scrolling layout - "$mod, A, layoutmsg, move -col" - "$mod, D, layoutmsg, move +col" - #apps keybindings - "$mod, T, exec, $term" - "$mod, E, exec, $file" - "$mod, F, exec, $browser" - "$mod+Shift, A, exec, rofi -show drun" - "$mod, Q, exec, custom-dontkillsteam" - "Ctrl+Alt, W, exec, pkill waybar || waybar" - "$mod, L, exec, swaylock -eFLK -i ${wallpaper}" - "$mod, F11, exec, hyprshot -m window" - ", F11, exec, hyprshot -m output" - "$mod_SHIFT, S, exec, hyprshot -m region --clipboard only" - # framework 16 rgb macropad - "Ctrl+$mod, 6, exec, custom-killall" # pos 1 1 killall apps except focused one - "Ctrl+Alt, 7, exec, custom-performance" # pos 2 1 start performance mode - # reloads the autostart programs # pos 3 1 - "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=16 -e sh -c 'custom-weather'" - "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=11 -e sh -c 'custom-cowsay'" - "Ctrl+$mod, 4, exec, kitty -e 'custom-launch'" - "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=5 -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T " - "Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=1 -e sh -c 'cmatrix -br'" - "Ctrl+Alt, 1, exec, swaync-client -t" # pos 4 1 notification center - "Ctrl+$mod, 3, exec, pavucontrol" # pos 1 2 audiocontrol - "Ctrl+$mod, 5, exec, gnome-characters" # pos 2 2 special chars - "Ctrl+Alt, 8, exec, hyprpicker | tee >(wl-copy) | cliphist store" # pos 3 2 colorpicker - "Ctrl+Alt, 0, exec, custom-tomato" # pos 1 3 pomodoro app - "Ctrl+Alt, 2, exec, custom-bottom" # pos 2 3 btm (like htop but cleaner) - "Ctrl+Alt, 9, exec, anki" -# if hyprexpo plugin enabled bind = $mainMod, Space, hyprexpo:expo, toggle - # maybe exec sudo framework-tools-tui + #plugins keybindings + #"$mod, SPACE, overview:toggle, " + ]; + binde = [ + "$mod+Shift, Right, resizeactive, 30 0" + "$mod+Shift, Left, resizeactive, -30, 0" + "$mod+Shift, Up, resizeactive, 0 -30" + "$mod+Shift, Down, resizeactive,m 0 30" + ]; + bindl = [ + ", F1, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle" #toggle audio mute + ", F5, exec, playerctl play-pause" # media F4-F6 + ", F4, exec, playerctl previous" + ", F6, exec, playerctl next" + ]; + bindel = [ + ", F2, exec, pactl set-sink-volume @DEFAULT_SINK@ -10%" # decrease volume + ", F3, exec, pactl set-sink-volume @DEFAULT_SINK@ +10%" # increase volume + ", F7, exec, brightnessctl s 10%-" # decrease brightness + ", F8, exec, brightnessctl s +10%" # increase brightness + ]; + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod, Z, movewindow" + "$mod, X, resizewindow" + ]; + # █░░ ▄▀█ █░█ █▄░█ █▀▀ █░█ + # █▄▄ █▀█ █▄█ █░▀█ █▄▄ █▀█ + exec-once = [ + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # for XDPH + "dbus-update-activation-environment --systemd --all" # for XDPH + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # for XDPH + "systemctl --user start xdg-desktop-portal-wlr.service" + "blueman-applet" # systray app for Bluetooth + "udiskie --no-automount --smart-tray" # front-end that allows to manage removable media + "nm-applet --indicator" # systray app for Network/wifi + "wl-paste --type text --watch cliphist store" # clipboard store text data + "wl-paste --type image --watch cliphist store" # clipboard store image data + "custom-batterynotify" + "custom-batterywarning" + #wallpapers/b + "swww img ${wallpaper}" + "swww-daemon" + "sleep 1 && custom-wallpaper" + "custom-mountkdrive" + "waybar" + "custom-gitnotify" - #plugins keybindings - #"$mod, SPACE, overview:toggle, " + ######################### + # login autostart + ####################### + "[workspace 1 silent] sleep 1 && kitty -o font_size=16 -e sh -c 'custom-weather'" + "[workspace 1 silent] sleep 1 && kitty -o font_size=11 -e sh -c 'custom-cowsay'" + "[workspace 1 silent] kitty -e 'custom-launch'" + "[workspace 1 silent] sleep 1 && kitty -o font_size=5 -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T " + "[workspace 1 silent] sleep 1 && kitty -o font_size=1 -e sh -c 'cmatrix -br'" + ###################### + ###################### + ]; - ]; - binde = [ - "$mod+Shift, Right, resizeactive, 30 0" - "$mod+Shift, Left, resizeactive, -30, 0" - "$mod+Shift, Up, resizeactive, 0 -30" - "$mod+Shift, Down, resizeactive,m 0 30" - ]; - bindl = [ - ", F1, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle" #toggle audio mute - ", F5, exec, playerctl play-pause" # media F4-F6 - ", F4, exec, playerctl previous" - ", F6, exec, playerctl next" - ]; - bindel = [ - ", F2, exec, pactl set-sink-volume @DEFAULT_SINK@ -10%" # decrease volume - ", F3, exec, pactl set-sink-volume @DEFAULT_SINK@ +10%" # increase volume - ", F7, exec, brightnessctl s 10%-" # decrease brightness - ", F8, exec, brightnessctl s +10%" # increase brightness - ]; - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - "$mod, Z, movewindow" - "$mod, X, resizewindow" - ]; -# █░░ ▄▀█ █░█ █▄░█ █▀▀ █░█ -# █▄▄ █▀█ █▄█ █░▀█ █▄▄ █▀█ - exec-once = [ - "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # for XDPH - "dbus-update-activation-environment --systemd --all" # for XDPH - "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # for XDPH - "systemctl --user start xdg-desktop-portal-wlr.service" - "blueman-applet" # systray app for Bluetooth - "udiskie --no-automount --smart-tray" # front-end that allows to manage removable media - "nm-applet --indicator" # systray app for Network/wifi - "wl-paste --type text --watch cliphist store" # clipboard store text data - "wl-paste --type image --watch cliphist store" # clipboard store image data - "custom-batterynotify" - "custom-batterywarning" - #wallpapers/b - "swww img ${wallpaper}" - "swww-daemon" - "sleep 1 && custom-wallpaper" - "custom-mountkdrive" - "waybar" - "custom-gitnotify" + # gestures (also keybindings) + gesture = [ + "3, right, move, +col" + "3, left, move, -col" + ]; - ######################### - # login autostart - ####################### - "[workspace 1 silent] sleep 1 && kitty -o font_size=16 -e sh -c 'custom-weather'" - "[workspace 1 silent] sleep 1 && kitty -o font_size=11 -e sh -c 'custom-cowsay'" - "[workspace 1 silent] kitty -e 'custom-launch'" - "[workspace 1 silent] sleep 1 && kitty -o font_size=5 -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T " - "[workspace 1 silent] sleep 1 && kitty -o font_size=1 -e sh -c 'cmatrix -br'" - ###################### - ###################### - ]; + # █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀ + # █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█ -# gestures (also keybindings) - gesture = [ - "3, right, move, +col" - "3, left, move, -col" - ]; + dwindle = { + pseudotile = true; + preserve_split = true; + }; + # █▀▄▀█ █ █▀ █▀▀ + # █░▀░█ █ ▄█ █▄▄ -# █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀ -# █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█ + misc = { + vrr = 0; + force_default_wallpaper = 0; + }; + xwayland = { + force_zero_scaling = true; + }; - dwindle = { - pseudotile = true; - preserve_split = true; - }; + # █▀▄▀█ █▀█ █▄░█ █ ▀█▀ █▀█ █▀█ + # █░▀░█ █▄█ █#░▀█ █ ░█░ █▄█ █▀▄ + monitor = [ + #",preferred, auto, auto" + "eDP-1, highres@highrr, 0x0, 1" + "HDMI-A-1, highres2highrr, auto-left, 1" + ]; + # _______ ___ __ __ _______ ___ __ _ _______ + #| || | | | | || || | | | | || | + #| _ || | | | | || ___|| | | |_| || _____| + #| |_| || | | |_| || | __ | | | || |_____ + #| ___|| |___ | || || || | | _ ||_____ | + #| | | || || |_| || | | | | | _____| | + #|___| |_______||_______||_______||___| |_| |__||_______| + # + "plugin:dynamic-cursors" = { + enabled = true; + threshold = 2; + mode = "rotate"; + rotate = { + # length in px of the simulated stick used to rotate the cursor + # most realistic if this is your actual cursor size + length = 20; + offset = 0; + }; + shake = { + enabled = true; + # use nearest-neighbour (pixelated) scaling when shaking + # may look weird when effects are enabled + nearest = true; + threshold = 4; + # magnification level immediately after shake start + base = 4.0; + # magnification increase per second when continuing to shake + speed = 4.0; + # how much the speed is influenced by the current shake intensitiy + influence = 0.0; -# █▀▄▀█ █ █▀ █▀▀ -# █░▀░█ █ ▄█ █▄▄ + # maximal magnification the cursor can reach + # values below 1 disable the limit (e.g. 0) + limit = 0.0; - misc = { - vrr = 0; - force_default_wallpaper = 0; - }; - xwayland = { - force_zero_scaling = true; - }; + # time in millseconds the cursor will stay magnified after a shake has ended + timeout = 2000; -# █▀▄▀█ █▀█ █▄░█ █ ▀█▀ █▀█ █▀█ -# █░▀░█ █▄█ █#░▀█ █ ░█░ █▄█ █▀▄ - monitor = [ - #",preferred, auto, auto" - "eDP-1, highres@highrr, 0x0, 1" - "HDMI-A-1, highres2highrr, auto-left, 1" - ]; -# _______ ___ __ __ _______ ___ __ _ _______ -#| || | | | | || || | | | | || | -#| _ || | | | | || ___|| | | |_| || _____| -#| |_| || | | |_| || | __ | | | || |_____ -#| ___|| |___ | || || || | | _ ||_____ | -#| | | || || |_| || | | | | | _____| | -#|___| |_______||_______||_______||___| |_| |__||_______| -# - "plugin:dynamic-cursors" = { - enabled = true; - threshold = 2; - mode = "rotate"; - rotate = { - # length in px of the simulated stick used to rotate the cursor - # most realistic if this is your actual cursor size - length = 20; - offset = 0; - }; - shake = { - enabled = true; - # use nearest-neighbour (pixelated) scaling when shaking - # may look weird when effects are enabled - nearest = true; - threshold = 4; - # magnification level immediately after shake start - base = 4.0; - # magnification increase per second when continuing to shake - speed = 4.0; - # how much the speed is influenced by the current shake intensitiy - influence = 0.0; + # show cursor behaviour `tilt`, `rotate`, etc. while shaking + effects = true; - # maximal magnification the cursor can reach - # values below 1 disable the limit (e.g. 0) - limit = 0.0; + # enable ipc events for shake + ipc = false; + }; + }; + "plugin:overview" = { + disableGestures = true; + showEmptyWorkspace = true; + workspaceActiveBorder = "rgb(ab7746)"; + disableBlur = true; + }; - # time in millseconds the cursor will stay magnified after a shake has ended - timeout = 2000; + ##################################################### + ##################################################### + # theme + decoration = { + dim_special = 0.3; + blur = { + special = true; + enabled = true; + size = 4; + passes = 2; + new_optimizations = true; + ignore_opacity = true; + }; + }; + general = { + gaps_in = 3; + gaps_out = 8; + border_size = 4; + "col.active_border" = "rgba(ca6702ff) rgba(ecd3a0ff) 45deg"; + "col.inactive_border" = "rgba(f1dca7d9) rgba(ffe1a8d9) 45deg"; + layout = "dwindle"; + resize_on_border = true; + }; + group = { + "col.border_active" = "rgba(ca6702ff) rgba(ecd3a0ff) 45deg"; + "col.border_inactive" = "rgba(f1dca7d9) rgba(ffe1a8d9) 45deg"; + "col.border_locked_active" = "rgba(ca6702ff) rgba(ecd3a0ff) 45deg"; + "col.border_locked_inactive" = "rgba(f1dca7d9) rgba(ffe1a8d9) 45deg"; + }; + #################################################### + ################################################## - # show cursor behaviour `tilt`, `rotate`, etc. while shaking - effects = true; + # /$$ /$$ /$$ + #| $$ /$ | $$ | $$ + #| $$ /$$$| $$ /$$$$$$ /$$$$$$ | $$ /$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ + #| $$/$$ $$ $$ /$$__ $$ /$$__ $$| $$ /$$/ /$$_____/ /$$__ $$ |____ $$ /$$_____/ /$$__ $$ + #| $$$$_ $$$$| $$ \ $$| $$ \__/| $$$$$$/ | $$$$$$ | $$ \ $$ /$$$$$$$| $$ | $$$$$$$$ + #| $$$/ \ $$$| $$ | $$| $$ | $$_ $$ \____ $$| $$ | $$ /$$__ $$| $$ | $$_____/ + #| $$/ \ $$| $$$$$$/| $$ | $$ \ $$ /$$$$$$$/| $$$$$$$/| $$$$$$$| $$$$$$$| $$$$$$$ + #|__/ \__/ \______/ |__/ |__/ \__/|_______/ | $$____/ \_______/ \_______/ \_______/ + # | $$ + # | $$ + # |__/ + # see https://wiki.hypr.land/Configuring/Workspace-Rules/ + workspace = [ + "1, layout:master" + "2, layout:scrolling, layoutopt:direction:right" + "name:special, layout:scrolling" + # used for smart gaps along some windowrules + "w[tv1], gapsout:0, gapsin:0" + "f[1], gapsout:0, gapsin:0" + ]; - # enable ipc events for shake - ipc = false; - }; - }; - "plugin:overview" = { - disableGestures = true; - showEmptyWorkspace = true; - workspaceActiveBorder = "rgb(ab7746)"; - disableBlur = true; - }; - -##################################################### -##################################################### -# theme - decoration = { - dim_special = 0.3; - blur = { - special = true; - enabled = true; - size = 4; - passes = 2; - new_optimizations = true; - ignore_opacity = true; - }; - }; - general = { - gaps_in = 3; - gaps_out = 8; - border_size = 4; - "col.active_border" = "rgba(ca6702ff) rgba(ecd3a0ff) 45deg"; - "col.inactive_border" = "rgba(f1dca7d9) rgba(ffe1a8d9) 45deg"; - layout = "dwindle"; - resize_on_border = true; - - - }; - group = { - "col.border_active" = "rgba(ca6702ff) rgba(ecd3a0ff) 45deg"; - "col.border_inactive" = "rgba(f1dca7d9) rgba(ffe1a8d9) 45deg"; - "col.border_locked_active" = "rgba(ca6702ff) rgba(ecd3a0ff) 45deg"; - "col.border_locked_inactive" = "rgba(f1dca7d9) rgba(ffe1a8d9) 45deg"; - }; -#################################################### -################################################## - -# /$$ /$$ /$$ -#| $$ /$ | $$ | $$ -#| $$ /$$$| $$ /$$$$$$ /$$$$$$ | $$ /$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ -#| $$/$$ $$ $$ /$$__ $$ /$$__ $$| $$ /$$/ /$$_____/ /$$__ $$ |____ $$ /$$_____/ /$$__ $$ -#| $$$$_ $$$$| $$ \ $$| $$ \__/| $$$$$$/ | $$$$$$ | $$ \ $$ /$$$$$$$| $$ | $$$$$$$$ -#| $$$/ \ $$$| $$ | $$| $$ | $$_ $$ \____ $$| $$ | $$ /$$__ $$| $$ | $$_____/ -#| $$/ \ $$| $$$$$$/| $$ | $$ \ $$ /$$$$$$$/| $$$$$$$/| $$$$$$$| $$$$$$$| $$$$$$$ -#|__/ \__/ \______/ |__/ |__/ \__/|_______/ | $$____/ \_______/ \_______/ \_______/ -# | $$ -# | $$ -# |__/ -# see https://wiki.hypr.land/Configuring/Workspace-Rules/ - workspace = [ - "1, layout:master" - "2, layout:scrolling, layoutopt:direction:right" - "name:special, layout:scrolling" - # used for smart gaps along some windowrules - "w[tv1], gapsout:0, gapsin:0" - "f[1], gapsout:0, gapsin:0" - ]; - - - -# █░█░█ █ █▄░█ █▀▄ █▀█ █░█░█   █▀█ █░█ █░░ █▀▀ █▀ -# ▀▄▀▄▀ █ █░▀█ █▄▀ █▄█ ▀▄▀▄▀   █▀▄ █▄█ █▄▄ ██▄ ▄█ - windowrule = [ -"opacity 0.90 0.90, match:class ^(firefox)$" -"opacity 0.90 0.90, match:class ^(Brave-browser)$" -"opacity 0.80 0.80, match:class ^(code-oss)$" -"opacity 0.80 0.80, match:class ^(Code)$" -"opacity 0.80 0.80, match:class ^(code-url-handler)$" -"opacity 0.80 0.80, match:class ^(code-insiders-url-handler)$" -"opacity 0.75 0.75, match:class ^(kitty)$" -"opacity 0.80 0.80, match:class ^(org.kde.dolphin)$" -"opacity 0.80 0.80, float on, match:class ^(org.kde.ark)$" -"opacity 0.80 0.80, float on, match:class ^(nwg-look)$" -"opacity 0.80 0.80, float on, match:class ^(qt5ct)$" -"opacity 0.80 0.80, float on, match:class ^(qt6ct)$" -"opacity 0.80 0.80, float on, match:class ^(kvantummanager)$" -"opacity 0.80 0.70, float on, match:class ^(org.pulseaudio.pavucontrol)$" -"opacity 0.80 0.70, float on, match:class ^(blueman-manager)$" -"opacity 0.80 0.70, float on, match:class ^(nm-applet)$" -"opacity 0.80 0.70, float on, match:class ^(nm-connection-editor)$" -"opacity 0.80 0.70, float on, match:class ^(org.kde.polkit-kde-authentication-agent-1)$" -"opacity 0.80 0.70, match:class ^(polkit-gnome-authentication-agent-1)$" -"opacity 0.80 0.70, match:class ^(org.freedesktop.impl.portal.desktop.gtk)$" -"opacity 0.80 0.70, match:class ^(org.freedesktop.impl.portal.desktop.hyprland)$" -"opacity 0.70 0.70, match:class ^([Ss]team)$" -"opacity 0.70 0.70, match:class ^(steamwebhelper)$" -"opacity 0.70 0.70, match:class ^(Spotify)$" -"opacity 0.70 0.70, match:initial_title ^(Spotify Free)$" -"opacity 0.90 0.90, float on, match:class ^(com.github.rafostar.Clapper)$" -"opacity 0.80 0.80, match:class ^(com.github.tchx84.Flatseal)$" -"opacity 0.80 0.80, match:class ^(hu.kramo.Cartridges)$" -"opacity 0.80 0.80, match:class ^(com.obsproject.Studio)$" -"opacity 0.80 0.80, match:class ^(gnome-boxes)$" -"opacity 0.80 0.80, match:class ^(discord)$" -"opacity 0.80 0.80, match:class ^(WebCord)$" -"opacity 0.80 0.80, match:class ^(ArmCord)$" -"opacity 0.80 0.80, float on, match:class ^(app.drey.Warp)$" -"opacity 0.80 0.80, float on, match:class ^(net.davidotek.pupgui2)$" -"opacity 0.80 0.80, float on, match:class ^(yad)$" -"opacity 0.80 0.80, float on, match:class ^(Signal)$" -"opacity 0.80 0.80, float on, match:class ^(io.github.alainm23.planify)$" -"opacity 0.80 0.80, float on, match:class ^(io.gitlab.theevilskeleton.Upscaler)$" -"opacity 0.80 0.80, float on, match:class ^(com.github.unrud.VideoDownloader)$" -"opacity 0.80 0.80, float on, match:class ^(io.gitlab.adhami3310.Impression)$" -"opacity 0.80 0.80, float on, match:class ^(io.missioncenter.MissionCenter)$" -"opacity 0.80 0.80, match:class ^(io.github.flattool.Warehouse)$" -"float on, match:class ^(org.kde.dolphin)$, match:title ^(Progress Dialog — Dolphin)$" -"float on, match:class ^(org.kde.dolphin)$, match:title ^(Copying — Dolphin)$" -"float on, match:class ^(firefox)$, match:title ^(Picture-in-Picture)$" -"float on, match:class ^(firefox)$, match:title ^(Library)$" -"float on, match:class ^(kitty)$, match:title ^(top)$" -"float on, match:class ^(kitty)$, match:title ^(btop)$" -"float on, match:class ^(kitty)$, match:title ^(htop)$" -"float on, match:class ^(vlc)$" -"float on, match:class ^(eog)$" -"float on, size 400 175, match:class ^(custom-librewolfprofiles)$" -"float on, size 600 600, match:initial_class ^(custom-pomodoro)$" -"float on, size 1500 800, match:initial_class ^(custom-bottom)$" -"border_size 0, match:float 0, match:workspace w[tv1]" -"rounding 0, match:float 0, match:workspace w[tv1]" -"border_size 0, match:float 0, match:workspace f[1]" -"rounding 0, match:float 0, match:workspace f[1]" -]; -# add a float for tomato when in kitty -#"plugin:imgborders:noimgborders, tag:noborder" -layerrule = [ -"blur on, ignore_alpha 0, match:namespace rofi" -"blur on, ignore_alpha 0, match:namespace notifications" -"blur on, ignore_alpha 0, match:namespace swaync-notification-window" -"blur on, ignore_alpha 0, match:namespace swaync-control-center" -"blur on, match:namespace logout_dialog" -]; - }; + # █░█░█ █ █▄░█ █▀▄ █▀█ █░█░█   █▀█ █░█ █░░ █▀▀ █▀ + # ▀▄▀▄▀ █ █░▀█ █▄▀ █▄█ ▀▄▀▄▀   █▀▄ █▄█ █▄▄ ██▄ ▄█ + windowrule = [ + "opacity 0.90 0.90, match:class ^(firefox)$" + "opacity 0.90 0.90, match:class ^(Brave-browser)$" + "opacity 0.80 0.80, match:class ^(code-oss)$" + "opacity 0.80 0.80, match:class ^(Code)$" + "opacity 0.80 0.80, match:class ^(code-url-handler)$" + "opacity 0.80 0.80, match:class ^(code-insiders-url-handler)$" + "opacity 0.75 0.75, match:class ^(kitty)$" + "opacity 0.80 0.80, match:class ^(org.kde.dolphin)$" + "opacity 0.80 0.80, float on, match:class ^(org.kde.ark)$" + "opacity 0.80 0.80, float on, match:class ^(nwg-look)$" + "opacity 0.80 0.80, float on, match:class ^(qt5ct)$" + "opacity 0.80 0.80, float on, match:class ^(qt6ct)$" + "opacity 0.80 0.80, float on, match:class ^(kvantummanager)$" + "opacity 0.80 0.70, float on, match:class ^(org.pulseaudio.pavucontrol)$" + "opacity 0.80 0.70, float on, match:class ^(blueman-manager)$" + "opacity 0.80 0.70, float on, match:class ^(nm-applet)$" + "opacity 0.80 0.70, float on, match:class ^(nm-connection-editor)$" + "opacity 0.80 0.70, float on, match:class ^(org.kde.polkit-kde-authentication-agent-1)$" + "opacity 0.80 0.70, match:class ^(polkit-gnome-authentication-agent-1)$" + "opacity 0.80 0.70, match:class ^(org.freedesktop.impl.portal.desktop.gtk)$" + "opacity 0.80 0.70, match:class ^(org.freedesktop.impl.portal.desktop.hyprland)$" + "opacity 0.70 0.70, match:class ^([Ss]team)$" + "opacity 0.70 0.70, match:class ^(steamwebhelper)$" + "opacity 0.70 0.70, match:class ^(Spotify)$" + "opacity 0.70 0.70, match:initial_title ^(Spotify Free)$" + "opacity 0.90 0.90, float on, match:class ^(com.github.rafostar.Clapper)$" + "opacity 0.80 0.80, match:class ^(com.github.tchx84.Flatseal)$" + "opacity 0.80 0.80, match:class ^(hu.kramo.Cartridges)$" + "opacity 0.80 0.80, match:class ^(com.obsproject.Studio)$" + "opacity 0.80 0.80, match:class ^(gnome-boxes)$" + "opacity 0.80 0.80, match:class ^(discord)$" + "opacity 0.80 0.80, match:class ^(WebCord)$" + "opacity 0.80 0.80, match:class ^(ArmCord)$" + "opacity 0.80 0.80, float on, match:class ^(app.drey.Warp)$" + "opacity 0.80 0.80, float on, match:class ^(net.davidotek.pupgui2)$" + "opacity 0.80 0.80, float on, match:class ^(yad)$" + "opacity 0.80 0.80, float on, match:class ^(Signal)$" + "opacity 0.80 0.80, float on, match:class ^(io.github.alainm23.planify)$" + "opacity 0.80 0.80, float on, match:class ^(io.gitlab.theevilskeleton.Upscaler)$" + "opacity 0.80 0.80, float on, match:class ^(com.github.unrud.VideoDownloader)$" + "opacity 0.80 0.80, float on, match:class ^(io.gitlab.adhami3310.Impression)$" + "opacity 0.80 0.80, float on, match:class ^(io.missioncenter.MissionCenter)$" + "opacity 0.80 0.80, match:class ^(io.github.flattool.Warehouse)$" + "float on, match:class ^(org.kde.dolphin)$, match:title ^(Progress Dialog — Dolphin)$" + "float on, match:class ^(org.kde.dolphin)$, match:title ^(Copying — Dolphin)$" + "float on, match:class ^(firefox)$, match:title ^(Picture-in-Picture)$" + "float on, match:class ^(firefox)$, match:title ^(Library)$" + "float on, match:class ^(kitty)$, match:title ^(top)$" + "float on, match:class ^(kitty)$, match:title ^(btop)$" + "float on, match:class ^(kitty)$, match:title ^(htop)$" + "float on, match:class ^(vlc)$" + "float on, match:class ^(eog)$" + "float on, size 400 175, match:class ^(custom-librewolfprofiles)$" + "float on, size 600 600, match:initial_class ^(custom-pomodoro)$" + "float on, size 1500 800, match:initial_class ^(custom-bottom)$" + "border_size 0, match:float 0, match:workspace w[tv1]" + "rounding 0, match:float 0, match:workspace w[tv1]" + "border_size 0, match:float 0, match:workspace f[1]" + "rounding 0, match:float 0, match:workspace f[1]" + ]; + # add a float for tomato when in kitty + #"plugin:imgborders:noimgborders, tag:noborder" + layerrule = [ + "blur on, ignore_alpha 0, match:namespace rofi" + "blur on, ignore_alpha 0, match:namespace notifications" + "blur on, ignore_alpha 0, match:namespace swaync-notification-window" + "blur on, ignore_alpha 0, match:namespace swaync-control-center" + "blur on, match:namespace logout_dialog" + ]; + }; } - - diff --git a/modules/home-manager/kitty.nix b/modules/home-manager/kitty.nix index 92d25d7..b17e216 100644 --- a/modules/home-manager/kitty.nix +++ b/modules/home-manager/kitty.nix @@ -1,60 +1,62 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.kitty = { enable = true; #font.name = nerd-fonts._0xproto; #font.size = "10"; extraConfig = '' -# font nerd-fonts._0xproto # this key dont work and causes errors -font_size 14 -bold_font auto -italic_font auto -bold_italic_font auto -window_padding_width 25 -foreground #FFFFFF -background #1B1D1C -selection_foreground #1B1D1C -selection_background #FFFFFF -cursor #C3AC76 -cursor_text_color #0F1010 + # font nerd-fonts._0xproto # this key dont work and causes errors + font_size 14 + bold_font auto + italic_font auto + bold_italic_font auto + window_padding_width 25 + foreground #FFFFFF + background #1B1D1C + selection_foreground #1B1D1C + selection_background #FFFFFF + cursor #C3AC76 + cursor_text_color #0F1010 -active_tab_foreground #1B1D1C -active_tab_background #6B5540 -inactive_tab_foreground #6B5540 -inactive_tab_background #1B1D1C + active_tab_foreground #1B1D1C + active_tab_background #6B5540 + inactive_tab_foreground #6B5540 + inactive_tab_background #1B1D1C -# black -color0 #29523D -color8 #578F73 + # black + color0 #29523D + color8 #578F73 -# red -color1 #FFF0CC -color9 #F0DBAA + # red + color1 #FFF0CC + color9 #F0DBAA -# green -color2 #FFEECC -color10 #F0D9AA + # green + color2 #FFEECC + color10 #F0D9AA -# yellow -color3 #FFE5CC -color11 #F0CCAA + # yellow + color3 #FFE5CC + color11 #F0CCAA -# blue -color4 #9AE6C0 -color12 #9AE6C0 + # blue + color4 #9AE6C0 + color12 #9AE6C0 -# magenta -color5 #E6CC9A -color13 #E6CC9A + # magenta + color5 #E6CC9A + color13 #E6CC9A -# cyan -color6 #E6BF9A -color14 #E6BF9A + # cyan + color6 #E6BF9A + color14 #E6BF9A -# white -color7 #FFF0CC -color15 #F0DBAA -''; -}; + # white + color7 #FFF0CC + color15 #F0DBAA + ''; + }; } diff --git a/modules/home-manager/librewolf.nix b/modules/home-manager/librewolf.nix index 6f36ec0..3bf6b80 100644 --- a/modules/home-manager/librewolf.nix +++ b/modules/home-manager/librewolf.nix @@ -1,6 +1,9 @@ # adapted from https://github.com/contre95/dotfiles/blob/main/dotfiles/nixos/programs/librewolf.nix -{ pkgs, config, ... }: { + pkgs, + config, + ... +}: { home.sessionVariables = { MOZ_ENABLE_WAYLAND = 1; MOZ_USE_XINPUT2 = 1; @@ -9,117 +12,116 @@ programs.librewolf = { enable = true; settings = { - "browser.profiles.enabled" = true; - # disabled until i find something that uses it. - "webgl.disabled" = true; - # settings = lib.mapAttrs' (n: lib.nameValuePair "pref.${n}") { - "app.update.auto" = true; # disable auto update - #"dom.security.https_only_mode" = true; # force https - "extensions.pocket.enabled" = false; # disable pocket - #"browser.quitShortcut.disabled" = true; # disable ctrl+q - "browser.download.panel.shown" = true; # show download panel - "signon.rememberSignons" = false; # disable saving passwords - "identity.fxaccounts.enabled" = false; # disable librewolf accounts - "app.shield.optoutstudies.enabled" = false; # disable shield studies - "browser.shell.checkDefaultBrowser" = false; # don't check if default browser - #"browser.bookmarks.restore_default_bookmarks" = false; # don't restore default bookmarks - # Download handling - #"browser.download.dir" = "/home/meain/down"; # default download dir - "browser.startup.page" = 3; # restore previous session - # UI changes - # "browser.uidensity" = 1; # enable dense UI - #"general.autoScroll" = true; # enable autoscroll - # "browser.compactmode.show" = true; # enable compact mode - # "browser.tabs.firefox-view" = false; # enable librewolf view - #"startup.homepage_welcome_url" = - # "https://metrics.internal.contre.io/d/cUITC74Vksd/podman-revamped?orgId=1&from=2026-02-23T19:29:26.304Z&to=2026-02-23T19:59:26.304Z&timezone=browser&var-Filters=&var-namespace=alloy&var-level=error&var-level=debug&var-level=info&var-level=warn&refresh=5s&kiosk=true"; # disable welcome page - "browser.newtabpage.enabled" = true; # disable new tab page - "full-screen-api.ignore-widgets" = true; # fullscreen within window - "browser.toolbars.bookmarks.visibility" = "always"; # hide bookmarks toolbar - "browser.aboutConfig.showWarning" = false; # disable warning about about:config - "media.videocontrols.picture-in-picture.video-toggle.enabled" = false; # disable picture in picture button + "browser.profiles.enabled" = true; + # disabled until i find something that uses it. + "webgl.disabled" = true; + # settings = lib.mapAttrs' (n: lib.nameValuePair "pref.${n}") { + "app.update.auto" = true; # disable auto update + #"dom.security.https_only_mode" = true; # force https + "extensions.pocket.enabled" = false; # disable pocket + #"browser.quitShortcut.disabled" = true; # disable ctrl+q + "browser.download.panel.shown" = true; # show download panel + "signon.rememberSignons" = false; # disable saving passwords + "identity.fxaccounts.enabled" = false; # disable librewolf accounts + "app.shield.optoutstudies.enabled" = false; # disable shield studies + "browser.shell.checkDefaultBrowser" = false; # don't check if default browser + #"browser.bookmarks.restore_default_bookmarks" = false; # don't restore default bookmarks + # Download handling + #"browser.download.dir" = "/home/meain/down"; # default download dir + "browser.startup.page" = 3; # restore previous session + # UI changes + # "browser.uidensity" = 1; # enable dense UI + #"general.autoScroll" = true; # enable autoscroll + # "browser.compactmode.show" = true; # enable compact mode + # "browser.tabs.firefox-view" = false; # enable librewolf view + #"startup.homepage_welcome_url" = + # "https://metrics.internal.contre.io/d/cUITC74Vksd/podman-revamped?orgId=1&from=2026-02-23T19:29:26.304Z&to=2026-02-23T19:59:26.304Z&timezone=browser&var-Filters=&var-namespace=alloy&var-level=error&var-level=debug&var-level=info&var-level=warn&refresh=5s&kiosk=true"; # disable welcome page + "browser.newtabpage.enabled" = true; # disable new tab page + "full-screen-api.ignore-widgets" = true; # fullscreen within window + "browser.toolbars.bookmarks.visibility" = "always"; # hide bookmarks toolbar + "browser.aboutConfig.showWarning" = false; # disable warning about about:config + "media.videocontrols.picture-in-picture.video-toggle.enabled" = false; # disable picture in picture button - # Privacy - "privacy.resistFingerprinting" = true; - # "privacy.clearOnShutdown.cache" = false; - "privacy.clearOnShutdown.history" = false; - "privacy.clearHistory.cookiesAndStorage" = false; - "privacy.clearHistory.historyFormDataAndDownloads" = false; - "privacy.clearHistory.cache" = false; - "privacy.clearOnShutdown_v2.siteSettings" = false; - "privacy.clearOnShutdown_v2.cookiesAndStorage" = false; - "services.sync.prefs.sync.privacy.clearOnShutdown_v2.history" = false; - "services.sync.prefs.sync.privacy.clearOnShutdown_v2.siteSettings" = false; - "services.sync.prefs.sync.privacy.clearOnShutdown_v2.sessions" = false; - "services.sync.prefs.sync.privacy.clearOnShutdown_v2.cookies" = false; - "services.sync.prefs.sync.privacy.clearOnShutdown.history" = false; - "services.sync.prefs.sync.privacy.clearOnShutdown.siteSettings" = false; - "services.sync.prefs.sync.privacy.clearOnShutdown.sessions" = false; - "services.sync.prefs.sync.privacy.clearOnShutdown.cookies" = false; - "privacy.clearOnShutdown.cookies" = false; - "browser.discovery.enabled" = false; # disable discovery - "browser.search.suggest.enabled" = true; # disable search suggestions - "browser.contentblocking.category" = "standart"; # set tracking protection to standart to not interfer with adnauseam - "dom.private-attribution.submission.enabled" = false; # stop doing dumb stuff mozilla - "browser.protections_panel.infoMessage.seen" = true; # disable tracking protection info + # Privacy + "privacy.resistFingerprinting" = true; + # "privacy.clearOnShutdown.cache" = false; + "privacy.clearOnShutdown.history" = false; + "privacy.clearHistory.cookiesAndStorage" = false; + "privacy.clearHistory.historyFormDataAndDownloads" = false; + "privacy.clearHistory.cache" = false; + "privacy.clearOnShutdown_v2.siteSettings" = false; + "privacy.clearOnShutdown_v2.cookiesAndStorage" = false; + "services.sync.prefs.sync.privacy.clearOnShutdown_v2.history" = false; + "services.sync.prefs.sync.privacy.clearOnShutdown_v2.siteSettings" = false; + "services.sync.prefs.sync.privacy.clearOnShutdown_v2.sessions" = false; + "services.sync.prefs.sync.privacy.clearOnShutdown_v2.cookies" = false; + "services.sync.prefs.sync.privacy.clearOnShutdown.history" = false; + "services.sync.prefs.sync.privacy.clearOnShutdown.siteSettings" = false; + "services.sync.prefs.sync.privacy.clearOnShutdown.sessions" = false; + "services.sync.prefs.sync.privacy.clearOnShutdown.cookies" = false; + "privacy.clearOnShutdown.cookies" = false; + "browser.discovery.enabled" = false; # disable discovery + "browser.search.suggest.enabled" = true; # disable search suggestions + "browser.contentblocking.category" = "standart"; # set tracking protection to standart to not interfer with adnauseam + "dom.private-attribution.submission.enabled" = false; # stop doing dumb stuff mozilla + "browser.protections_panel.infoMessage.seen" = true; # disable tracking protection info - # Theme - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "svg.context-properties.content.enabled" = true; - "layout.css.color-mix.enabled" = true; + # Theme + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "svg.context-properties.content.enabled" = true; + "layout.css.color-mix.enabled" = true; - # Disable telemetry - "toolkit.telemetry.enabled" = false; - "toolkit.telemetry.unified" = false; - "browser.ping-centre.telemetry" = false; - "toolkit.telemetry.archive.enabled" = false; - "toolkit.telemetry.bhrPing.enabled" = false; - "toolkit.telemetry.updatePing.enabled" = false; - "browser.translations.automaticallyPopup" = false; - "toolkit.telemetry.hybridContent.enabled" = false; - "toolkit.telemetry.newProfilePing.enabled" = false; - "toolkit.telemetry.reportingpolicy.firstRun" = false; - "toolkit.telemetry.firstShutdownPing.enabled" = false; - "browser.newtabpage.activity-stream.telemetry" = false; - "toolkit.telemetry.shutdownPingSender.enabled" = false; - "browser.newtabpage.activity-stream.feeds.telemetry" = false; + # Disable telemetry + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.unified" = false; + "browser.ping-centre.telemetry" = false; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.updatePing.enabled" = false; + "browser.translations.automaticallyPopup" = false; + "toolkit.telemetry.hybridContent.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.reportingpolicy.firstRun" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "browser.newtabpage.activity-stream.telemetry" = false; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "browser.newtabpage.activity-stream.feeds.telemetry" = false; - "browser.tabs.loadInBackground" = true; # open new tab in background - "browser.tabs.loadBookmarksInTabs" = true; # open bookmarks in new tab - "browser.tabs.warnOnOpen" = false; # don't warn when opening multiple tabs - "browser.tabs.warnOnQuit" = false; # don't warn when closing multiple tabs - "browser.tabs.warnOnClose" = false; # don't warn when closing multiple tabs - "browser.tabs.loadDivertedInBackground" = false; # open new tab in background - "browser.tabs.warnOnCloseOtherTabs" = false; # don't warn when closing multiple tabs - "browser.tabs.closeWindowWithLastTab" = false; # don't close window when last tab is closed + "browser.tabs.loadInBackground" = true; # open new tab in background + "browser.tabs.loadBookmarksInTabs" = true; # open bookmarks in new tab + "browser.tabs.warnOnOpen" = false; # don't warn when opening multiple tabs + "browser.tabs.warnOnQuit" = false; # don't warn when closing multiple tabs + "browser.tabs.warnOnClose" = false; # don't warn when closing multiple tabs + "browser.tabs.loadDivertedInBackground" = false; # open new tab in background + "browser.tabs.warnOnCloseOtherTabs" = false; # don't warn when closing multiple tabs + "browser.tabs.closeWindowWithLastTab" = false; # don't close window when last tab is closed - # other - "media.autoplay.default" = 0; # enable autoplay on open - "devtools.toolbox.host" = "right"; # move devtools to right - "devtools.theme" = "dark"; - # "browser.ssb.enabled" = true; # enable site specific browser - "media.rdd-vpx.enabled" = true; # enable hardware acceleration - "devtools.cache.disabled" = true; # disable caching in devtools - "media.ffmpeg.vaapi.enabled" = true; # enable hardware acceleration - - # Fonts - "font.size.fixed.x-western" = 15; - "font.minimum-size.x-western" = 13; - "font.size.variable.x-western" = 15; - "font.size.monospace.x-western" = 15; - "browser.display.use_document_fonts" = 1; - "browser.link.open_newwindow.restriction" = 0; - # - # "browser.fixup.domainsuffixwhitelist.home" = true; - # "browser.fixup.domainwhitelist.internal.contre.io" = true; - "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; - # "keyword.enable" = false; # Disable search when typing unexistent TLD + # other + "media.autoplay.default" = 0; # enable autoplay on open + "devtools.toolbox.host" = "right"; # move devtools to right + "devtools.theme" = "dark"; + # "browser.ssb.enabled" = true; # enable site specific browser + "media.rdd-vpx.enabled" = true; # enable hardware acceleration + "devtools.cache.disabled" = true; # disable caching in devtools + "media.ffmpeg.vaapi.enabled" = true; # enable hardware acceleration + # Fonts + "font.size.fixed.x-western" = 15; + "font.minimum-size.x-western" = 13; + "font.size.variable.x-western" = 15; + "font.size.monospace.x-western" = 15; + "browser.display.use_document_fonts" = 1; + "browser.link.open_newwindow.restriction" = 0; + # + # "browser.fixup.domainsuffixwhitelist.home" = true; + # "browser.fixup.domainwhitelist.internal.contre.io" = true; + "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; + # "keyword.enable" = false; # Disable search when typing unexistent TLD }; policies = { ExtensionSettings = { # the extension id should be from the manifesto and not a random name. - # if you dont know it. Put a random name. It will fail. Go to about:polices#error and the error will give you the correct id. + # if you dont know it. Put a random name. It will fail. Go to about:polices#error and the error will give you the correct id. "enhancerforyoutube@maximerf.addons.mozilla.org" = { installation_mode = "normal_installed"; install_url = "https://addons.mozilla.org/firefox/downloads/latest/enhancer-for-youtube/latest.xpi"; @@ -292,7 +294,7 @@ settings = [ { name = "Nixos Config"; - tags = [ "github" ]; + tags = ["github"]; keyword = "github"; url = "https://github.com/Totorile1/nixos"; } @@ -329,7 +331,7 @@ template = "https://fr.wiktionary.org/w/index.php?search={searchTerms}"; } ]; - definedAliases = [ "dict" ]; + definedAliases = ["dict"]; }; "quant" = { urls = [ @@ -343,7 +345,7 @@ ]; } ]; - definedAliases = [ "q" ]; + definedAliases = ["q"]; }; "OpenStreeetMap" = { urls = [ @@ -357,7 +359,7 @@ ]; } ]; - definedAliases = [ "map" ]; + definedAliases = ["map"]; }; "Home Manager Options" = { urls = [ @@ -371,7 +373,7 @@ ]; } ]; - definedAliases = [ "hm" ]; + definedAliases = ["hm"]; }; "Nix Packages" = { urls = [ @@ -389,7 +391,7 @@ ]; } ]; - definedAliases = [ "np" ]; + definedAliases = ["np"]; }; "Nix Wiki" = { urls = [ @@ -397,7 +399,7 @@ template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ]; - definedAliases = [ "nw" ]; + definedAliases = ["nw"]; }; "Repology" = { urls = [ @@ -405,7 +407,7 @@ template = "https://repology.org/projects/?search={searchTerms}"; } ]; - definedAliases = [ "rp" ]; + definedAliases = ["rp"]; }; }; }; @@ -569,7 +571,7 @@ ]; } ]; - definedAliases = [ "q" ]; + definedAliases = ["q"]; }; "OpenStreeetMap" = { urls = [ @@ -583,20 +585,18 @@ ]; } ]; - definedAliases = [ "map" ]; + definedAliases = ["map"]; }; "Onche.org" = { urls = [ { - template = "https://onche.org/forum/1/blabla-general/search?by=topic&q={searchTerms}"; + template = "https://onche.org/forum/1/blabla-general/search?by=topic&q={searchTerms}"; } ]; - definedAliases = [ "on" ]; + definedAliases = ["on"]; }; }; }; - }; - }; } diff --git a/modules/home-manager/neovim.nix b/modules/home-manager/neovim.nix index 33222ce..4526c44 100644 --- a/modules/home-manager/neovim.nix +++ b/modules/home-manager/neovim.nix @@ -1,594 +1,596 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.neovim = { enable = true; vimAlias = true; viAlias = true; plugins = [ - pkgs.vimPlugins.vimtex - pkgs.vimPlugins.zoxide-vim - pkgs.vimPlugins.gruvbox - pkgs.vimPlugins.neovim-sensible - pkgs.vimPlugins.nvim-web-devicons - pkgs.vimPlugins.nvim-tree-lua - pkgs.vimPlugins.nvim-surround - pkgs.vimPlugins.floaterm - pkgs.vimPlugins.nvim-lspconfig - pkgs.vimPlugins.cmp-nvim-lsp - pkgs.vimPlugins.cmp-buffer - pkgs.vimPlugins.cmp-path - pkgs.vimPlugins.cmp-cmdline - pkgs.vimPlugins.nvim-cmp - pkgs.vimPlugins.cmp-vsnip - pkgs.vimPlugins.vim-vsnip - pkgs.vimPlugins.dashboard-nvim - pkgs.vimPlugins.lualine-nvim - # nix coloring and etc. - pkgs.vimPlugins.vim-nix - # required for Telescope - pkgs.vimPlugins.plenary-nvim - pkgs.vimPlugins.blink-ripgrep-nvim - pkgs.vimPlugins.nvim-treesitter - pkgs.vimPlugins.telescope-nvim - # scrollbar - pkgs.vimPlugins.nvim-scrollbar - # ufo - pkgs.vimPlugins.promise-async - pkgs.vimPlugins.nvim-ufo - # cheatsheet - pkgs.vimPlugins.cheatsheet-nvim - pkgs.vimPlugins.popup-nvim - # multiple cursor - #Plug 'brenton-leighton/multiple-cursors.nvim' - # i use instead the following: - pkgs.vimPlugins.vim-visual-multi -# plugins not found - #Plug 'arminveres/md-pdf.nvim' - #Plug "sharkdp/fd" - #Plug 'sontungexpt/better-diagnostic-virtual-text' + pkgs.vimPlugins.vimtex + pkgs.vimPlugins.zoxide-vim + pkgs.vimPlugins.gruvbox + pkgs.vimPlugins.neovim-sensible + pkgs.vimPlugins.nvim-web-devicons + pkgs.vimPlugins.nvim-tree-lua + pkgs.vimPlugins.nvim-surround + pkgs.vimPlugins.floaterm + pkgs.vimPlugins.nvim-lspconfig + pkgs.vimPlugins.cmp-nvim-lsp + pkgs.vimPlugins.cmp-buffer + pkgs.vimPlugins.cmp-path + pkgs.vimPlugins.cmp-cmdline + pkgs.vimPlugins.nvim-cmp + pkgs.vimPlugins.cmp-vsnip + pkgs.vimPlugins.vim-vsnip + pkgs.vimPlugins.dashboard-nvim + pkgs.vimPlugins.lualine-nvim + # nix coloring and etc. + pkgs.vimPlugins.vim-nix + # required for Telescope + pkgs.vimPlugins.plenary-nvim + pkgs.vimPlugins.blink-ripgrep-nvim + pkgs.vimPlugins.nvim-treesitter + pkgs.vimPlugins.telescope-nvim + # scrollbar + pkgs.vimPlugins.nvim-scrollbar + # ufo + pkgs.vimPlugins.promise-async + pkgs.vimPlugins.nvim-ufo + # cheatsheet + pkgs.vimPlugins.cheatsheet-nvim + pkgs.vimPlugins.popup-nvim + # multiple cursor + #Plug 'brenton-leighton/multiple-cursors.nvim' + # i use instead the following: + pkgs.vimPlugins.vim-visual-multi + # plugins not found + #Plug 'arminveres/md-pdf.nvim' + #Plug "sharkdp/fd" + #Plug 'sontungexpt/better-diagnostic-virtual-text' ]; extraLuaConfig = '' -local vim = vim --- local Plug = vim.fn['plug#'] -vim.g.mapleader ='ü' -vim.g.maplocalleader = 'ü' - --- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = true - --- [[ Setting options ]] --- See `:help vim.opt` --- NOTE: You can change these options as you wish! --- For more options, you can see `:help option-list` - --- Make line numbers default --- You can also add relative line numbers, to help with jumping. --- Experiment for yourself to see if you like it! -vim.opt.relativenumber = false - --- Enable mouse mode, can be useful for resizing splits for example! -vim.opt.mouse = 'a' - --- Don't show the mode, since it's already in the status line -vim.opt.showmode = false - --- Sync clipboard between OS and Neovim. --- Schedule the setting after `UiEnter` because it can increase startup-time. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.schedule(function() - vim.opt.clipboard = 'unnamedplus' -end) - - --- Enable break indent -vim.opt.breakindent = true - --- Save undo history -vim.opt.undofile = true - --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.opt.ignorecase = true -vim.opt.smartcase = true - --- Keep signcolumn on by default -vim.opt.signcolumn = 'yes' - --- Decrease update time -vim.opt.updatetime = 250 - --- Decrease mapped sequence wait time --- Displays which-key popup sooner -vim.opt.timeoutlen = 300 - --- Configure how new splits should be opened -vim.opt.splitright = true -vim.opt.splitbelow = true - --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` --- and `:help 'listchars'` -vim.opt.list = true -vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } - - - --- indentation settings - added by me --- refere to https://stackoverflow.com/questions/51995128/setting-autoindentation-to-spaces-in-neovim for more information -vim.opt.expandtab = true -vim.opt.smartindent = true -vim.opt.tabstop = 4 -vim.opt.shiftwidth = 4 - --- Preview substitutions live, as you type! -vim.opt.inccommand = 'split' - --- Show which line your cursor is on -vim.opt.cursorline = true - --- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 - --- [[ Basic Keymaps ]] --- See `:help vim.keymap.set()` - --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') - --- Diagnostic keymaps -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) - --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) - --- jump to next error -vim.keymap.set("n", "t", vim.diagnostic.goto_prev) -vim.keymap.set("n", "z", vim.diagnostic.goto_next) - - --- [[ Basic Autocommands ]] --- See `:help lua-guide-autocommands` - --- Highlight when yanking (copying) text --- Try it with `yap` in normal mode --- See `:help vim.highlight.on_yank()` -vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.highlight.on_yank() - end, -}) - ---require("multiple-cursors").setup({ --- version = "*", -- Use the latest tagged version --- opts = {}, -- This causes the plugin setup function to be called --- keys = { --- {"", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, --- {"", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, --- --- {"", "MultipleCursorsAddUp", mode = {"n", "i", "x"}, desc = "Add cursor and move up"}, --- {"", "MultipleCursorsAddDown", mode = {"n", "i", "x"}, desc = "Add cursor and move down"}, --- --- {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, --- --- {"m", "MultipleCursorsAddVisualArea", mode = {"x"}, desc = "Add cursors to the lines of the visual area"}, --- --- {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, --- {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, --- --- {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, --- {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, --- --- {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, --- }, ---}) - - -vim.keymap.set("n","§", "Cheatsheet") - -require("cheatsheet").setup({ - bundled_cheatsheets = { - -- only show the default cheatsheet - enabled = { "default" }, - }, - bundled_plugin_cheatsheets = { - -- show cheatsheets for all plugins except gitsigns - disabled = { "gitsigns.nvim" }, - } -}) - - - --- Can be applied to each buffer separately - -local default_options = { - ui = { - wrap_line_after = false, -- wrap the line after this length to avoid the virtual text is too long - left_kept_space = 3, --- the number of spaces kept on the left side of the virtual text, make sure it enough to custom for each line - right_kept_space = 3, --- the number of spaces kept on the right side of the virtual text, make sure it enough to custom for each line - arrow = "  ", - up_arrow = "  ", - down_arrow = "  ", - above = false, -- the virtual text will be displayed above the line - }, - priority = 2003, -- the priority of virtual text - inline = true, -} - - --- scrollbar -require("scrollbar").setup() - --- ufo https://github.com/kevinhwang91/nvim-ufo -vim.o.foldcolumn = '1' -- '0' is not bad -vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value -vim.o.foldlevelstart = 99 -vim.o.foldenable = true - --- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself -vim.keymap.set('n', '1', "foldopen") -vim.keymap.set('n', '2', "foldclose") -vim.keymap.set('n', '3', "openAllFold") -vim.keymap.set('n', '4', " closeAllFold") --- Option 3: treesitter as a main provider instead --- (Note: the `nvim-treesitter` plugin is *not* needed.) --- ufo uses the same query files for folding (queries//folds.scm) --- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()` ---vim.keymap.set('n', '1', function() require("ufo").foldopen() end, {buffer=0}) ---vim.keymap.set('n', '2', function() require("ufo").foldclose() end) - - - --- added by myself -require('ufo').setup({ - provider_selector = function(bufnr, filetype, buftype) - return {'treesitter', 'indent'} - end -}) - --- Color schemes should be loaded after plug#end(). -vim.o.background = "dark" -- or "light" for light mode --- Default options: ---require("gruvbox").setup({ --- terminal_colors = true, -- add neovim terminal colors --- undercurl = true, --- underline = true, --- bold = true, --- italic = { --- strings = true, --- emphasis = true, --- comments = true, --- operators = false, --- folds = true, --- }, --- strikethrough = true, --- invert_selection = false, --- invert_signs = false, --- invert_tabline = false, --- invert_intend_guides = false, --- inverse = true, -- invert background for search, diffs, statuslines and errors --- contrast = "", -- can be "hard", "soft" or empty string --- palette_overrides = {}, --- overrides = {}, --- dim_inactive = false, --- transparent_mode = false, ---}) -vim.cmd("colorscheme gruvbox") --- nvim-tree https://github.com/nvim-tree/nvim-tree.lua --- disable netrw at the very start of your init.lua -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - --- optionally enable 24-bit colour -vim.opt.termguicolors = true - - --- setup with some options -require("nvim-tree").setup({ - sort = { - sorter = "case_sensitive", - }, - view = { - width = 30, - }, - renderer = { - group_empty = true, - }, - filters = { - dotfiles = true, - }, -}) -vim.opt.number = true --- Uncomment for opening the navigable tree file systeme on startup of NeoVim ---vim.cmd('NvimTreeOpen') - ---require('md-pdf').setup({ --- --- Set margins around document --- margins = "1.5cm", --- -- tango, pygments are quite nice for white on white --- highlight = "tango", --- -- Generate a table of contents, on by default --- toc = true, --- -- Define a custom preview command, enabling hooks and other custom logic --- preview_cmd = function() return 'firefox' end, --- -- if true, then the markdown file is continuously converted on each write, even if the --- -- file viewer closed, e.g., firefox is "closed" once the document is opened in it. --- ignore_viewer_state = false, --- -- Specify font, `nil` uses the default font of the theme --- fonts = nil, --- -- or, where all or only some options can be specified. NOTE: those that are `nil` can be left --- -- out completely --- fonts = { --- main_font = nil, --- sans_font = "DejaVuSans", --- mono_font = "IosevkaTerm Nerd Font Mono", --- math_font = nil, --- }, --- -- Custom options passed to `pandoc` CLI call, can be ignored for setup --- pandoc_user_args = nil, --- -- or --- pandoc_user_args = { --- -- short --- "-V KEY[:VALUE]", --- -- long options --- "--standalone=[true|false]", --- }, --- --- Path to output. Needs to be always relative, e.g.: "./", "../", "./out" or simply "out", but --- --- not absolute e.g.: "/"! --- output_path = "", ---}) - --- setup mapping -vim.keymap.set("n", ",", function() - require('md-pdf').convert_md_to_pdf() -end) - -- Set up nvim-cmp. - local cmp = require'cmp' - - cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- require('snippy').expand_snippet(args.body) -- For `snippy` users. - -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. - -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) - end, - }, - window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'vsnip' }, -- For vsnip users. - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - }, { - { name = 'buffer' }, - }) - }) - - -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below - -- Set configuration for specific filetype. - --[[ cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'git' }, - }, { - { name = 'buffer' }, - }) - }) - require("cmp_git").setup() ]]-- - - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }) - - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }), - matching = { disallow_symbol_nonprefix_matching = false } - }) - - - -- require(lspconfig) is deprecated --- -- Set up lspconfig. --- local capabilities = require('cmp_nvim_lsp').default_capabilities() --- -- Replace with each lsp server you've enabled. --- require('lspconfig')['texlab'].setup { --- capabilities = capabilities --- } ---require'lspconfig'.clangd.setup{} ---lspconfig = require("lspconfig") ---lspconfig.pylsp.setup { ---on_attach = custom_attach, ---settings = { --- pylsp = { --- plugins = { --- -- formatter options --- black = { enabled = true }, --- autopep8 = { enabled = false }, --- yapf = { enabled = false }, --- -- linter options --- pylint = { enabled = true, executable = "pylint" }, --- pyflakes = { enabled = false }, --- pycodestyle = { enabled = false }, --- -- type checker --- pylsp_mypy = { enabled = true }, --- -- auto-completion options --- jedi_completion = { fuzzy = true }, --- -- import sorting --- pyls_isort = { enabled = true }, --- }, --- }, ---}, ---flags = { --- debounce_text_changes = 200, ---}, ---capabilities = capabilities, ---} ----- lua-lsp ---require'lspconfig'.lua_ls.setup{} --- ---new version --- ============================ --- LSP CONFIGURATION (Neovim 0.11+) --- ============================ - --- Set up capabilities for nvim-cmp LSP completion -local capabilities = require('cmp_nvim_lsp').default_capabilities() - --- Optional: custom on_attach function if you have keymaps --- local custom_attach = function(client, bufnr) --- -- your on_attach code here --- end - --- Utility function to simplify server setup -local function setup_lsp(server_name, opts) - vim.lsp.config(server_name, opts or {}) -end - --- ======== LSP SERVERS ======== - --- TeXLab -setup_lsp("texlab", { - capabilities = capabilities, -}) - --- Clangd (C/C++) -setup_lsp("clangd", { - capabilities = capabilities, -}) - --- Python LSP (pylsp) -setup_lsp("pylsp", { - on_attach = custom_attach, - capabilities = capabilities, - flags = { - debounce_text_changes = 200, - }, - settings = { - pylsp = { - plugins = { - -- Formatter options - black = { enabled = true }, - autopep8 = { enabled = false }, - yapf = { enabled = false }, - -- Linter options - pylint = { enabled = true, executable = "pylint" }, - pyflakes = { enabled = false }, - pycodestyle = { enabled = false }, - -- Type checker - pylsp_mypy = { enabled = true }, - -- Auto-completion options - jedi_completion = { fuzzy = true }, - -- Import sorting - pyls_isort = { enabled = true }, - }, - }, - }, -}) - --- Lua LSP -setup_lsp("lua_ls", { - capabilities = capabilities, -}) - - --- dashboard config -require('dashboard').setup { - theme = 'hyper', - config = { - header = { - " ... ... . ", - " .=*8888n..\"%888: @88> ", - " X ?8888f '8888 u. ... .. %8P .. . : ", - " 88x. '8888X 8888> .u ...ue888b :~\"\"888h.:^\"888: . .888: x888 x888. ", - "'8888k 8888X '\"*8h. ud8888. 888R Y888r 8X `8888X 8888> .@88u ~`8888~'888X`?888f` ", - " \"8888 X888X .xH8 :888'8888. 888R I888> X888n. 8888X ?888> '\"888E` X888 888X '888> ", - " `8\" X888!:888X d888 '88%\" 888R I888> '88888 8888X ?**h. 888E X888 888X '888> ", - " =~` X888 X888X 8888.+\" 888R I888> `*88 8888~ x88x. 888E X888 888X '888> ", - " :h. X8*` !888X 8888L u8888cJ888 ..<\" 88*` 88888X 888E X888 888X '888> ", - " X888xX\" '8888..: '8888c. .+ \"*888*P\" ..XC. `*8888k 888& \"*88%\"\"*88\" '888!` ", - ":~`888f '*888*\" \"88888% 'Y\" :888888H. `%88> R888\" `~ \" `\"` ", - " \"\" `\"` \"YP' < `\"888888: X\" \"\" ", - " %888888x.-` ", - " \"\"**\"\" ", - "", - "" -}, - shortcut = { - { desc = " Open File Tree", group = "", key = 't', action = 'NvimTreeOpen' }, - -- action can be a function type - }, - packages = { enable = false }, -- show how many plugins neovim loaded - -- limit how many projects list, action when you press key or enter it will run this action. - -- action can be a functino type, e.g. - -- action = func(path) vim.cmd('Telescope find_files cwd=' .. path) end - project = { enable = true, limit = 8, icon = ' New file', label = "", action = 'Telescope find_files cwd=' }, - mru = { limit = 10, icon = ' History', label = "", cwd_only = false }, - footer = {}, -- footer -} -} - --- lualine config https://github.com/nvim-lualine/lualine.nvim/blob/master/examples/bubbles.lua -require('lualine').setup { - options = { theme = "gruvbox_dark" }, -} -local builtin = require('telescope.builtin') -vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) -vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) -vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) -vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) - --- Disable relative numbers even if a plugin (like neovim-sensible) turns them on - vim.api.nvim_create_autocmd("VimEnter", { - callback = function() - vim.opt.colorcolumn = "" + local vim = vim + -- local Plug = vim.fn['plug#'] + vim.g.mapleader ='ü' + vim.g.maplocalleader = 'ü' + + -- Set to true if you have a Nerd Font installed and selected in the terminal + vim.g.have_nerd_font = true + + -- [[ Setting options ]] + -- See `:help vim.opt` + -- NOTE: You can change these options as you wish! + -- For more options, you can see `:help option-list` + + -- Make line numbers default + -- You can also add relative line numbers, to help with jumping. + -- Experiment for yourself to see if you like it! vim.opt.relativenumber = false - end, -}) -''; + + -- Enable mouse mode, can be useful for resizing splits for example! + vim.opt.mouse = 'a' + + -- Don't show the mode, since it's already in the status line + vim.opt.showmode = false + + -- Sync clipboard between OS and Neovim. + -- Schedule the setting after `UiEnter` because it can increase startup-time. + -- Remove this option if you want your OS clipboard to remain independent. + -- See `:help 'clipboard'` + vim.schedule(function() + vim.opt.clipboard = 'unnamedplus' + end) + + + -- Enable break indent + vim.opt.breakindent = true + + -- Save undo history + vim.opt.undofile = true + + -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term + vim.opt.ignorecase = true + vim.opt.smartcase = true + + -- Keep signcolumn on by default + vim.opt.signcolumn = 'yes' + + -- Decrease update time + vim.opt.updatetime = 250 + + -- Decrease mapped sequence wait time + -- Displays which-key popup sooner + vim.opt.timeoutlen = 300 + + -- Configure how new splits should be opened + vim.opt.splitright = true + vim.opt.splitbelow = true + + -- Sets how neovim will display certain whitespace characters in the editor. + -- See `:help 'list'` + -- and `:help 'listchars'` + vim.opt.list = true + vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + + + + -- indentation settings - added by me + -- refere to https://stackoverflow.com/questions/51995128/setting-autoindentation-to-spaces-in-neovim for more information + vim.opt.expandtab = true + vim.opt.smartindent = true + vim.opt.tabstop = 4 + vim.opt.shiftwidth = 4 + + -- Preview substitutions live, as you type! + vim.opt.inccommand = 'split' + + -- Show which line your cursor is on + vim.opt.cursorline = true + + -- Minimal number of screen lines to keep above and below the cursor. + vim.opt.scrolloff = 10 + + -- [[ Basic Keymaps ]] + -- See `:help vim.keymap.set()` + + -- Clear highlights on search when pressing in normal mode + -- See `:help hlsearch` + vim.keymap.set('n', '', 'nohlsearch') + + -- Diagnostic keymaps + vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + + -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier + -- for people to discover. Otherwise, you normally need to press , which + -- is not what someone will guess without a bit more experience. + -- + -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping + -- or just use to exit terminal mode + vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + + -- TIP: Disable arrow keys in normal mode + -- vim.keymap.set('n', '', 'echo "Use h to move!!"') + -- vim.keymap.set('n', '', 'echo "Use l to move!!"') + -- vim.keymap.set('n', '', 'echo "Use k to move!!"') + -- vim.keymap.set('n', '', 'echo "Use j to move!!"') + + -- Keybinds to make split navigation easier. + -- Use CTRL+ to switch between windows + -- + -- See `:help wincmd` for a list of all window commands + vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) + + -- jump to next error + vim.keymap.set("n", "t", vim.diagnostic.goto_prev) + vim.keymap.set("n", "z", vim.diagnostic.goto_next) + + + -- [[ Basic Autocommands ]] + -- See `:help lua-guide-autocommands` + + -- Highlight when yanking (copying) text + -- Try it with `yap` in normal mode + -- See `:help vim.highlight.on_yank()` + vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, + }) + + --require("multiple-cursors").setup({ + -- version = "*", -- Use the latest tagged version + -- opts = {}, -- This causes the plugin setup function to be called + -- keys = { + -- {"", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, + -- {"", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, + -- + -- {"", "MultipleCursorsAddUp", mode = {"n", "i", "x"}, desc = "Add cursor and move up"}, + -- {"", "MultipleCursorsAddDown", mode = {"n", "i", "x"}, desc = "Add cursor and move down"}, + -- + -- {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, + -- + -- {"m", "MultipleCursorsAddVisualArea", mode = {"x"}, desc = "Add cursors to the lines of the visual area"}, + -- + -- {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, + -- {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, + -- + -- {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, + -- {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, + -- + -- {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, + -- }, + --}) + + + vim.keymap.set("n","§", "Cheatsheet") + + require("cheatsheet").setup({ + bundled_cheatsheets = { + -- only show the default cheatsheet + enabled = { "default" }, + }, + bundled_plugin_cheatsheets = { + -- show cheatsheets for all plugins except gitsigns + disabled = { "gitsigns.nvim" }, + } + }) + + + + -- Can be applied to each buffer separately + + local default_options = { + ui = { + wrap_line_after = false, -- wrap the line after this length to avoid the virtual text is too long + left_kept_space = 3, --- the number of spaces kept on the left side of the virtual text, make sure it enough to custom for each line + right_kept_space = 3, --- the number of spaces kept on the right side of the virtual text, make sure it enough to custom for each line + arrow = "  ", + up_arrow = "  ", + down_arrow = "  ", + above = false, -- the virtual text will be displayed above the line + }, + priority = 2003, -- the priority of virtual text + inline = true, + } + + + -- scrollbar + require("scrollbar").setup() + + -- ufo https://github.com/kevinhwang91/nvim-ufo + vim.o.foldcolumn = '1' -- '0' is not bad + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + + -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself + vim.keymap.set('n', '1', "foldopen") + vim.keymap.set('n', '2', "foldclose") + vim.keymap.set('n', '3', "openAllFold") + vim.keymap.set('n', '4', " closeAllFold") + -- Option 3: treesitter as a main provider instead + -- (Note: the `nvim-treesitter` plugin is *not* needed.) + -- ufo uses the same query files for folding (queries//folds.scm) + -- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()` + --vim.keymap.set('n', '1', function() require("ufo").foldopen() end, {buffer=0}) + --vim.keymap.set('n', '2', function() require("ufo").foldclose() end) + + + + -- added by myself + require('ufo').setup({ + provider_selector = function(bufnr, filetype, buftype) + return {'treesitter', 'indent'} + end + }) + + -- Color schemes should be loaded after plug#end(). + vim.o.background = "dark" -- or "light" for light mode + -- Default options: + --require("gruvbox").setup({ + -- terminal_colors = true, -- add neovim terminal colors + -- undercurl = true, + -- underline = true, + -- bold = true, + -- italic = { + -- strings = true, + -- emphasis = true, + -- comments = true, + -- operators = false, + -- folds = true, + -- }, + -- strikethrough = true, + -- invert_selection = false, + -- invert_signs = false, + -- invert_tabline = false, + -- invert_intend_guides = false, + -- inverse = true, -- invert background for search, diffs, statuslines and errors + -- contrast = "", -- can be "hard", "soft" or empty string + -- palette_overrides = {}, + -- overrides = {}, + -- dim_inactive = false, + -- transparent_mode = false, + --}) + vim.cmd("colorscheme gruvbox") + -- nvim-tree https://github.com/nvim-tree/nvim-tree.lua + -- disable netrw at the very start of your init.lua + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + -- optionally enable 24-bit colour + vim.opt.termguicolors = true + + + -- setup with some options + require("nvim-tree").setup({ + sort = { + sorter = "case_sensitive", + }, + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, + }) + vim.opt.number = true + -- Uncomment for opening the navigable tree file systeme on startup of NeoVim + --vim.cmd('NvimTreeOpen') + + --require('md-pdf').setup({ + -- --- Set margins around document + -- margins = "1.5cm", + -- -- tango, pygments are quite nice for white on white + -- highlight = "tango", + -- -- Generate a table of contents, on by default + -- toc = true, + -- -- Define a custom preview command, enabling hooks and other custom logic + -- preview_cmd = function() return 'firefox' end, + -- -- if true, then the markdown file is continuously converted on each write, even if the + -- -- file viewer closed, e.g., firefox is "closed" once the document is opened in it. + -- ignore_viewer_state = false, + -- -- Specify font, `nil` uses the default font of the theme + -- fonts = nil, + -- -- or, where all or only some options can be specified. NOTE: those that are `nil` can be left + -- -- out completely + -- fonts = { + -- main_font = nil, + -- sans_font = "DejaVuSans", + -- mono_font = "IosevkaTerm Nerd Font Mono", + -- math_font = nil, + -- }, + -- -- Custom options passed to `pandoc` CLI call, can be ignored for setup + -- pandoc_user_args = nil, + -- -- or + -- pandoc_user_args = { + -- -- short + -- "-V KEY[:VALUE]", + -- -- long options + -- "--standalone=[true|false]", + -- }, + -- --- Path to output. Needs to be always relative, e.g.: "./", "../", "./out" or simply "out", but + -- --- not absolute e.g.: "/"! + -- output_path = "", + --}) + + -- setup mapping + vim.keymap.set("n", ",", function() + require('md-pdf').convert_md_to_pdf() + end) + -- Set up nvim-cmp. + local cmp = require'cmp' + + cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- require('snippy').expand_snippet(args.body) -- For `snippy` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, -- For vsnip users. + -- { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, { + { name = 'buffer' }, + }) + }) + + -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below + -- Set configuration for specific filetype. + --[[ cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'git' }, + }, { + { name = 'buffer' }, + }) + }) + require("cmp_git").setup() ]]-- + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }), + matching = { disallow_symbol_nonprefix_matching = false } + }) + + + -- require(lspconfig) is deprecated + -- -- Set up lspconfig. + -- local capabilities = require('cmp_nvim_lsp').default_capabilities() + -- -- Replace with each lsp server you've enabled. + -- require('lspconfig')['texlab'].setup { + -- capabilities = capabilities + -- } + --require'lspconfig'.clangd.setup{} + --lspconfig = require("lspconfig") + --lspconfig.pylsp.setup { + --on_attach = custom_attach, + --settings = { + -- pylsp = { + -- plugins = { + -- -- formatter options + -- black = { enabled = true }, + -- autopep8 = { enabled = false }, + -- yapf = { enabled = false }, + -- -- linter options + -- pylint = { enabled = true, executable = "pylint" }, + -- pyflakes = { enabled = false }, + -- pycodestyle = { enabled = false }, + -- -- type checker + -- pylsp_mypy = { enabled = true }, + -- -- auto-completion options + -- jedi_completion = { fuzzy = true }, + -- -- import sorting + -- pyls_isort = { enabled = true }, + -- }, + -- }, + --}, + --flags = { + -- debounce_text_changes = 200, + --}, + --capabilities = capabilities, + --} + ---- lua-lsp + --require'lspconfig'.lua_ls.setup{} + -- + --new version + -- ============================ + -- LSP CONFIGURATION (Neovim 0.11+) + -- ============================ + + -- Set up capabilities for nvim-cmp LSP completion + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + -- Optional: custom on_attach function if you have keymaps + -- local custom_attach = function(client, bufnr) + -- -- your on_attach code here + -- end + + -- Utility function to simplify server setup + local function setup_lsp(server_name, opts) + vim.lsp.config(server_name, opts or {}) + end + + -- ======== LSP SERVERS ======== + + -- TeXLab + setup_lsp("texlab", { + capabilities = capabilities, + }) + + -- Clangd (C/C++) + setup_lsp("clangd", { + capabilities = capabilities, + }) + + -- Python LSP (pylsp) + setup_lsp("pylsp", { + on_attach = custom_attach, + capabilities = capabilities, + flags = { + debounce_text_changes = 200, + }, + settings = { + pylsp = { + plugins = { + -- Formatter options + black = { enabled = true }, + autopep8 = { enabled = false }, + yapf = { enabled = false }, + -- Linter options + pylint = { enabled = true, executable = "pylint" }, + pyflakes = { enabled = false }, + pycodestyle = { enabled = false }, + -- Type checker + pylsp_mypy = { enabled = true }, + -- Auto-completion options + jedi_completion = { fuzzy = true }, + -- Import sorting + pyls_isort = { enabled = true }, + }, + }, + }, + }) + + -- Lua LSP + setup_lsp("lua_ls", { + capabilities = capabilities, + }) + + + -- dashboard config + require('dashboard').setup { + theme = 'hyper', + config = { + header = { + " ... ... . ", + " .=*8888n..\"%888: @88> ", + " X ?8888f '8888 u. ... .. %8P .. . : ", + " 88x. '8888X 8888> .u ...ue888b :~\"\"888h.:^\"888: . .888: x888 x888. ", + "'8888k 8888X '\"*8h. ud8888. 888R Y888r 8X `8888X 8888> .@88u ~`8888~'888X`?888f` ", + " \"8888 X888X .xH8 :888'8888. 888R I888> X888n. 8888X ?888> '\"888E` X888 888X '888> ", + " `8\" X888!:888X d888 '88%\" 888R I888> '88888 8888X ?**h. 888E X888 888X '888> ", + " =~` X888 X888X 8888.+\" 888R I888> `*88 8888~ x88x. 888E X888 888X '888> ", + " :h. X8*` !888X 8888L u8888cJ888 ..<\" 88*` 88888X 888E X888 888X '888> ", + " X888xX\" '8888..: '8888c. .+ \"*888*P\" ..XC. `*8888k 888& \"*88%\"\"*88\" '888!` ", + ":~`888f '*888*\" \"88888% 'Y\" :888888H. `%88> R888\" `~ \" `\"` ", + " \"\" `\"` \"YP' < `\"888888: X\" \"\" ", + " %888888x.-` ", + " \"\"**\"\" ", + "", + "" + }, + shortcut = { + { desc = " Open File Tree", group = "", key = 't', action = 'NvimTreeOpen' }, + -- action can be a function type + }, + packages = { enable = false }, -- show how many plugins neovim loaded + -- limit how many projects list, action when you press key or enter it will run this action. + -- action can be a functino type, e.g. + -- action = func(path) vim.cmd('Telescope find_files cwd=' .. path) end + project = { enable = true, limit = 8, icon = ' New file', label = "", action = 'Telescope find_files cwd=' }, + mru = { limit = 10, icon = ' History', label = "", cwd_only = false }, + footer = {}, -- footer + } + } + + -- lualine config https://github.com/nvim-lualine/lualine.nvim/blob/master/examples/bubbles.lua + require('lualine').setup { + options = { theme = "gruvbox_dark" }, + } + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) + vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) + vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) + vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) + + -- Disable relative numbers even if a plugin (like neovim-sensible) turns them on + vim.api.nvim_create_autocmd("VimEnter", { + callback = function() + vim.opt.colorcolumn = "" + vim.opt.relativenumber = false + end, + }) + ''; }; } diff --git a/modules/home-manager/neovim2.nix b/modules/home-manager/neovim2.nix index e5797f5..d64c955 100644 --- a/modules/home-manager/neovim2.nix +++ b/modules/home-manager/neovim2.nix @@ -1,546 +1,549 @@ -{ config, pkgs, ... }: +{ + config, + pkgs, + ... +}: # same as ./neovim.nix but you vim plug. # i tried importing my nvim config from fedora to a more nixy way but a lot of settings and plugins didnt work. Maybe i'll fix it latter # the only difference is the we use :PlugInstall or a similar command before doing anything - { programs.neovim = { enable = true; vimAlias = true; viAlias = true; extraLuaConfig = '' -local vim = vim --- local Plug = vim.fn['plug#'] -vim.g.mapleader ='ü' -vim.g.maplocalleader = 'ü' + local vim = vim + -- local Plug = vim.fn['plug#'] + vim.g.mapleader ='ü' + vim.g.maplocalleader = 'ü' --- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = true + -- Set to true if you have a Nerd Font installed and selected in the terminal + vim.g.have_nerd_font = true --- [[ Setting options ]] --- See `:help vim.opt` --- NOTE: You can change these options as you wish! --- For more options, you can see `:help option-list` + -- [[ Setting options ]] + -- See `:help vim.opt` + -- NOTE: You can change these options as you wish! + -- For more options, you can see `:help option-list` --- Make line numbers default --- You can also add relative line numbers, to help with jumping. --- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true + -- Make line numbers default + -- You can also add relative line numbers, to help with jumping. + -- Experiment for yourself to see if you like it! + -- vim.opt.relativenumber = true --- Enable mouse mode, can be useful for resizing splits for example! -vim.opt.mouse = 'a' + -- Enable mouse mode, can be useful for resizing splits for example! + vim.opt.mouse = 'a' --- Don't show the mode, since it's already in the status line -vim.opt.showmode = true + -- Don't show the mode, since it's already in the status line + vim.opt.showmode = true --- Sync clipboard between OS and Neovim. --- Schedule the setting after `UiEnter` because it can increase startup-time. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.schedule(function() - vim.opt.clipboard = 'unnamedplus' -end) + -- Sync clipboard between OS and Neovim. + -- Schedule the setting after `UiEnter` because it can increase startup-time. + -- Remove this option if you want your OS clipboard to remain independent. + -- See `:help 'clipboard'` + vim.schedule(function() + vim.opt.clipboard = 'unnamedplus' + end) --- Enable break indent -vim.opt.breakindent = true + -- Enable break indent + vim.opt.breakindent = true --- Save undo history -vim.opt.undofile = true + -- Save undo history + vim.opt.undofile = true --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.opt.ignorecase = true -vim.opt.smartcase = true + -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term + vim.opt.ignorecase = true + vim.opt.smartcase = true --- Keep signcolumn on by default -vim.opt.signcolumn = 'yes' + -- Keep signcolumn on by default + vim.opt.signcolumn = 'yes' --- Decrease update time -vim.opt.updatetime = 250 + -- Decrease update time + vim.opt.updatetime = 250 --- Decrease mapped sequence wait time --- Displays which-key popup sooner -vim.opt.timeoutlen = 300 + -- Decrease mapped sequence wait time + -- Displays which-key popup sooner + vim.opt.timeoutlen = 300 --- Configure how new splits should be opened -vim.opt.splitright = true -vim.opt.splitbelow = true + -- Configure how new splits should be opened + vim.opt.splitright = true + vim.opt.splitbelow = true --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` --- and `:help 'listchars'` -vim.opt.list = true -vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } - - - --- indentation settings - added by me --- refere to https://stackoverflow.com/questions/51995128/setting-autoindentation-to-spaces-in-neovim for more information -vim.opt.expandtab = true -vim.opt.smartindent = true -vim.opt.tabstop = 4 -vim.opt.shiftwidth = 4 - --- Preview substitutions live, as you type! -vim.opt.inccommand = 'split' - --- Show which line your cursor is on -vim.opt.cursorline = true - --- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 - --- [[ Basic Keymaps ]] --- See `:help vim.keymap.set()` - --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') - --- Diagnostic keymaps -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) - --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) - --- jump to next error -vim.keymap.set("n", "t", vim.diagnostic.goto_prev) -vim.keymap.set("n", "z", vim.diagnostic.goto_next) - - --- [[ Basic Autocommands ]] --- See `:help lua-guide-autocommands` - --- Highlight when yanking (copying) text --- Try it with `yap` in normal mode --- See `:help vim.highlight.on_yank()` -vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.highlight.on_yank() - end, -}) - ---require("multiple-cursors").setup({ --- version = "*", -- Use the latest tagged version --- opts = {}, -- This causes the plugin setup function to be called --- keys = { --- {"", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, --- {"", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, --- --- {"", "MultipleCursorsAddUp", mode = {"n", "i", "x"}, desc = "Add cursor and move up"}, --- {"", "MultipleCursorsAddDown", mode = {"n", "i", "x"}, desc = "Add cursor and move down"}, --- --- {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, --- --- {"m", "MultipleCursorsAddVisualArea", mode = {"x"}, desc = "Add cursors to the lines of the visual area"}, --- --- {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, --- {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, --- --- {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, --- {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, --- --- {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, --- }, ---}) - - -vim.keymap.set("n","§", "Cheatsheet") - -require("cheatsheet").setup({ - bundled_cheatsheets = { - -- only show the default cheatsheet - enabled = { "default" }, - }, - bundled_plugin_cheatsheets = { - -- show cheatsheets for all plugins except gitsigns - disabled = { "gitsigns.nvim" }, - } -}) + -- Sets how neovim will display certain whitespace characters in the editor. + -- See `:help 'list'` + -- and `:help 'listchars'` + vim.opt.list = true + vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } --- Can be applied to each buffer separately + -- indentation settings - added by me + -- refere to https://stackoverflow.com/questions/51995128/setting-autoindentation-to-spaces-in-neovim for more information + vim.opt.expandtab = true + vim.opt.smartindent = true + vim.opt.tabstop = 4 + vim.opt.shiftwidth = 4 -local default_options = { - ui = { - wrap_line_after = false, -- wrap the line after this length to avoid the virtual text is too long - left_kept_space = 3, --- the number of spaces kept on the left side of the virtual text, make sure it enough to custom for each line - right_kept_space = 3, --- the number of spaces kept on the right side of the virtual text, make sure it enough to custom for each line - arrow = "  ", - up_arrow = "  ", - down_arrow = "  ", - above = false, -- the virtual text will be displayed above the line - }, - priority = 2003, -- the priority of virtual text - inline = true, -} + -- Preview substitutions live, as you type! + vim.opt.inccommand = 'split' + + -- Show which line your cursor is on + vim.opt.cursorline = true + + -- Minimal number of screen lines to keep above and below the cursor. + vim.opt.scrolloff = 10 + + -- [[ Basic Keymaps ]] + -- See `:help vim.keymap.set()` + + -- Clear highlights on search when pressing in normal mode + -- See `:help hlsearch` + vim.keymap.set('n', '', 'nohlsearch') + + -- Diagnostic keymaps + vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + + -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier + -- for people to discover. Otherwise, you normally need to press , which + -- is not what someone will guess without a bit more experience. + -- + -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping + -- or just use to exit terminal mode + vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + + -- TIP: Disable arrow keys in normal mode + -- vim.keymap.set('n', '', 'echo "Use h to move!!"') + -- vim.keymap.set('n', '', 'echo "Use l to move!!"') + -- vim.keymap.set('n', '', 'echo "Use k to move!!"') + -- vim.keymap.set('n', '', 'echo "Use j to move!!"') + + -- Keybinds to make split navigation easier. + -- Use CTRL+ to switch between windows + -- + -- See `:help wincmd` for a list of all window commands + vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) + + -- jump to next error + vim.keymap.set("n", "t", vim.diagnostic.goto_prev) + vim.keymap.set("n", "z", vim.diagnostic.goto_next) --- scrollbar -require("scrollbar").setup() + -- [[ Basic Autocommands ]] + -- See `:help lua-guide-autocommands` --- ufo https://github.com/kevinhwang91/nvim-ufo -vim.o.foldcolumn = '1' -- '0' is not bad -vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value -vim.o.foldlevelstart = 99 -vim.o.foldenable = true + -- Highlight when yanking (copying) text + -- Try it with `yap` in normal mode + -- See `:help vim.highlight.on_yank()` + vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, + }) --- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself -vim.keymap.set('n', '1', "foldopen") -vim.keymap.set('n', '2', "foldclose") -vim.keymap.set('n', '3', "openAllFold") -vim.keymap.set('n', '4', " closeAllFold") --- Option 3: treesitter as a main provider instead --- (Note: the `nvim-treesitter` plugin is *not* needed.) --- ufo uses the same query files for folding (queries//folds.scm) --- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()` ---vim.keymap.set('n', '1', function() require("ufo").foldopen() end, {buffer=0}) ---vim.keymap.set('n', '2', function() require("ufo").foldclose() end) + --require("multiple-cursors").setup({ + -- version = "*", -- Use the latest tagged version + -- opts = {}, -- This causes the plugin setup function to be called + -- keys = { + -- {"", "MultipleCursorsAddDown", mode = {"n", "x"}, desc = "Add cursor and move down"}, + -- {"", "MultipleCursorsAddUp", mode = {"n", "x"}, desc = "Add cursor and move up"}, + -- + -- {"", "MultipleCursorsAddUp", mode = {"n", "i", "x"}, desc = "Add cursor and move up"}, + -- {"", "MultipleCursorsAddDown", mode = {"n", "i", "x"}, desc = "Add cursor and move down"}, + -- + -- {"", "MultipleCursorsMouseAddDelete", mode = {"n", "i"}, desc = "Add or remove cursor"}, + -- + -- {"m", "MultipleCursorsAddVisualArea", mode = {"x"}, desc = "Add cursors to the lines of the visual area"}, + -- + -- {"a", "MultipleCursorsAddMatches", mode = {"n", "x"}, desc = "Add cursors to cword"}, + -- {"A", "MultipleCursorsAddMatchesV", mode = {"n", "x"}, desc = "Add cursors to cword in previous area"}, + -- + -- {"d", "MultipleCursorsAddJumpNextMatch", mode = {"n", "x"}, desc = "Add cursor and jump to next cword"}, + -- {"D", "MultipleCursorsJumpNextMatch", mode = {"n", "x"}, desc = "Jump to next cword"}, + -- + -- {"l", "MultipleCursorsLock", mode = {"n", "x"}, desc = "Lock virtual cursors"}, + -- }, + --}) + + + vim.keymap.set("n","§", "Cheatsheet") + + require("cheatsheet").setup({ + bundled_cheatsheets = { + -- only show the default cheatsheet + enabled = { "default" }, + }, + bundled_plugin_cheatsheets = { + -- show cheatsheets for all plugins except gitsigns + disabled = { "gitsigns.nvim" }, + } + }) --- added by myself -require('ufo').setup({ - provider_selector = function(bufnr, filetype, buftype) - return {'treesitter', 'indent'} - end -}) + -- Can be applied to each buffer separately --- Color schemes should be loaded after plug#end(). -vim.o.background = "dark" -- or "light" for light mode --- Default options: -require("gruvbox").setup({ - terminal_colors = true, -- add neovim terminal colors - undercurl = true, - underline = true, - bold = true, - italic = { - strings = true, - emphasis = true, - comments = true, - operators = false, - folds = true, - }, - strikethrough = true, - invert_selection = false, - invert_signs = false, - invert_tabline = false, - invert_intend_guides = false, - inverse = true, -- invert background for search, diffs, statuslines and errors - contrast = "", -- can be "hard", "soft" or empty string - palette_overrides = {}, - overrides = {}, - dim_inactive = false, - transparent_mode = false, -}) -vim.cmd("colorscheme gruvbox") --- nvim-tree https://github.com/nvim-tree/nvim-tree.lua --- disable netrw at the very start of your init.lua -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - --- optionally enable 24-bit colour -vim.opt.termguicolors = true + local default_options = { + ui = { + wrap_line_after = false, -- wrap the line after this length to avoid the virtual text is too long + left_kept_space = 3, --- the number of spaces kept on the left side of the virtual text, make sure it enough to custom for each line + right_kept_space = 3, --- the number of spaces kept on the right side of the virtual text, make sure it enough to custom for each line + arrow = "  ", + up_arrow = "  ", + down_arrow = "  ", + above = false, -- the virtual text will be displayed above the line + }, + priority = 2003, -- the priority of virtual text + inline = true, + } --- setup with some options -require("nvim-tree").setup({ - sort = { - sorter = "case_sensitive", - }, - view = { - width = 30, - }, - renderer = { - group_empty = true, - }, - filters = { - dotfiles = true, - }, -}) -vim.opt.number = true --- Uncomment for opening the navigable tree file systeme on startup of NeoVim ---vim.cmd('NvimTreeOpen') + -- scrollbar + require("scrollbar").setup() -require('md-pdf').setup({ - --- Set margins around document - margins = "1.5cm", - -- tango, pygments are quite nice for white on white - highlight = "tango", - -- Generate a table of contents, on by default - toc = true, - -- Define a custom preview command, enabling hooks and other custom logic - preview_cmd = function() return 'firefox' end, - -- if true, then the markdown file is continuously converted on each write, even if the - -- file viewer closed, e.g., firefox is "closed" once the document is opened in it. - ignore_viewer_state = false, - -- Specify font, `nil` uses the default font of the theme - fonts = nil, - -- or, where all or only some options can be specified. NOTE: those that are `nil` can be left - -- out completely - fonts = { - main_font = nil, - sans_font = "DejaVuSans", - mono_font = "IosevkaTerm Nerd Font Mono", - math_font = nil, - }, - -- Custom options passed to `pandoc` CLI call, can be ignored for setup - pandoc_user_args = nil, - -- or - pandoc_user_args = { - -- short - "-V KEY[:VALUE]", - -- long options - "--standalone=[true|false]", - }, - --- Path to output. Needs to be always relative, e.g.: "./", "../", "./out" or simply "out", but - --- not absolute e.g.: "/"! - output_path = "", -}) + -- ufo https://github.com/kevinhwang91/nvim-ufo + vim.o.foldcolumn = '1' -- '0' is not bad + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true --- setup mapping -vim.keymap.set("n", ",", function() - require('md-pdf').convert_md_to_pdf() -end) - -- Set up nvim-cmp. - local cmp = require'cmp' - - cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- require('snippy').expand_snippet(args.body) -- For `snippy` users. - -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. - -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) - end, - }, - window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'vsnip' }, -- For vsnip users. - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - }, { - { name = 'buffer' }, - }) - }) - - -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below - -- Set configuration for specific filetype. - --[[ cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'git' }, - }, { - { name = 'buffer' }, - }) - }) - require("cmp_git").setup() ]]-- - - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }) - - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }), - matching = { disallow_symbol_nonprefix_matching = false } - }) + -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself + vim.keymap.set('n', '1', "foldopen") + vim.keymap.set('n', '2', "foldclose") + vim.keymap.set('n', '3', "openAllFold") + vim.keymap.set('n', '4', " closeAllFold") + -- Option 3: treesitter as a main provider instead + -- (Note: the `nvim-treesitter` plugin is *not* needed.) + -- ufo uses the same query files for folding (queries//folds.scm) + -- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()` + --vim.keymap.set('n', '1', function() require("ufo").foldopen() end, {buffer=0}) + --vim.keymap.set('n', '2', function() require("ufo").foldclose() end) - -- require(lspconfig) is deprecated --- -- Set up lspconfig. --- local capabilities = require('cmp_nvim_lsp').default_capabilities() --- -- Replace with each lsp server you've enabled. --- require('lspconfig')['texlab'].setup { --- capabilities = capabilities --- } ---require'lspconfig'.clangd.setup{} ---lspconfig = require("lspconfig") ---lspconfig.pylsp.setup { ---on_attach = custom_attach, ---settings = { --- pylsp = { --- plugins = { --- -- formatter options --- black = { enabled = true }, --- autopep8 = { enabled = false }, --- yapf = { enabled = false }, --- -- linter options --- pylint = { enabled = true, executable = "pylint" }, --- pyflakes = { enabled = false }, --- pycodestyle = { enabled = false }, --- -- type checker --- pylsp_mypy = { enabled = true }, --- -- auto-completion options --- jedi_completion = { fuzzy = true }, --- -- import sorting --- pyls_isort = { enabled = true }, --- }, --- }, ---}, ---flags = { --- debounce_text_changes = 200, ---}, ---capabilities = capabilities, ---} ----- lua-lsp ---require'lspconfig'.lua_ls.setup{} --- ---new version --- ============================ --- LSP CONFIGURATION (Neovim 0.11+) --- ============================ --- Set up capabilities for nvim-cmp LSP completion -local capabilities = require('cmp_nvim_lsp').default_capabilities() + -- added by myself + require('ufo').setup({ + provider_selector = function(bufnr, filetype, buftype) + return {'treesitter', 'indent'} + end + }) --- Optional: custom on_attach function if you have keymaps --- local custom_attach = function(client, bufnr) --- -- your on_attach code here --- end + -- Color schemes should be loaded after plug#end(). + vim.o.background = "dark" -- or "light" for light mode + -- Default options: + require("gruvbox").setup({ + terminal_colors = true, -- add neovim terminal colors + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + }) + vim.cmd("colorscheme gruvbox") + -- nvim-tree https://github.com/nvim-tree/nvim-tree.lua + -- disable netrw at the very start of your init.lua + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 --- Utility function to simplify server setup -local function setup_lsp(server_name, opts) - vim.lsp.config(server_name, opts or {}) -end + -- optionally enable 24-bit colour + vim.opt.termguicolors = true --- ======== LSP SERVERS ======== --- TeXLab -setup_lsp("texlab", { - capabilities = capabilities, -}) + -- setup with some options + require("nvim-tree").setup({ + sort = { + sorter = "case_sensitive", + }, + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, + }) + vim.opt.number = true + -- Uncomment for opening the navigable tree file systeme on startup of NeoVim + --vim.cmd('NvimTreeOpen') --- Clangd (C/C++) -setup_lsp("clangd", { - capabilities = capabilities, -}) + require('md-pdf').setup({ + --- Set margins around document + margins = "1.5cm", + -- tango, pygments are quite nice for white on white + highlight = "tango", + -- Generate a table of contents, on by default + toc = true, + -- Define a custom preview command, enabling hooks and other custom logic + preview_cmd = function() return 'firefox' end, + -- if true, then the markdown file is continuously converted on each write, even if the + -- file viewer closed, e.g., firefox is "closed" once the document is opened in it. + ignore_viewer_state = false, + -- Specify font, `nil` uses the default font of the theme + fonts = nil, + -- or, where all or only some options can be specified. NOTE: those that are `nil` can be left + -- out completely + fonts = { + main_font = nil, + sans_font = "DejaVuSans", + mono_font = "IosevkaTerm Nerd Font Mono", + math_font = nil, + }, + -- Custom options passed to `pandoc` CLI call, can be ignored for setup + pandoc_user_args = nil, + -- or + pandoc_user_args = { + -- short + "-V KEY[:VALUE]", + -- long options + "--standalone=[true|false]", + }, + --- Path to output. Needs to be always relative, e.g.: "./", "../", "./out" or simply "out", but + --- not absolute e.g.: "/"! + output_path = "", + }) --- Python LSP (pylsp) -setup_lsp("pylsp", { - on_attach = custom_attach, - capabilities = capabilities, - flags = { - debounce_text_changes = 200, - }, - settings = { - pylsp = { - plugins = { - -- Formatter options - black = { enabled = true }, - autopep8 = { enabled = false }, - yapf = { enabled = false }, - -- Linter options - pylint = { enabled = true, executable = "pylint" }, - pyflakes = { enabled = false }, - pycodestyle = { enabled = false }, - -- Type checker - pylsp_mypy = { enabled = true }, - -- Auto-completion options - jedi_completion = { fuzzy = true }, - -- Import sorting - pyls_isort = { enabled = true }, + -- setup mapping + vim.keymap.set("n", ",", function() + require('md-pdf').convert_md_to_pdf() + end) + -- Set up nvim-cmp. + local cmp = require'cmp' + + cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- require('snippy').expand_snippet(args.body) -- For `snippy` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, -- For vsnip users. + -- { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, { + { name = 'buffer' }, + }) + }) + + -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below + -- Set configuration for specific filetype. + --[[ cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'git' }, + }, { + { name = 'buffer' }, + }) + }) + require("cmp_git").setup() ]]-- + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }), + matching = { disallow_symbol_nonprefix_matching = false } + }) + + + -- require(lspconfig) is deprecated + -- -- Set up lspconfig. + -- local capabilities = require('cmp_nvim_lsp').default_capabilities() + -- -- Replace with each lsp server you've enabled. + -- require('lspconfig')['texlab'].setup { + -- capabilities = capabilities + -- } + --require'lspconfig'.clangd.setup{} + --lspconfig = require("lspconfig") + --lspconfig.pylsp.setup { + --on_attach = custom_attach, + --settings = { + -- pylsp = { + -- plugins = { + -- -- formatter options + -- black = { enabled = true }, + -- autopep8 = { enabled = false }, + -- yapf = { enabled = false }, + -- -- linter options + -- pylint = { enabled = true, executable = "pylint" }, + -- pyflakes = { enabled = false }, + -- pycodestyle = { enabled = false }, + -- -- type checker + -- pylsp_mypy = { enabled = true }, + -- -- auto-completion options + -- jedi_completion = { fuzzy = true }, + -- -- import sorting + -- pyls_isort = { enabled = true }, + -- }, + -- }, + --}, + --flags = { + -- debounce_text_changes = 200, + --}, + --capabilities = capabilities, + --} + ---- lua-lsp + --require'lspconfig'.lua_ls.setup{} + -- + --new version + -- ============================ + -- LSP CONFIGURATION (Neovim 0.11+) + -- ============================ + + -- Set up capabilities for nvim-cmp LSP completion + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + -- Optional: custom on_attach function if you have keymaps + -- local custom_attach = function(client, bufnr) + -- -- your on_attach code here + -- end + + -- Utility function to simplify server setup + local function setup_lsp(server_name, opts) + vim.lsp.config(server_name, opts or {}) + end + + -- ======== LSP SERVERS ======== + + -- TeXLab + setup_lsp("texlab", { + capabilities = capabilities, + }) + + -- Clangd (C/C++) + setup_lsp("clangd", { + capabilities = capabilities, + }) + + -- Python LSP (pylsp) + setup_lsp("pylsp", { + on_attach = custom_attach, + capabilities = capabilities, + flags = { + debounce_text_changes = 200, + }, + settings = { + pylsp = { + plugins = { + -- Formatter options + black = { enabled = true }, + autopep8 = { enabled = false }, + yapf = { enabled = false }, + -- Linter options + pylint = { enabled = true, executable = "pylint" }, + pyflakes = { enabled = false }, + pycodestyle = { enabled = false }, + -- Type checker + pylsp_mypy = { enabled = true }, + -- Auto-completion options + jedi_completion = { fuzzy = true }, + -- Import sorting + pyls_isort = { enabled = true }, + }, + }, + }, + }) + + -- Lua LSP + setup_lsp("lua_ls", { + capabilities = capabilities, + }) + + + -- dashboard config + require('dashboard').setup { + theme = 'hyper', + config = { + header = { + " ... ... . ", + " .=*8888n..\"%888: @88> ", + " X ?8888f '8888 u. ... .. %8P .. . : ", + " 88x. '8888X 8888> .u ...ue888b :~\"\"888h.:^\"888: . .888: x888 x888. ", + "'8888k 8888X '\"*8h. ud8888. 888R Y888r 8X `8888X 8888> .@88u ~`8888~'888X`?888f` ", + " \"8888 X888X .xH8 :888'8888. 888R I888> X888n. 8888X ?888> '\"888E` X888 888X '888> ", + " `8\" X888!:888X d888 '88%\" 888R I888> '88888 8888X ?**h. 888E X888 888X '888> ", + " =~` X888 X888X 8888.+\" 888R I888> `*88 8888~ x88x. 888E X888 888X '888> ", + " :h. X8*` !888X 8888L u8888cJ888 ..<\" 88*` 88888X 888E X888 888X '888> ", + " X888xX\" '8888..: '8888c. .+ \"*888*P\" ..XC. `*8888k 888& \"*88%\"\"*88\" '888!` ", + ":~`888f '*888*\" \"88888% 'Y\" :888888H. `%88> R888\" `~ \" `\"` ", + " \"\" `\"` \"YP' < `\"888888: X\" \"\" ", + " %888888x.-` ", + " \"\"**\"\" ", + "", + "" }, - }, - }, -}) + shortcut = { + { desc = " Open File Tree", group = "", key = 't', action = 'NvimTreeOpen' }, + -- action can be a function type + }, + packages = { enable = false }, -- show how many plugins neovim loaded + -- limit how many projects list, action when you press key or enter it will run this action. + -- action can be a functino type, e.g. + -- action = func(path) vim.cmd('Telescope find_files cwd=' .. path) end + project = { enable = true, limit = 8, icon = ' New file', label = "", action = 'Telescope find_files cwd=' }, + mru = { limit = 10, icon = ' History', label = "", cwd_only = false }, + footer = {}, -- footer + } + } --- Lua LSP -setup_lsp("lua_ls", { - capabilities = capabilities, -}) - - --- dashboard config -require('dashboard').setup { - theme = 'hyper', - config = { - header = { - " ... ... . ", - " .=*8888n..\"%888: @88> ", - " X ?8888f '8888 u. ... .. %8P .. . : ", - " 88x. '8888X 8888> .u ...ue888b :~\"\"888h.:^\"888: . .888: x888 x888. ", - "'8888k 8888X '\"*8h. ud8888. 888R Y888r 8X `8888X 8888> .@88u ~`8888~'888X`?888f` ", - " \"8888 X888X .xH8 :888'8888. 888R I888> X888n. 8888X ?888> '\"888E` X888 888X '888> ", - " `8\" X888!:888X d888 '88%\" 888R I888> '88888 8888X ?**h. 888E X888 888X '888> ", - " =~` X888 X888X 8888.+\" 888R I888> `*88 8888~ x88x. 888E X888 888X '888> ", - " :h. X8*` !888X 8888L u8888cJ888 ..<\" 88*` 88888X 888E X888 888X '888> ", - " X888xX\" '8888..: '8888c. .+ \"*888*P\" ..XC. `*8888k 888& \"*88%\"\"*88\" '888!` ", - ":~`888f '*888*\" \"88888% 'Y\" :888888H. `%88> R888\" `~ \" `\"` ", - " \"\" `\"` \"YP' < `\"888888: X\" \"\" ", - " %888888x.-` ", - " \"\"**\"\" ", - "", - "" -}, - shortcut = { - { desc = " Open File Tree", group = "", key = 't', action = 'NvimTreeOpen' }, - -- action can be a function type - }, - packages = { enable = false }, -- show how many plugins neovim loaded - -- limit how many projects list, action when you press key or enter it will run this action. - -- action can be a functino type, e.g. - -- action = func(path) vim.cmd('Telescope find_files cwd=' .. path) end - project = { enable = true, limit = 8, icon = ' New file', label = "", action = 'Telescope find_files cwd=' }, - mru = { limit = 10, icon = ' History', label = "", cwd_only = false }, - footer = {}, -- footer -} -} - --- lualine config https://github.com/nvim-lualine/lualine.nvim/blob/master/examples/bubbles.lua -require('lualine').setup { - options = { theme = "gruvbox_dark" }, -} -local builtin = require('telescope.builtin') -vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) -vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) -vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) -vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) + -- lualine config https://github.com/nvim-lualine/lualine.nvim/blob/master/examples/bubbles.lua + require('lualine').setup { + options = { theme = "gruvbox_dark" }, + } + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) + vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) + vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) + vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) ''; }; diff --git a/modules/home-manager/oh-my-posh.nix b/modules/home-manager/oh-my-posh.nix index 3dca379..7cc8211 100644 --- a/modules/home-manager/oh-my-posh.nix +++ b/modules/home-manager/oh-my-posh.nix @@ -1,9 +1,11 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.oh-my-posh = { enable = true; enableZshIntegration = true; useTheme = "gruvbox"; - }; + }; } diff --git a/modules/home-manager/oh-my-zsh.nix b/modules/home-manager/oh-my-zsh.nix index 4c10ffa..e404420 100644 --- a/modules/home-manager/oh-my-zsh.nix +++ b/modules/home-manager/oh-my-zsh.nix @@ -1,21 +1,23 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.zsh.oh-my-zsh = { enable = true; theme = "jonathan"; plugins = [ - "aliases" - "alias-finder" - "colored-man-pages" - "colorize" - "command-not-found" - "dirhistory" - "fzf" - "git" - "rclone" - "safe-paste" - "sudo" -]; - }; + "aliases" + "alias-finder" + "colored-man-pages" + "colorize" + "command-not-found" + "dirhistory" + "fzf" + "git" + "rclone" + "safe-paste" + "sudo" + ]; + }; } diff --git a/modules/home-manager/rclone.nix b/modules/home-manager/rclone.nix index e224d4c..ddb235c 100644 --- a/modules/home-manager/rclone.nix +++ b/modules/home-manager/rclone.nix @@ -1,6 +1,9 @@ -{ config, pkgs, agenix, ... }: - { + config, + pkgs, + agenix, + ... +}: { programs.rclone = { enable = true; }; diff --git a/modules/home-manager/ripgrep.nix b/modules/home-manager/ripgrep.nix index a980514..4e7e52e 100644 --- a/modules/home-manager/ripgrep.nix +++ b/modules/home-manager/ripgrep.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.ripgrep = { enable = true; arguments = [ @@ -11,7 +13,6 @@ ]; }; programs.ripgrep-all = { - enable = true; + enable = true; }; - } diff --git a/modules/home-manager/rofi.nix b/modules/home-manager/rofi.nix index 4eef665..9bd6fed 100644 --- a/modules/home-manager/rofi.nix +++ b/modules/home-manager/rofi.nix @@ -1,8 +1,10 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.rofi = { enable = true; theme = "gruvbox-dark-hard"; -}; + }; } diff --git a/modules/home-manager/ssh.nix b/modules/home-manager/ssh.nix index e62d8f7..90d581e 100644 --- a/modules/home-manager/ssh.nix +++ b/modules/home-manager/ssh.nix @@ -1,13 +1,23 @@ -{ config, pkgs, ... }: - { - + config, + pkgs, + ... +}: { programs.ssh = { enable = true; - #agentKeys = [ - # "/home/tomasr/.ssh/id_ed25519" - #]; + matchBlocks."*" = { + # equivalent to the default config + forwardAgent = false; + addKeysToAgent = "no"; + compression = false; + serverAliveInterval = 0; + serverAliveCountMax = 3; + hashKnownHosts = false; + userKnownHostsFile = "~/.ssh/known_hosts"; + controlMaster = "no"; + controlPath = "~/.ssh/master-%r@%n:%p"; + controlPersist = "no"; + }; }; services.ssh-agent.enable = true; - } diff --git a/modules/home-manager/swaylock.nix b/modules/home-manager/swaylock.nix index b658a6c..f4c15be 100644 --- a/modules/home-manager/swaylock.nix +++ b/modules/home-manager/swaylock.nix @@ -1,38 +1,40 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.swaylock = { enable = true; settings = { - color="1e1e2e"; - bs-hl-color="f5e0dc"; - caps-lock-bs-hl-color="f5e0dc"; - caps-lock-key-hl-color="a6e3a1"; - inside-color="00000000"; - inside-clear-color = "00000000"; - inside-caps-lock-color="00000000"; - inside-ver-color="00000000"; - inside-wrong-color="00000000"; - key-hl-color="a6e3a1"; - layout-bg-color="00000000"; - layout-border-color="00000000"; - layout-text-color="cdd6f4"; - line-color="00000000"; - line-clear-color="00000000"; - line-caps-lock-color="00000000"; - line-ver-color="00000000"; - line-wrong-color="00000000"; - ring-color="b4befe"; - ring-clear-color="f5e0dc"; - ring-caps-lock-color="fab387"; - ring-ver-color="89b4fa"; - ring-wrong-color="eba0ac"; - separator-color="00000000"; - text-color="cdd6f4"; - text-clear-color="f5e0dc"; - text-caps-lock-color="fab387"; - text-ver-color="89b4fa"; - text-wrong-color="eba0ac"; + color = "1e1e2e"; + bs-hl-color = "f5e0dc"; + caps-lock-bs-hl-color = "f5e0dc"; + caps-lock-key-hl-color = "a6e3a1"; + inside-color = "00000000"; + inside-clear-color = "00000000"; + inside-caps-lock-color = "00000000"; + inside-ver-color = "00000000"; + inside-wrong-color = "00000000"; + key-hl-color = "a6e3a1"; + layout-bg-color = "00000000"; + layout-border-color = "00000000"; + layout-text-color = "cdd6f4"; + line-color = "00000000"; + line-clear-color = "00000000"; + line-caps-lock-color = "00000000"; + line-ver-color = "00000000"; + line-wrong-color = "00000000"; + ring-color = "b4befe"; + ring-clear-color = "f5e0dc"; + ring-caps-lock-color = "fab387"; + ring-ver-color = "89b4fa"; + ring-wrong-color = "eba0ac"; + separator-color = "00000000"; + text-color = "cdd6f4"; + text-clear-color = "f5e0dc"; + text-caps-lock-color = "fab387"; + text-ver-color = "89b4fa"; + text-wrong-color = "eba0ac"; }; -}; + }; } diff --git a/modules/home-manager/swaync.nix b/modules/home-manager/swaync.nix index 83ae19b..21963f0 100644 --- a/modules/home-manager/swaync.nix +++ b/modules/home-manager/swaync.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { services.swaync = { enable = true; }; diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix index d332891..cdbf56e 100644 --- a/modules/home-manager/waybar.nix +++ b/modules/home-manager/waybar.nix @@ -1,696 +1,697 @@ -{ config, pkgs, ... }: - - { + config, + pkgs, + ... +}: { programs.waybar = { enable = true; settings = [ - { - layer = "top"; - position = "left"; - margin = "5 2 5 0"; - reload_style_on_change = true; - modules-left = [ - "hyprland/workspaces" - "group/info" - "group/power" - ]; - modules-center = [ - ]; - modules-right = [ - "hyprland/window" - "group/brightness" - "group/sound" - "group/connection" - "group/together" - "tray" - "battery" - ]; - # groups settings are organized by alphabetical order - "group/audio" = { - orientation = "inherit"; - drawer = { - transition-duration = 500; - transition-left-to-right = false; - }; - modules = [ - "pulseaudio" - "pulseaudio#mic" - "pulseaudio/slider" - ]; - }; - "group/bluetooth" = { - orientation = "inherit"; - drawer = { - transition-duration = 500; - transition-left-to-right = true; - }; - modules = [ - "bluetooth" - "bluetooth#status" - ]; - }; - "group/brightness" = { - orientation = "inherit"; - drawer = { - transition-duration = 500; - transition-left-to-right = false; - }; - modules = [ - "backlight" - "backlight/slider" - ]; - }; - "group/connection" = { - orientation = "inherit"; - modules = [ "group/network" ]; - }; - "group/gcpu" = { - orientation = "inherit"; - modules = [ - "custom/cpu-icon" - "temperature" - "cpu" - ]; - }; - "group/info" = { - orientation = "inherit"; - modules = [ - "group/gcpu" - "memory" - "disk" - ]; - }; - "group/network" = { - orientation = "inherit"; - drawer = { - transition-duration = 500; - transition-left-to-right = true; - }; - modules = [ - "network" - "network#speed" - ]; - }; - "group/power" = { - orientation = "inherit"; - modules = [ - "battery#w" - "battery#powerdraw" - ]; - }; - "group/sound" = { - orientation = "inherit"; - modules = [ - "group/audio" - "custom/notification" - ]; - }; - "group/together" = { - orientation = "inherit"; - modules = [ - "group/utils" - "clock" - ]; - }; - "group/utils" = { - orientation = "inherit"; - drawer = { - transition-duration = 500; - transition-left-to-right = true; - }; - modules = [ - "custom/weather" - "custom/colorpicker" - ]; - }; - # modules settings are organized by alphabetical order - backlight = { - device = "intel_backlight"; # my laptop is amd and it works - format = "{icon}"; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - ]; - on-scroll-down = "brightnessctl s 5%-"; - on-scroll-up = "brightness s +5%"; - tooltip = true; - tooltip-format = "Brightness: {percent}%"; - smooth-scrolling-threshold = 1; - }; - "backlight/slider" = { - min = 5; - max = 100; - orientation = "vertical"; - device = "intel_backlight"; - }; - battery = { - #rotate = 90; - interval = 30; - states = { - good = 95; - warning = 20; - critical = 15; - }; - format = "{icon} {capacity}"; - format-charging = "{icon} {capacity}% "; - format-full = "{icon}"; - format-icons = [ - "󰁻" - "󰁼" - "󰁾" - "󰂀" - "󰂂" - "󰁹" - ]; - tooltip-format = "{timeTo} {capacity} %"; - }; - "battery#powerdraw" = { - rotate = 90; - interval = 10; - format = "{power:.0001f}"; - }; - "battery#w" = { - rotate = 90; - interval = 100000; - format = "W"; - }; - bluetooth = { - format-on = ""; - format-off = "󰂲"; - format-disabled = ""; - format-connected = ""; - tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected"; - tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}"; - tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; - tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; - }; - "bluetooth#status" = { - format-on = ""; - format-off = ""; - format-disabled = ""; - format-connected = "{num_connections}"; - format-connected-battery = "{device_battery_percentage}%"; - tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected"; - tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}"; - tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; - tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; - }; - clock = { - format = "{:%H\n%M}"; - tooltip-format = "{calendar}"; - calendar = { - mode = "month"; - mode-mon-col = 3; - weeks-pos = "right"; - on-scroll = 1; - on-click-right = "mode"; - format = { - today = "{}"; - }; - }; - }; - cpu = { - format = "{usage}%"; - }; - "custom/colorpicker" = { - format = ""; - on-click = "hyprpicker | tee >(wl-copy) | cliphist store"; - }; - "custom/cpu-icon" = { - format = "󰻠"; - tooltip = false; - }; - "custom/mark" = { - format = ""; - tooltip = false; - }; - "custom/weather" = { - format = "{}"; - interval = 3600; - exec = "custom-weatherwaybar"; - return-type = "json"; - }; - disk = { - interval = 600; - format = " 󰋊 \n{percentage_used}󱉸"; - path = "/"; #maybe we should subtract ~/kdrive if it is counted - }; - "hyprland/window" = { - format = "{class}"; - rotate = 90; - }; - "hyprland/workspaces" = { - format = "{icon}"; - format-icons = { - "1" = ""; - "2" = ""; - "3" = ""; - "4" = ""; - "5" = ""; - "6" = ""; - "7" = ""; - "8" = ""; - "9" = ""; - "10" = ""; - "active" = ""; - "default" = ""; - }; - persistent-workspaces = { - "*" = [ 1 2 3 4 5 6 7 8 9 10 ]; - }; - }; - idle_inhibitor = { - format = "{icon}"; - tooltip-format-activated = "Idle Inhibitor is active"; - tooltip-format-deactivated = "Idle Inhibitor is not active"; - format-icons = { - activated = "󰔡"; - deactivated = "󰔢"; - }; - }; - memory = { - format = "  \n{:2}󱉸"; - }; - network = { - format = "{icon}"; - format-icons = { - wifi = [ "󰤨" ]; - ethernet = [ "󰈀" ]; - disconnected = [ "󰖪" ]; - }; - format-wifi = "󰤨"; - format-ethernet = "󰈀"; - format-disconnected = "󰖪"; - format-linked = "󰈁"; - tooltip = false; - }; - "network#speed" = { - format = " {bandwidthDownBits} "; - rotate = 90; - interval = 5; - tooltip-format = "{ipaddr}"; - tooltip-format-wifi = "{essid} ({signalStrength}%)  \n{ipaddr} | {frequency} MHz{icon} "; - tooltip-format-ethernet = "{ifname} 󰈀 \n{ipaddr} | {frequency} MHz{icon} "; - tooltip-format-disconnected = "Not Connected to any type of Network"; - tooltip = true; - }; - power-profiles-daemon = { - format = "{icon}"; - tooltip-format = "Power profile: {profile}\nDriver: {driver}"; - tooltip = true; - format-icons = { - default = ""; - performance = ""; - balanced = ""; - power-saver = ""; - }; - }; - pulseaudio = { - format = "{icon}"; - format-bluetooth = "{icon}"; - tooltip-format = "{volume}% {icon} | {desc}"; - format-muted = "󰖁"; - format-icons = { - headphones = "󰋌"; - handsfree = "󰋌"; - headset = "󰋌"; - phone = ""; - portable = ""; - car = " "; - default = [ - "󰕿" - "󰖀" - "󰕾" - ]; - }; - on-click = "volume mute"; - on-click-middle = "pavucontrol"; - on-scroll-up = "pactl set-sink-volume @DEFAULT_SINK@ +5%"; - on-scroll-down = "pactl set-sink-volume @DEFAULT_SINK@ -5%"; - smooth-scrolling-threshold = 1; - }; - "pulseaudio#mic" = { - format = "{format_source}"; - format-source = ""; - format-source-muted = ""; - tooltip-format = "{volume}% {format_source}"; - on-click = "pactl set-source-mute 0 toggle"; - on-scroll-down = "pactl set-source-volume 0 -1%"; - on-scroll-up = "pactl set-source-volume 0 +1%"; - }; - "pulseaudio/slider" = { - min = 0; - max = 140; - orientation = "vertical"; - }; - temperature = { - format = "{temperatureC}°C"; - format-critical = "{temperatureC}°C"; - interval = 10; - }; - tray = { - icon-size = 18; - spacing = 10; - }; - } + { + layer = "top"; + position = "left"; + margin = "5 2 5 0"; + reload_style_on_change = true; + modules-left = [ + "hyprland/workspaces" + "group/info" + "group/power" + ]; + modules-center = [ + ]; + modules-right = [ + "hyprland/window" + "group/brightness" + "group/sound" + "group/connection" + "group/together" + "tray" + "battery" + ]; + # groups settings are organized by alphabetical order + "group/audio" = { + orientation = "inherit"; + drawer = { + transition-duration = 500; + transition-left-to-right = false; + }; + modules = [ + "pulseaudio" + "pulseaudio#mic" + "pulseaudio/slider" + ]; + }; + "group/bluetooth" = { + orientation = "inherit"; + drawer = { + transition-duration = 500; + transition-left-to-right = true; + }; + modules = [ + "bluetooth" + "bluetooth#status" + ]; + }; + "group/brightness" = { + orientation = "inherit"; + drawer = { + transition-duration = 500; + transition-left-to-right = false; + }; + modules = [ + "backlight" + "backlight/slider" + ]; + }; + "group/connection" = { + orientation = "inherit"; + modules = ["group/network"]; + }; + "group/gcpu" = { + orientation = "inherit"; + modules = [ + "custom/cpu-icon" + "temperature" + "cpu" + ]; + }; + "group/info" = { + orientation = "inherit"; + modules = [ + "group/gcpu" + "memory" + "disk" + ]; + }; + "group/network" = { + orientation = "inherit"; + drawer = { + transition-duration = 500; + transition-left-to-right = true; + }; + modules = [ + "network" + "network#speed" + ]; + }; + "group/power" = { + orientation = "inherit"; + modules = [ + "battery#w" + "battery#powerdraw" + ]; + }; + "group/sound" = { + orientation = "inherit"; + modules = [ + "group/audio" + "custom/notification" + ]; + }; + "group/together" = { + orientation = "inherit"; + modules = [ + "group/utils" + "clock" + ]; + }; + "group/utils" = { + orientation = "inherit"; + drawer = { + transition-duration = 500; + transition-left-to-right = true; + }; + modules = [ + "custom/weather" + "custom/colorpicker" + ]; + }; + # modules settings are organized by alphabetical order + backlight = { + device = "intel_backlight"; # my laptop is amd and it works + format = "{icon}"; + format-icons = [ + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + ]; + on-scroll-down = "brightnessctl s 5%-"; + on-scroll-up = "brightness s +5%"; + tooltip = true; + tooltip-format = "Brightness: {percent}%"; + smooth-scrolling-threshold = 1; + }; + "backlight/slider" = { + min = 5; + max = 100; + orientation = "vertical"; + device = "intel_backlight"; + }; + battery = { + #rotate = 90; + interval = 30; + states = { + good = 95; + warning = 20; + critical = 15; + }; + format = "{icon} {capacity}"; + format-charging = "{icon} {capacity}% "; + format-full = "{icon}"; + format-icons = [ + "󰁻" + "󰁼" + "󰁾" + "󰂀" + "󰂂" + "󰁹" + ]; + tooltip-format = "{timeTo} {capacity} %"; + }; + "battery#powerdraw" = { + rotate = 90; + interval = 10; + format = "{power:.0001f}"; + }; + "battery#w" = { + rotate = 90; + interval = 100000; + format = "W"; + }; + bluetooth = { + format-on = ""; + format-off = "󰂲"; + format-disabled = ""; + format-connected = ""; + tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected"; + tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}"; + tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; + tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; + }; + "bluetooth#status" = { + format-on = ""; + format-off = ""; + format-disabled = ""; + format-connected = "{num_connections}"; + format-connected-battery = "{device_battery_percentage}%"; + tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected"; + tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}"; + tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; + tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; + }; + clock = { + format = "{:%H\n%M}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "month"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + today = "{}"; + }; + }; + }; + cpu = { + format = "{usage}%"; + }; + "custom/colorpicker" = { + format = ""; + on-click = "hyprpicker | tee >(wl-copy) | cliphist store"; + }; + "custom/cpu-icon" = { + format = "󰻠"; + tooltip = false; + }; + "custom/mark" = { + format = ""; + tooltip = false; + }; + "custom/weather" = { + format = "{}"; + interval = 3600; + exec = "custom-weatherwaybar"; + return-type = "json"; + }; + disk = { + interval = 600; + format = " 󰋊 \n{percentage_used}󱉸"; + path = "/"; #maybe we should subtract ~/kdrive if it is counted + }; + "hyprland/window" = { + format = "{class}"; + rotate = 90; + }; + "hyprland/workspaces" = { + format = "{icon}"; + format-icons = { + "1" = ""; + "2" = ""; + "3" = ""; + "4" = ""; + "5" = ""; + "6" = ""; + "7" = ""; + "8" = ""; + "9" = ""; + "10" = ""; + "active" = ""; + "default" = ""; + }; + persistent-workspaces = { + "*" = [1 2 3 4 5 6 7 8 9 10]; + }; + }; + idle_inhibitor = { + format = "{icon}"; + tooltip-format-activated = "Idle Inhibitor is active"; + tooltip-format-deactivated = "Idle Inhibitor is not active"; + format-icons = { + activated = "󰔡"; + deactivated = "󰔢"; + }; + }; + memory = { + format = "  \n{:2}󱉸"; + }; + network = { + format = "{icon}"; + format-icons = { + wifi = ["󰤨"]; + ethernet = ["󰈀"]; + disconnected = ["󰖪"]; + }; + format-wifi = "󰤨"; + format-ethernet = "󰈀"; + format-disconnected = "󰖪"; + format-linked = "󰈁"; + tooltip = false; + }; + "network#speed" = { + format = " {bandwidthDownBits} "; + rotate = 90; + interval = 5; + tooltip-format = "{ipaddr}"; + tooltip-format-wifi = "{essid} ({signalStrength}%)  \n{ipaddr} | {frequency} MHz{icon} "; + tooltip-format-ethernet = "{ifname} 󰈀 \n{ipaddr} | {frequency} MHz{icon} "; + tooltip-format-disconnected = "Not Connected to any type of Network"; + tooltip = true; + }; + power-profiles-daemon = { + format = "{icon}"; + tooltip-format = "Power profile: {profile}\nDriver: {driver}"; + tooltip = true; + format-icons = { + default = ""; + performance = ""; + balanced = ""; + power-saver = ""; + }; + }; + pulseaudio = { + format = "{icon}"; + format-bluetooth = "{icon}"; + tooltip-format = "{volume}% {icon} | {desc}"; + format-muted = "󰖁"; + format-icons = { + headphones = "󰋌"; + handsfree = "󰋌"; + headset = "󰋌"; + phone = ""; + portable = ""; + car = " "; + default = [ + "󰕿" + "󰖀" + "󰕾" + ]; + }; + on-click = "volume mute"; + on-click-middle = "pavucontrol"; + on-scroll-up = "pactl set-sink-volume @DEFAULT_SINK@ +5%"; + on-scroll-down = "pactl set-sink-volume @DEFAULT_SINK@ -5%"; + smooth-scrolling-threshold = 1; + }; + "pulseaudio#mic" = { + format = "{format_source}"; + format-source = ""; + format-source-muted = ""; + tooltip-format = "{volume}% {format_source}"; + on-click = "pactl set-source-mute 0 toggle"; + on-scroll-down = "pactl set-source-volume 0 -1%"; + on-scroll-up = "pactl set-source-volume 0 +1%"; + }; + "pulseaudio/slider" = { + min = 0; + max = 140; + orientation = "vertical"; + }; + temperature = { + format = "{temperatureC}°C"; + format-critical = "{temperatureC}°C"; + interval = 10; + }; + tray = { + icon-size = 18; + spacing = 10; + }; + } ]; # home-manager wants the whole config as a list of bars style = '' -@define-color foreground #c5c5c5; -@define-color background #191919; -@define-color cursor #c5c5c5; + @define-color foreground #c5c5c5; + @define-color background #191919; + @define-color cursor #c5c5c5; -@define-color color0 #191919; -@define-color color1 #3a3632; -@define-color color2 #582c1e; -@define-color color3 #423f39; -@define-color color4 #50473c; -@define-color color5 #634723; -@define-color color6 #BAA470; -@define-color color7 #8c8c8c; -@define-color color8 #525252; -@define-color color9 #4e4843; -@define-color color10 #763b28; -@define-color color11 #59554c; -@define-color color12 #6b5f51; -@define-color color13 #855f2f; -@define-color color14 #796d62; -@define-color color15 #c5c5c5; + @define-color color0 #191919; + @define-color color1 #3a3632; + @define-color color2 #582c1e; + @define-color color3 #423f39; + @define-color color4 #50473c; + @define-color color5 #634723; + @define-color color6 #BAA470; + @define-color color7 #8c8c8c; + @define-color color8 #525252; + @define-color color9 #4e4843; + @define-color color10 #763b28; + @define-color color11 #59554c; + @define-color color12 #6b5f51; + @define-color color13 #855f2f; + @define-color color14 #796d62; + @define-color color15 #c5c5c5; -@define-color active @color6; + @define-color active @color6; -* { - font-size: 23px; - font-family: "0xProto Nerd Font"; - min-width: 8px; - min-height: 0px; - border: none; - border-radius: 0; - box-shadow: none; - text-shadow: none; - padding: 0px; - margin: 0px; + * { + font-size: 23px; + font-family: "0xProto Nerd Font"; + min-width: 8px; + min-height: 0px; + border: none; + border-radius: 0; + box-shadow: none; + text-shadow: none; + padding: 0px; + margin: 0px; -} + } -window#waybar { - transition-property: background-color; - transition-duration: 0.5s; - border-radius: 8px; - border: 2px solid @active; - background: @background; - background: alpha(@background, 0.7); - color: lighter(@active); -} + window#waybar { + transition-property: background-color; + transition-duration: 0.5s; + border-radius: 8px; + border: 2px solid @active; + background: @background; + background: alpha(@background, 0.7); + color: lighter(@active); + } -menu, -tooltip { - border-radius: 8px; - padding: 2px; - border: 1px solid lighter(@active); - background: alpha(@background, 0.6); + menu, + tooltip { + border-radius: 8px; + padding: 2px; + border: 1px solid lighter(@active); + background: alpha(@background, 0.6); - color: lighter(@active); -} + color: lighter(@active); + } -menu label, -tooltip label { - font-size: 20px; - color: lighter(@active); -} + menu label, + tooltip label { + font-size: 20px; + color: lighter(@active); + } -#submap, -#tray>.needs-attention { - animation-name: blink-active; - animation-duration: 1s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} + #submap, + #tray>.needs-attention { + animation-name: blink-active; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } -.modules-right { - margin: 0px 6px 6px 6px; - border-radius: 4px; - background: alpha(@background, 0.4); - color: lighter(@active); -} + .modules-right { + margin: 0px 6px 6px 6px; + border-radius: 4px; + background: alpha(@background, 0.4); + color: lighter(@active); + } -.modules-left { - transition-property: background-color; - transition-duration: 0.5s; - margin: 6px 6px 6px 6px; - border-radius: 4px; - background: alpha(@background, 0.4); - color: lighter(@active); -} + .modules-left { + transition-property: background-color; + transition-duration: 0.5s; + margin: 6px 6px 6px 6px; + border-radius: 4px; + background: alpha(@background, 0.4); + color: lighter(@active); + } -#gcpu, -#custom-github, -#memory, -#disk, -#together, -#submap, -#custom-weather { - font-size: 17px; -} + #gcpu, + #custom-github, + #memory, + #disk, + #together, + #submap, + #custom-weather { + font-size: 17px; + } -#custom-recorder, -#connection, -#cnoti, -#brightness, -#power, -#custom-updates, -#tray, -#audio, -#privacy, -#sound { - border-radius: 4px; - margin: 2px 2px 4px 2px; - background: alpha(darker(@active), 0.3); -} + #custom-recorder, + #connection, + #cnoti, + #brightness, + #power, + #custom-updates, + #tray, + #audio, + #privacy, + #sound { + border-radius: 4px; + margin: 2px 2px 4px 2px; + background: alpha(darker(@active), 0.3); + } -#custom-notifications { - padding-left: 4px; -} + #custom-notifications { + padding-left: 4px; + } -#custom-hotspot, -#custom-github, -#custom-notifications { - font-size: 20px; -} + #custom-hotspot, + #custom-github, + #custom-notifications { + font-size: 20px; + } -#custom-hotspot { - padding-right: 2px; -} + #custom-hotspot { + padding-right: 2px; + } -#custom-vpn, -#custom-hotspot { - background: alpha(darker(@active), 0.3); -} + #custom-vpn, + #custom-hotspot { + background: alpha(darker(@active), 0.3); + } -#privacy-item { - padding: 6px 0px 6px 6px; -} + #privacy-item { + padding: 6px 0px 6px 6px; + } -#gcpu { - padding: 8px 0px 8px 0px; -} + #gcpu { + padding: 8px 0px 8px 0px; + } -#custom-cpu-icon { - font-size: 36px; -} + #custom-cpu-icon { + font-size: 36px; + } -#custom-cputemp, -#temperature { - font-size: 17px; -} -#disk, -#memory, -#cpu { - font-size: 20px; - font-weight: bold; -} + #custom-cputemp, + #temperature { + font-size: 17px; + } + #disk, + #memory, + #cpu { + font-size: 20px; + font-weight: bold; + } -#custom-github { - padding-top: 2px; - padding-right: 4px; -} + #custom-github { + padding-top: 2px; + padding-right: 4px; + } -#custom-dmark { - color: alpha(@foreground, 0.3); -} + #custom-dmark { + color: alpha(@foreground, 0.3); + } -#submap { - margin-bottom: 0px; -} + #submap { + margin-bottom: 0px; + } -#hyprland.window { - margin-left: 20px; -} + #hyprland.window { + margin-left: 20px; + } -#workspaces { - margin: 0px 2px; - padding: 4px 0px 0px 0px; - border-radius: 8px; -} + #workspaces { + margin: 0px 2px; + padding: 4px 0px 0px 0px; + border-radius: 8px; + } -#workspaces button { - transition-property: background-color; - transition-duration: 0.5s; - color: @foreground; - background: transparent; - border-radius: 4px; - color: alpha(@foreground, 0.3); -} + #workspaces button { + transition-property: background-color; + transition-duration: 0.5s; + color: @foreground; + background: transparent; + border-radius: 4px; + color: alpha(@foreground, 0.3); + } -#workspaces button.urgent { - font-weight: bold; - color: @foreground; -} + #workspaces button.urgent { + font-weight: bold; + color: @foreground; + } -#workspaces button.active { - padding: 4px 2px; - background: alpha(@active, 0.4); - color: lighter(@active); - border-radius: 4px; -} + #workspaces button.active { + padding: 4px 2px; + background: alpha(@active, 0.4); + color: lighter(@active); + border-radius: 4px; + } -#network.wifi { - padding-right: 4px; -} + #network.wifi { + padding-right: 4px; + } -#submap { - min-width: 0px; - margin: 4px 6px 4px 6px; -} + #submap { + min-width: 0px; + margin: 4px 6px 4px 6px; + } -#tray { - padding: 0px 0px 0px 0px; -} + #tray { + padding: 0px 0px 0px 0px; + } -#bluetooth { - padding-top: 2px; -} + #bluetooth { + padding-top: 2px; + } -#window { - border-radius: 8px; - padding: 4px 14px; - margin: 4px 2px 4px 2px; -} + #window { + border-radius: 8px; + padding: 4px 14px; + margin: 4px 2px 4px 2px; + } -#battery { - font-size: 17px; - border-radius: 8px; - padding: 4px 0px; - margin: 4px 2px 4px 2px; -} + #battery { + font-size: 17px; + border-radius: 8px; + padding: 4px 0px; + margin: 4px 2px 4px 2px; + } -#battery.discharging.warning { - animation-name: blink-yellow; - animation-duration: 1s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} + #battery.discharging.warning { + animation-name: blink-yellow; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } -#battery.discharging.critical { - animation-name: blink-red; - animation-duration: 1s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} + #battery.discharging.critical { + animation-name: blink-red; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } -#battery.powerdraw { - font-size: 17px; - padding: 0; - margin-right: -20px; - margin-left: -20px; -} -#battery.w { - font-size: 17px; - padding: 0; - margin-left: -20px; - margin-right: -20px; -} + #battery.powerdraw { + font-size: 17px; + padding: 0; + margin-right: -20px; + margin-left: -20px; + } + #battery.w { + font-size: 17px; + padding: 0; + margin-left: -20px; + margin-right: -20px; + } -#clock { - font-weight: bold; - padding: 4px 2px 2px 2px; -} + #clock { + font-weight: bold; + padding: 4px 2px 2px 2px; + } -#pulseaudio.mic { - border-radius: 4px; - color: @background; - background: alpha(darker(@foreground), 0.6); - padding-left: 4px; -} + #pulseaudio.mic { + border-radius: 4px; + color: @background; + background: alpha(darker(@foreground), 0.6); + padding-left: 4px; + } -#backlight-slider slider, -#pulseaudio-slider slider { - background-color: transparent; - box-shadow: none; -} + #backlight-slider slider, + #pulseaudio-slider slider { + background-color: transparent; + box-shadow: none; + } -#backlight-slider trough, -#pulseaudio-slider trough { - margin-top: 4px; - min-width: 6px; - min-height: 60px; - border-radius: 8px; - background-color: alpha(@background, 0.6); -} + #backlight-slider trough, + #pulseaudio-slider trough { + margin-top: 4px; + min-width: 6px; + min-height: 60px; + border-radius: 8px; + background-color: alpha(@background, 0.6); + } -#backlight-slider highlight, -#pulseaudio-slider highlight { - border-radius: 8px; - background-color: lighter(@active); -} + #backlight-slider highlight, + #pulseaudio-slider highlight { + border-radius: 8px; + background-color: lighter(@active); + } -#bluetooth.discoverable, -#bluetooth.discovering, -#bluetooth.pairable { - border-radius: 8px; - animation-name: blink-active; - animation-duration: 1s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} + #bluetooth.discoverable, + #bluetooth.discovering, + #bluetooth.pairable { + border-radius: 8px; + animation-name: blink-active; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } -@keyframes blink-active { - to { - background-color: @active; - color: @foreground; - } -} + @keyframes blink-active { + to { + background-color: @active; + color: @foreground; + } + } -@keyframes blink-red { - to { - background-color: #c64d4f; - color: @foreground; - } -} + @keyframes blink-red { + to { + background-color: #c64d4f; + color: @foreground; + } + } -@keyframes blink-yellow { - to { - background-color: #cf9022; - color: @foreground; - } -} + @keyframes blink-yellow { + to { + background-color: #cf9022; + color: @foreground; + } + } ''; -}; + }; } diff --git a/modules/home-manager/wlogout.nix b/modules/home-manager/wlogout.nix index a98f194..3184d9d 100644 --- a/modules/home-manager/wlogout.nix +++ b/modules/home-manager/wlogout.nix @@ -1,5 +1,8 @@ -{ config, pkgs, ... }: -let +{ + config, + pkgs, + ... +}: let wallpaper = ../../assets/wallpaper1.jpg; lock = ../../assets/lock.png; lock-hover = ../../assets/lock-hover.png; @@ -9,8 +12,7 @@ let logout-hover = ../../assets/logout-hover.png; reboot = ../../assets/restart.png; reboot-hover = ../../assets/restart-hover.png; -in -{ +in { programs.wlogout = { enable = true; layout = [ @@ -40,78 +42,78 @@ in } ]; style = '' -window { - font-family: OxProto Nerd Font; - font-size: 14pt; - color: #000000; /* text */ - background-color: rgba(40, 40, 40, 0.76); -} + window { + font-family: OxProto Nerd Font; + font-size: 14pt; + color: #000000; /* text */ + background-color: rgba(40, 40, 40, 0.76); + } -button { - background-repeat: no-repeat; - background-position: center; - background-size: 50%; - border-style: solid; - border-radius: 4px; - border-width: 2px; - border-color: #ebdbb2; - background-color: rgba(40, 40, 40, 0.76); - margin: 10px; - transition: - box-shadow 0.3s ease-in-out, - background-color 0.3s ease-in-out; -} + button { + background-repeat: no-repeat; + background-position: center; + background-size: 50%; + border-style: solid; + border-radius: 4px; + border-width: 2px; + border-color: #ebdbb2; + background-color: rgba(40, 40, 40, 0.76); + margin: 10px; + transition: + box-shadow 0.3s ease-in-out, + background-color 0.3s ease-in-out; + } -button:hover { - background-color: rgba(250, 137, 26, 0.3); - color: #282828; -} + button:hover { + background-color: rgba(250, 137, 26, 0.3); + color: #282828; + } -button:focus { - background-color: #ebdbb2; - color: #282828; -} + button:focus { + background-color: #ebdbb2; + color: #282828; + } -#lock { - background-image: image(url("${lock}")); -} -#lock:focus { - background-image: image(url("${lock-hover}")); -} -#lock:hover { - background-image: image(url("${lock-hover}")); -} + #lock { + background-image: image(url("${lock}")); + } + #lock:focus { + background-image: image(url("${lock-hover}")); + } + #lock:hover { + background-image: image(url("${lock-hover}")); + } -#logout { - background-image: image(url("${logout}")); -} -#logout:focus { - background-image: image(url("${logout-hover}")); -} -#logout:hover { - background-image: image(url("${logout-hover}")); -} + #logout { + background-image: image(url("${logout}")); + } + #logout:focus { + background-image: image(url("${logout-hover}")); + } + #logout:hover { + background-image: image(url("${logout-hover}")); + } -#shutdown { - background-image: image(url("${shutdown}")); -} -#shutdown:focus { - background-image: image(url("${shutdown-hover}")); -} -#shutdown:hover { - background-image: image(url("${shutdown-hover}")); -} + #shutdown { + background-image: image(url("${shutdown}")); + } + #shutdown:focus { + background-image: image(url("${shutdown-hover}")); + } + #shutdown:hover { + background-image: image(url("${shutdown-hover}")); + } -#reboot { - background-image: image(url("${reboot}")); -} -#reboot:focus { - background-image: image(url("${reboot-hover}")); -} -#reboot:hover { - background-image: image(url("${reboot-hover}")); -} -''; -}; + #reboot { + background-image: image(url("${reboot}")); + } + #reboot:focus { + background-image: image(url("${reboot-hover}")); + } + #reboot:hover { + background-image: image(url("${reboot-hover}")); + } + ''; + }; } diff --git a/modules/home-manager/zoxide.nix b/modules/home-manager/zoxide.nix index cb6a272..ec3fd0d 100644 --- a/modules/home-manager/zoxide.nix +++ b/modules/home-manager/zoxide.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.zoxide = { enable = true; enableZshIntegration = true; diff --git a/modules/home-manager/zsh.nix b/modules/home-manager/zsh.nix index 1cfda9d..4402ceb 100644 --- a/modules/home-manager/zsh.nix +++ b/modules/home-manager/zsh.nix @@ -1,33 +1,34 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.zsh = { enable = true; autosuggestion.enable = true; initContent = '' -# Safe cat that uses colorize plugin ccat -custom-cat() { - if [[ -t 1 ]]; then - ccat "$@" - else - command cat "$@" - fi -} + # Safe cat that uses colorize plugin ccat + custom-cat() { + if [[ -t 1 ]]; then + ccat "$@" + else + command cat "$@" + fi + } - fastfetch''\n'' - ; + fastfetch''\n''; shellAliases = { - ".." = "z .."; - grep = "rg"; - ll = "ls -alF"; - la = "ls -A"; - l = "ls -CF"; - ls = "ls -hA -s --color"; - cat = "custom-cat"; - pomodoro = "custom-tomato"; - librewolf = "kitty --class \"custom-librewolfprofiles\" --name \"Select LibreWolf profile\" --hold custom-librewolfprofiles"; - manix = "custom-manix"; - man = "custom-man"; - }; + ".." = "z .."; + grep = "rg"; + ll = "ls -alF"; + la = "ls -A"; + l = "ls -CF"; + ls = "ls -hA -s --color"; + cat = "custom-cat"; + pomodoro = "custom-tomato"; + librewolf = "kitty --class \"custom-librewolfprofiles\" --name \"Select LibreWolf profile\" --hold custom-librewolfprofiles"; + manix = "custom-manix"; + man = "custom-man"; + }; }; } diff --git a/modules/nixos/anki.nix b/modules/nixos/anki.nix index 996db13..0f4f7bb 100644 --- a/modules/nixos/anki.nix +++ b/modules/nixos/anki.nix @@ -1,56 +1,57 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { environment.systemPackages = with pkgs; [ (pkgs.anki.withAddons [ (pkgs.ankiAddons.recolor.withConfig { config = { -# we must specify all the colors or it crashes as this overwrite the whole colors set + # we must specify all the colors or it crashes as this overwrite the whole colors set colors = { - # ===== Foregrounds ===== - FG = [ "Foreground" "#ebdbb2" "#ebdbb2" "" ]; - FG_SUBTLE = [ "Subtle FG" "#d5c4a1" "#d5c4a1" "" ]; - FG_FAINT = [ "Faint FG" "#a89984" "#a89984" "" ]; - FG_DISABLED = [ "Disabled FG" "#928374" "#928374" "" ]; + # ===== Foregrounds ===== + FG = ["Foreground" "#ebdbb2" "#ebdbb2" ""]; + FG_SUBTLE = ["Subtle FG" "#d5c4a1" "#d5c4a1" ""]; + FG_FAINT = ["Faint FG" "#a89984" "#a89984" ""]; + FG_DISABLED = ["Disabled FG" "#928374" "#928374" ""]; - # ===== Main Background Layers ===== - BG = [ "Background" "#1d2021" "#1d2021" "" ]; - MAIN_BG = [ "Main Background" "#1d2021" "#1d2021" "" ]; - VIEW_BG = [ "View Background" "#282828" "#282828" "" ]; - EDITOR_BG = [ "Editor Background" "#282828" "#282828" "" ]; - CANVAS = [ "Canvas" "#282828" "#282828" "" ]; - CANVAS_ELEVATED = [ "Elevated Canvas" "#32302f" "#32302f" "" ]; + # ===== Main Background Layers ===== + BG = ["Background" "#1d2021" "#1d2021" ""]; + MAIN_BG = ["Main Background" "#1d2021" "#1d2021" ""]; + VIEW_BG = ["View Background" "#282828" "#282828" ""]; + EDITOR_BG = ["Editor Background" "#282828" "#282828" ""]; + CANVAS = ["Canvas" "#282828" "#282828" ""]; + CANVAS_ELEVATED = ["Elevated Canvas" "#32302f" "#32302f" ""]; - # ===== Tables & Lists ===== - TABLE_BG = [ "Table Background" "#282828" "#282828" "" ]; - TABLE_ALT_BG = [ "Table Alt Background" "#32302f" "#32302f" "" ]; - HEADER_BG = [ "Header Background" "#3c3836" "#3c3836" "" ]; - SELECTED_BG = [ "Selected Background" "#504945" "#504945" "" ]; + # ===== Tables & Lists ===== + TABLE_BG = ["Table Background" "#282828" "#282828" ""]; + TABLE_ALT_BG = ["Table Alt Background" "#32302f" "#32302f" ""]; + HEADER_BG = ["Header Background" "#3c3836" "#3c3836" ""]; + SELECTED_BG = ["Selected Background" "#504945" "#504945" ""]; - # ===== Borders ===== - BORDER = [ "Border" "#504945" "#504945" "" ]; - FAINT_BORDER = [ "Faint Border" "#3c3836" "#3c3836" "" ]; + # ===== Borders ===== + BORDER = ["Border" "#504945" "#504945" ""]; + FAINT_BORDER = ["Faint Border" "#3c3836" "#3c3836" ""]; - # ===== Buttons ===== - BUTTON_GRADIENT_START = [ "Button Start" "#3c3836" "#3c3836" "" ]; - BUTTON_GRADIENT_END = [ "Button End" "#3c3836" "#3c3836" "" ]; - BUTTON_HOVER = [ "Button Hover" "#665c54" "#665c54" "" ]; + # ===== Buttons ===== + BUTTON_GRADIENT_START = ["Button Start" "#3c3836" "#3c3836" ""]; + BUTTON_GRADIENT_END = ["Button End" "#3c3836" "#3c3836" ""]; + BUTTON_HOVER = ["Button Hover" "#665c54" "#665c54" ""]; - # ===== Accent & Links ===== - ACCENT = [ "Accent" "#458588" "#458588" "" ]; - LINK = [ "Link" "#83a598" "#83a598" "" ]; - LINK_HOVER = [ "Link Hover" "#8ec07c" "#8ec07c" "" ]; + # ===== Accent & Links ===== + ACCENT = ["Accent" "#458588" "#458588" ""]; + LINK = ["Link" "#83a598" "#83a598" ""]; + LINK_HOVER = ["Link Hover" "#8ec07c" "#8ec07c" ""]; - # ===== Status ===== - WARNING = [ "Warning" "#fe8019" "#fe8019" "" ]; - ERROR = [ "Error" "#fb4934" "#fb4934" "" ]; - SUCCESS = [ "Success" "#8ec07c" "#8ec07c" "" ]; + # ===== Status ===== + WARNING = ["Warning" "#fe8019" "#fe8019" ""]; + ERROR = ["Error" "#fb4934" "#fb4934" ""]; + SUCCESS = ["Success" "#8ec07c" "#8ec07c" ""]; }; - }; -# version = { major = 3; minor = 1; }; -# let nixpkgs handle the version + }; + # version = { major = 3; minor = 1; }; + # let nixpkgs handle the version }) ]) ]; - } diff --git a/modules/nixos/battery.nix b/modules/nixos/battery.nix index 16e2dd6..1e2080e 100644 --- a/modules/nixos/battery.nix +++ b/modules/nixos/battery.nix @@ -1,47 +1,42 @@ # https://discourse.nixos.org/t/what-is-the-best-option-for-power-management/63406/2 -{ - ... -}: - +{...}: # we just activate tlp unconditonally - #let # cfg = config.custom; - #hasBattery = # lib.any (x: lib.strings.hasPrefix "BAT" x) # (builtins.attrNames (builtins.readDir "/sys/class/power_supply")); -#in +#in { -# options.custom = { -# battery.enable = lib.mkOption { -# default = hasBattery; -# description = "Enable better battery support"; -# type = lib.types.bool; -# }; -# }; + # options.custom = { + # battery.enable = lib.mkOption { + # default = hasBattery; + # description = "Enable better battery support"; + # type = lib.types.bool; + # }; + # }; -# config = lib.mkIf cfg.battery.enable { - powerManagement.powertop.enable = true; # enable powertop auto tuning on startup. - services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!! - services.thermald.enable = true; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs) - services.power-profiles-daemon.enable = false; # Disable GNOMEs power management - services.tlp = { - enable = true; # Enable TLP (better than gnomes internal power manager) - settings = { - CPU_BOOST_ON_AC = 1; - CPU_BOOST_ON_BAT = 1; - CPU_HWP_DYN_BOOST_ON_AC = 1; - CPU_HWP_DYN_BOOST_ON_BAT = 1; - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; - PLATFORM_PROFILE_ON_AC = "performance"; - PLATFORM_PROFILE_ON_BAT = "balanced"; - START_CHARGE_THRESH_BAT1 = 75; - STOP_CHARGE_THRESH_BAT1= 85; - }; + # config = lib.mkIf cfg.battery.enable { + powerManagement.powertop.enable = true; # enable powertop auto tuning on startup. + services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!! + services.thermald.enable = true; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs) + services.power-profiles-daemon.enable = false; # Disable GNOMEs power management + services.tlp = { + enable = true; # Enable TLP (better than gnomes internal power manager) + settings = { + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 1; + CPU_HWP_DYN_BOOST_ON_AC = 1; + CPU_HWP_DYN_BOOST_ON_BAT = 1; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; + PLATFORM_PROFILE_ON_AC = "performance"; + PLATFORM_PROFILE_ON_BAT = "balanced"; + START_CHARGE_THRESH_BAT1 = 75; + STOP_CHARGE_THRESH_BAT1 = 85; }; -# }; + }; + # }; } diff --git a/modules/nixos/ly.nix b/modules/nixos/ly.nix index 8738108..860bb9c 100644 --- a/modules/nixos/ly.nix +++ b/modules/nixos/ly.nix @@ -1,6 +1,4 @@ -{ ...}: - -{ +{...}: { services.displayManager.ly = { enable = true; settings = { @@ -16,107 +14,107 @@ # Blank main box background # Setting to false will make it transparent blank_box = false; - + # Border foreground color id border_fg = "0x00FFFFFF"; - + # Title to show at the top of the main box # If set to null, none will be shown box_title = null; - + # Brightness decrease command brightness_down_cmd = "$PREFIX_DIRECTORY/bin/brightnessctl -q -n s 10%-"; - + # Brightness decrease key combination, or null to disable brightness_down_key = "F5"; - + # Brightness increase command brightness_up_cmd = "$PREFIX_DIRECTORY/bin/brightnessctl -q -n s +10%"; - + # Brightness increase key combination, or null to disable brightness_up_key = "F6"; - + # Erase password input on failure clear_password = true; - + # Format string for clock in top right corner (see strftime specification). Example: %c # If null, the clock won't be shown clock = true; - + # CMatrix animation foreground color id cmatrix_fg = "0x0000FF00"; - + # CMatrix animation character string head color id cmatrix_head_col = "0x01FFFFFF"; - + # CMatrix animation minimum codepoint. It uses a 16-bit integer # For Japanese characters for example, you can use 0x3000 here cmatrix_min_codepoint = "0x21"; - + # CMatrix animation maximum codepoint. It uses a 16-bit integer # For Japanese characters for example, you can use 0x30FF here cmatrix_max_codepoint = "0x7B"; - + # Color mixing animation first color id colormix_col1 = "0x00FF0000"; - + # Color mixing animation second color id colormix_col2 = "0x000000FF"; - + # Color mixing animation third color id colormix_col3 = "0x20000000"; - + # Custom sessions directory # You can specify multiple directories, # e.g. $CONFIG_DIRECTORY/ly/custom-sessions:$PREFIX_DIRECTORY/share/custom-sessions custom_sessions = "$CONFIG_DIRECTORY/ly/custom-sessions"; - + # Input box active by default on startup # Available inputs: info_line, session, login, password default_input = "password"; - + # DOOM animation fire height (1 thru 9) doom_fire_height = 6; - + # DOOM animation fire spread (0 thru 4) doom_fire_spread = 2; - + # DOOM animation custom top color (low intensity flames) doom_top_color = "0x009F2707"; - + # DOOM animation custom middle color (medium intensity flames) doom_middle_color = "0x00C78F17"; - + # DOOM animation custom bottom color (high intensity flames) doom_bottom_color = "0x00FFFFFF"; - + # Dur file path dur_file_path = "$CONFIG_DIRECTORY/ly/example.dur"; - + # Dur file alignment # The dur file can be aligned with a direction and centered easily with the flags below # Available inputs: topleft, topcenter, topright, centerleft, center, centerright, bottomleft, bottomcenter, bottomright dur_offset_alignment = "center"; - + # Dur offset x direction (value is added to the current position determined by alignment, negatives are supported) dur_x_offset = 0; - + # Dur offset y direction (value is added to the current position determined by alignment, negatives are supported) dur_y_offset = 0; - + # Set margin to the edges of the DM (useful for curved monitors) edge_margin = 0; - + # Error background color id error_bg = "0x00000000"; - + # Error foreground color id # Default is red and bold error_fg = "0x01FF0000"; - + # Foreground color id fg = "0x00FFFFFF"; - + # Render true colors (if supported) # If false, output will be in eight-color mode # All eight-color mode color codes: @@ -134,108 +132,108 @@ # Note: If using the dur_file animation option and the dur file's color range # is saved as 256 with this option disabled, the file will not be drawn. full_color = true; - + # Game of Life entropy interval (0 = disabled, >0 = add entropy every N generations) # 0 -> Pure Conway's Game of Life (will eventually stabilize) # 10 -> Add entropy every 10 generations (recommended for continuous activity) # 50+ -> Less frequent entropy for more natural evolution gameoflife_entropy_interval = 10; - + # Game of Life animation foreground color id gameoflife_fg = "0x0000FF00"; - + # Game of Life frame delay (lower = faster animation, higher = slower) # 1-3 -> Very fast animation # 6 -> Default smooth animation speed # 10+ -> Slower, more contemplative speed gameoflife_frame_delay = 3; - + # Game of Life initial cell density (0.0 to 1.0) # 0.1 -> Sparse, minimal activity # 0.4 -> Balanced activity (recommended) # 0.7+ -> Dense, chaotic patterns gameoflife_initial_density = 0.666; - + # Command executed when pressing hibernate key (can be null) hibernate_cmd = null; - + # Specifies the key combination used for hibernate hibernate_key = "F4"; - + # Remove main box borders hide_borders = false; - + # Remove power management command hints hide_key_hints = false; - + # Remove keyboard lock states from the top right corner hide_keyboard_locks = false; - + # Remove version number from the top left corner hide_version_string = false; - + # Command executed when no input is detected for a certain time # If null, no command will be executed inactivity_cmd = null; - + # Executes a command after a certain amount of seconds inactivity_delay = 0; - + # Initial text to show on the info line # If set to null, the info line defaults to the hostname initial_info_text = null; - + # Input boxes length input_len = 34; - + # Active language # Available languages are found in $CONFIG_DIRECTORY/ly/lang/ lang = "en"; - + # Command executed when logging in # If null, no command will be executed # Important: the code itself must end with `exec "$@"` in order to launch the session! # You can also set environment variables in there, they'll persist until logout login_cmd = null; - + # Path for login.defs file (used for listing all local users on the system on # Linux) #login_defs_path = /etc/login.defs - + # Command executed when logging out # If null, no command will be executed # Important: the session will already be terminated when this command is executed, so # no need to add `exec "$@"` at the end logout_cmd = null; - + # General log file path #ly_log = /var/log/ly.log - + # Main box horizontal margin margin_box_h = 2; - + # Main box vertical margin margin_box_v = 1; - + # Set numlock on/off at startup numlock = false; - + # Default path # If null, ly doesn't set a path #path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - + # Command executed when pressing restart_key #restart_cmd = "/sbin/shutdown -r now" - + # Specifies the key combination used for restart restart_key = "F2"; - + # Save the current desktop and login as defaults, and load them on startup save = true; - + # Service name (set to ly to use the provided pam config file) service_name = "ly"; - + # Session log file path # This will contain stdout and stderr of Wayland sessions # By default it's saved in the user's home directory @@ -244,61 +242,61 @@ # logs from those sessions. # If null, no session log will be created session_log = null; - + # Setup command setup_cmd = "$CONFIG_DIRECTORY/ly/setup.sh"; - + # Command executed when pressing shutdown_key shutdown_cmd = "/sbin/shutdown $PLATFORM_SHUTDOWN_ARG now"; - + # Specifies the key combination used for shutdown shutdown_key = "F1"; - + # Command executed when pressing sleep key (can be null) sleep_cmd = null; - + # Specifies the key combination used for sleep sleep_key = "F3"; - + # Command executed when starting Ly (before the TTY is taken control of) # See file at path below for an example of changing the default TTY colors start_cmd = "$CONFIG_DIRECTORY/ly/startup.sh"; - + # Center the session name. text_in_center = false; - + # Default vi mode # normal -> normal mode # insert -> insert mode vi_default_mode = "normal"; - + # Enable vi keybindings vi_mode = false; - + # Wayland desktop environments # You can specify multiple directories, # e.g. $PREFIX_DIRECTORY/share/wayland-sessions:$PREFIX_DIRECTORY/local/share/wayland-sessions waylandsessions = "$PREFIX_DIRECTORY/share/wayland-sessions"; - + # Xorg server command x_cmd = "$PREFIX_DIRECTORY/bin/X"; - + # Xorg virtual terminal number # Mostly useful for FreeBSD where choosing the current TTY causes issues # If null, the current TTY will be chosen x_vt = null; - + # Xorg xauthority edition tool xauth_cmd = "$PREFIX_DIRECTORY/bin/xauth"; - + # xinitrc # If null, the xinitrc session will be hidden xinitrc = "~/.xinitrc"; - + # Xorg desktop environments # You can specify multiple directories, # e.g. $PREFIX_DIRECTORY/share/xsessions:$PREFIX_DIRECTORY/local/share/xsessions xsessions = "$PREFIX_DIRECTORY/share/xsessions"; - }; - }; + }; + }; } diff --git a/modules/nixos/lyminimal.nix b/modules/nixos/lyminimal.nix index f3f78ed..06f15a6 100644 --- a/modules/nixos/lyminimal.nix +++ b/modules/nixos/lyminimal.nix @@ -1,27 +1,26 @@ -{... }: -{ +{...}: { # a minimal ly config as the big config (ly.nix) didnt worked services.displayManager.ly = { enable = true; settings = { # Core animation animation = "colormix"; # none or doom or matrix or gameoflife or a dur file -# Ly supports 24-bit true color with styling, which means each color is a 32-bit value. -# The format is 0xSSRRGGBB, where SS is the styling, RR is red, GG is green, and BB is blue. -# Here are the possible styling options: -# TB_BOLD 0x01000000 -# TB_UNDERLINE 0x02000000 -# TB_REVERSE 0x04000000 -# TB_ITALIC 0x08000000 -# TB_BLINK 0x10000000 -# TB_HI_BLACK 0x20000000 -# TB_BRIGHT 0x40000000 -# TB_DIM 0x80000000 -# Programmatically, you'd apply them using the bitwise OR operator (|), but because Ly's -# configuration doesn't support using it, you have to manually compute the color value. -# Note that, if you want to use the default color value of the terminal, you can use the -# special value 0x00000000. This means that, if you want to use black, you *must* use -# the styling option TB_HI_BLACK (the RGB values are ignored when using this option). + # Ly supports 24-bit true color with styling, which means each color is a 32-bit value. + # The format is 0xSSRRGGBB, where SS is the styling, RR is red, GG is green, and BB is blue. + # Here are the possible styling options: + # TB_BOLD 0x01000000 + # TB_UNDERLINE 0x02000000 + # TB_REVERSE 0x04000000 + # TB_ITALIC 0x08000000 + # TB_BLINK 0x10000000 + # TB_HI_BLACK 0x20000000 + # TB_BRIGHT 0x40000000 + # TB_DIM 0x80000000 + # Programmatically, you'd apply them using the bitwise OR operator (|), but because Ly's + # configuration doesn't support using it, you have to manually compute the color value. + # Note that, if you want to use the default color value of the terminal, you can use the + # special value 0x00000000. This means that, if you want to use black, you *must* use + # the styling option TB_HI_BLACK (the RGB values are ignored when using this option). # Basic TUI settings clear_password = true; default_input = "password"; @@ -40,7 +39,7 @@ bigclock = "en"; clock = "%H:%M"; - colormix_col1 = "0x08E85D04"; + colormix_col1 = "0x08E85D04"; colormix_col2 = "0x08FABD2F"; colormix_col3 = "0x08FE8019"; @@ -72,10 +71,10 @@ restart_key = "F2"; sleep_key = "F3"; hibernate_key = "F4"; - + # top bar session_log = null; - initial_info_text = null; # + initial_info_text = null; # # Custom sessions #custom_sessions = "$CONFIG_DIRECTORY/ly/custom-sessions"; #waylandsessions = "$PREFIX_DIRECTORY/share/wayland-sessions"; diff --git a/modules/nixos/udev.nix b/modules/nixos/udev.nix index b0d72dc..d7e48b4 100644 --- a/modules/nixos/udev.nix +++ b/modules/nixos/udev.nix @@ -1,136 +1,138 @@ -{ config, pkgs, ... }: - { - # udev are setup for controlling the framework 16 laptop's keyboard - services.udev.extraRules = '' -## https://github.com/qmk/qmk_firmware/blob/master/util/udev/50-qmk.extraRules -## Atmel DFU -#### ATmega16U2 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2fef", TAG+="uaccess" -#### ATmega32U2 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", TAG+="uaccess" -#### ATmega16U4 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff3", TAG+="uaccess" -#### ATmega32U4 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", TAG+="uaccess" -#### AT90USB64 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff9", TAG+="uaccess" -#### AT90USB162 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffa", TAG+="uaccess" -#### AT90USB128 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", TAG+="uaccess" -# -## Input Club -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", ATTRS{idProduct}=="b007", TAG+="uaccess" -# -## STM32duino -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", TAG+="uaccess" -## STM32 DFU -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess" -# -## BootloadHID -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", TAG+="uaccess" -# -## USBAspLoader -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", TAG+="uaccess" -# -## USBtinyISP -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1782", ATTRS{idProduct}=="0c9f", TAG+="uaccess" -# -## ModemManager should ignore the following devices -## Atmel SAM-BA (Massdrop) -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -# -## Caterina (Pro Micro) -### pid.codes shared PID -#### Keyboardio Atreus 2 Bootloader -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2302", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -### Spark Fun Electronics -#### Pro Micro 3V3/8MHz -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9203", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -#### Pro Micro 5V/16MHz -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9205", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -#### LilyPad 3V3/8MHz (and some Pro Micro clones) -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9207", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -### Pololu Electronics -#### A-Star 32U4 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1ffb", ATTRS{idProduct}=="0101", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -### Arduino SA -#### Leonardo -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -#### Micro -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -### Adafruit Industries LLC -#### Feather 32U4 -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000c", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -#### ItsyBitsy 32U4 3V3/8MHz -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000d", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -#### ItsyBitsy 32U4 5V/16MHz -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000e", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -### dog hunter AG -#### Leonardo -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -#### Micro -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" -# -## hid_listen -#KERNEL=="hidraw*", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl" -# -## hid bootloaders -### QMK HID -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2067", TAG+="uaccess" -### PJRC's HalfKay -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0478", TAG+="uaccess" -# -## APM32 DFU -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="314b", ATTRS{idProduct}=="0106", TAG+="uaccess" -# -## GD32V DFU -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", TAG+="uaccess" -# -## WB32 DFU -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="342d", ATTRS{idProduct}=="dfa0", TAG+="uaccess" -# -## AT32 DFU -# SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", TAG+="uaccess" + config, + pkgs, + ... +}: { + # udev are setup for controlling the framework 16 laptop's keyboard + services.udev.extraRules = '' + ## https://github.com/qmk/qmk_firmware/blob/master/util/udev/50-qmk.extraRules + ## Atmel DFU + #### ATmega16U2 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2fef", TAG+="uaccess" + #### ATmega32U2 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", TAG+="uaccess" + #### ATmega16U4 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff3", TAG+="uaccess" + #### ATmega32U4 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", TAG+="uaccess" + #### AT90USB64 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff9", TAG+="uaccess" + #### AT90USB162 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffa", TAG+="uaccess" + #### AT90USB128 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", TAG+="uaccess" + # + ## Input Club + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", ATTRS{idProduct}=="b007", TAG+="uaccess" + # + ## STM32duino + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", TAG+="uaccess" + ## STM32 DFU + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess" + # + ## BootloadHID + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", TAG+="uaccess" + # + ## USBAspLoader + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", TAG+="uaccess" + # + ## USBtinyISP + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="1782", ATTRS{idProduct}=="0c9f", TAG+="uaccess" + # + ## ModemManager should ignore the following devices + ## Atmel SAM-BA (Massdrop) + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + # + ## Caterina (Pro Micro) + ### pid.codes shared PID + #### Keyboardio Atreus 2 Bootloader + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2302", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + ### Spark Fun Electronics + #### Pro Micro 3V3/8MHz + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9203", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + #### Pro Micro 5V/16MHz + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9205", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + #### LilyPad 3V3/8MHz (and some Pro Micro clones) + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9207", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + ### Pololu Electronics + #### A-Star 32U4 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="1ffb", ATTRS{idProduct}=="0101", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + ### Arduino SA + #### Leonardo + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + #### Micro + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + ### Adafruit Industries LLC + #### Feather 32U4 + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000c", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + #### ItsyBitsy 32U4 3V3/8MHz + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000d", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + #### ItsyBitsy 32U4 5V/16MHz + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000e", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + ### dog hunter AG + #### Leonardo + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + #### Micro + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + # + ## hid_listen + #KERNEL=="hidraw*", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl" + # + ## hid bootloaders + ### QMK HID + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2067", TAG+="uaccess" + ### PJRC's HalfKay + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0478", TAG+="uaccess" + # + ## APM32 DFU + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="314b", ATTRS{idProduct}=="0106", TAG+="uaccess" + # + ## GD32V DFU + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", TAG+="uaccess" + # + ## WB32 DFU + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="342d", ATTRS{idProduct}=="dfa0", TAG+="uaccess" + # + ## AT32 DFU + # SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", TAG+="uaccess" -# and # https://community.frame.work/t/guide-updated-after-firmware-updates-udev-rules-for-https-keyboard-frame-work/78708 - -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0010", TAG+="uaccess" -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", TAG+="uaccess" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0013", TAG+="uaccess" -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0014", TAG+="uaccess" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0018", TAG+="uaccess" -#SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0019", TAG+="uaccess" + # and # https://community.frame.work/t/guide-updated-after-firmware-updates-udev-rules-for-https-keyboard-frame-work/78708 + + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0010", TAG+="uaccess" + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", TAG+="uaccess" + SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0013", TAG+="uaccess" + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0014", TAG+="uaccess" + SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0018", TAG+="uaccess" + #SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0019", TAG+="uaccess" -# USB [VendorID]:[ProductID] “[Manufacturer][Product name]” -# 32ac:0012 “Framework Laptop 16 Keyboard Module - ANSI” -# 32ac:0013 “Framework Laptop 16 RGB Macropad” -# 32ac:0014 “Framework Laptop 16 Numpad Module” -# 32ac:0018 “Framework Laptop 16 Keyboard Module - ISO” -# 32ac:0019 “Framework Laptop 16 Keyboard Module - JIS” + # USB [VendorID]:[ProductID] “[Manufacturer][Product name]” + # 32ac:0012 “Framework Laptop 16 Keyboard Module - ANSI” + # 32ac:0013 “Framework Laptop 16 RGB Macropad” + # 32ac:0014 “Framework Laptop 16 Numpad Module” + # 32ac:0018 “Framework Laptop 16 Keyboard Module - ISO” + # 32ac:0019 “Framework Laptop 16 Keyboard Module - JIS” -##https://github.com/ublue-os/config/blob/main/files/etc/udev/rules.d/50-framework16.rules -## Audio Expansion Card -#ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0010", ATTR{power/autosuspend}="10", ATTR{power/control}="auto", GOTO="rules_end" -# -## Framework Laptop 16 Keyboard Module - ANSI -#ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0012", ATTR{power/autosuspend}="-1", ATTR{power/control}="on", ATTR{power/wakeup}="disabled", GOTO="rules_end" -# -## Framework Laptop 16 RGB Macropad -# -## Framework Laptop 16 Numpad Module -#ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0014", ATTR{power/autosuspend}="-1", ATTR{power/control}="on", ATTR{power/wakeup}="disabled", GOTO="rules_end" -# -## Framework Laptop 16 Keyboard Module -#ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0018", ATTR{power/autosuspend}="-1", ATTR{power/control}="on", ATTR{power/wakeup}="disabled", GOTO="rules_end" -# -#LABEL="rules_end" + ##https://github.com/ublue-os/config/blob/main/files/etc/udev/rules.d/50-framework16.rules + ## Audio Expansion Card + #ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0010", ATTR{power/autosuspend}="10", ATTR{power/control}="auto", GOTO="rules_end" + # + ## Framework Laptop 16 Keyboard Module - ANSI + #ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0012", ATTR{power/autosuspend}="-1", ATTR{power/control}="on", ATTR{power/wakeup}="disabled", GOTO="rules_end" + # + ## Framework Laptop 16 RGB Macropad + # + ## Framework Laptop 16 Numpad Module + #ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0014", ATTR{power/autosuspend}="-1", ATTR{power/control}="on", ATTR{power/wakeup}="disabled", GOTO="rules_end" + # + ## Framework Laptop 16 Keyboard Module + #ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0018", ATTR{power/autosuspend}="-1", ATTR{power/control}="on", ATTR{power/wakeup}="disabled", GOTO="rules_end" + # + #LABEL="rules_end" -''; + ''; } diff --git a/modules/nixos/udevsimple.nix b/modules/nixos/udevsimple.nix index 0e6930c..cfae078 100644 --- a/modules/nixos/udevsimple.nix +++ b/modules/nixos/udevsimple.nix @@ -1,14 +1,16 @@ -{ config, pkgs, ... }: - { - # udev with only the necessary rules. See udev.nix to get all the rules - services.udev.extraRules = '' -# adapted from here https://wiki.nixos.org/wiki/Keychron_M6 -KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="32ac", MODE="0660", GROUP="users", TAG+="uaccess" + config, + pkgs, + ... +}: { + # udev with only the necessary rules. See udev.nix to get all the rules + services.udev.extraRules = '' + # adapted from here https://wiki.nixos.org/wiki/Keychron_M6 + KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="32ac", MODE="0660", GROUP="users", TAG+="uaccess" -# taken from here -SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0013", TAG+="uaccess" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0018", TAG+="uaccess" -''; + # taken from here + SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0013", TAG+="uaccess" + SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0018", TAG+="uaccess" + ''; } diff --git a/modules/scripts/OldDeprecatedbatterynotify.nix b/modules/scripts/OldDeprecatedbatterynotify.nix index 3504fe0..ea67c56 100644 --- a/modules/scripts/OldDeprecatedbatterynotify.nix +++ b/modules/scripts/OldDeprecatedbatterynotify.nix @@ -1,14 +1,14 @@ -{ writeShellApplication -, libnotify -, systemd +{ + writeShellApplication, + libnotify, + systemd, }: - writeShellApplication { name = "custom-olddeprecatedbatterynotify"; runtimeInputs = [ - libnotify # provides notify-send - systemd # provides systemctl + libnotify # provides notify-send + systemd # provides systemctl ]; text = '' diff --git a/modules/scripts/batterynotify.nix b/modules/scripts/batterynotify.nix index cc2268f..3170ccb 100644 --- a/modules/scripts/batterynotify.nix +++ b/modules/scripts/batterynotify.nix @@ -1,69 +1,73 @@ # taken and adapted https://github.com/miniMinn24/Battery_Notify with MIT License -{ writeShellApplication, mplayer, brightnessctl, ... }: -let +{ + writeShellApplication, + mplayer, + brightnessctl, + ... +}: let NotifySound = ../../assets/battery_notify.mp3; -in -writeShellApplication { - name = "custom-batterynotify"; +in + writeShellApplication { + name = "custom-batterynotify"; runtimeInputs = [ mplayer brightnessctl - ]; - text = '' + ]; + text = '' -# Delay for startup -sleep 5 + # Delay for startup + sleep 5 -# Change your sound path here + # Change your sound path here -playsound() { - mplayer ${NotifySound} -} + playsound() { + mplayer ${NotifySound} + } -adjustBrightness() { - local adjustment="$1" - brightnessctl set "$adjustment" -} + adjustBrightness() { + local adjustment="$1" + brightnessctl set "$adjustment" + } -sendNotification() { - local title="$1" - local message="$2" - notify-send -h string:x-canonical-private-synchronous:sys-notify -e -u low "$title" "$message" -} + sendNotification() { + local title="$1" + local message="$2" + notify-send -h string:x-canonical-private-synchronous:sys-notify -e -u low "$title" "$message" + } -# Runs full time in background -x=0 -while true; do - Battery_Status="$(cat /sys/class/power_supply/BAT*/status)" - Battery_Capacity=$(cat /sys/class/power_supply/BAT*/capacity) + # Runs full time in background + x=0 + while true; do + Battery_Status="$(cat /sys/class/power_supply/BAT*/status)" + Battery_Capacity=$(cat /sys/class/power_supply/BAT*/capacity) - case "$Battery_Status" in - "Discharging") - if [ $x -eq 1 ]; then - sendNotification "Discharging" "Remains: ''${Battery_Capacity}%" - adjustBrightness "15%-" - playsound - x=0 - fi - ;; - "Charging") - if [ $x -eq 0 ]; then - sendNotification "Charging" "Current: ''${Battery_Capacity}%" - adjustBrightness "15%+" - playsound - x=1 - fi - ;; - "Full") - if [ $x -eq 0 ]; then - sendNotification "Fully Charged" "Noice: ''${Battery_Capacity}%" - playsound - x=1 - fi - ;; - esac + case "$Battery_Status" in + "Discharging") + if [ $x -eq 1 ]; then + sendNotification "Discharging" "Remains: ''${Battery_Capacity}%" + adjustBrightness "15%-" + playsound + x=0 + fi + ;; + "Charging") + if [ $x -eq 0 ]; then + sendNotification "Charging" "Current: ''${Battery_Capacity}%" + adjustBrightness "15%+" + playsound + x=1 + fi + ;; + "Full") + if [ $x -eq 0 ]; then + sendNotification "Fully Charged" "Noice: ''${Battery_Capacity}%" + playsound + x=1 + fi + ;; + esac - sleep 1 -done + sleep 1 + done ''; -} + } diff --git a/modules/scripts/batterywarning.nix b/modules/scripts/batterywarning.nix index 14d64d1..2e2a8f6 100644 --- a/modules/scripts/batterywarning.nix +++ b/modules/scripts/batterywarning.nix @@ -1,53 +1,57 @@ # taken and adapted https://github.com/miniMinn24/Battery_Notify with MIT License -{ writeShellApplication, mplayer, brightnessctl, ... }: -let +{ + writeShellApplication, + mplayer, + brightnessctl, + ... +}: let NotifySound = ../../assets/battery_notify.mp3; -in -writeShellApplication { - name = "custom-batterywarning"; +in + writeShellApplication { + name = "custom-batterywarning"; runtimeInputs = [ mplayer brightnessctl - ]; - text = '' + ]; + text = '' -# Delay for startup -sleep 5 + # Delay for startup + sleep 5 -# Change your sound path here + # Change your sound path here -playsound() { - mplayer ${NotifySound} -} + playsound() { + mplayer ${NotifySound} + } -sendNotification() { - local message="$1" - notify-send -h string:x-canonical-private-synchronous:sys-notify -e -u critical "Battery Low!" "$message" -} + sendNotification() { + local message="$1" + notify-send -h string:x-canonical-private-synchronous:sys-notify -e -u critical "Battery Low!" "$message" + } -notify_count=0 + notify_count=0 -while true; do - Battery_Status="$(cat /sys/class/power_supply/BAT*/status)" - Battery_Capacity=$(cat /sys/class/power_supply/BAT*/capacity) + while true; do + Battery_Status="$(cat /sys/class/power_supply/BAT*/status)" + Battery_Capacity=$(cat /sys/class/power_supply/BAT*/capacity) - if [ "$Battery_Status" == "Discharging" ] && [ "$Battery_Capacity" -le 14 ]; then - if [ "$notify_count" -eq 0 ]; then - sendNotification "Power running out: ''${Battery_Capacity}%" - playsound - notify_count=$((notify_count + 1)) - sleep 180 + if [ "$Battery_Status" == "Discharging" ] && [ "$Battery_Capacity" -le 14 ]; then + if [ "$notify_count" -eq 0 ]; then + sendNotification "Power running out: ''${Battery_Capacity}%" + playsound + notify_count=$((notify_count + 1)) + sleep 180 - elif [ "$notify_count" -eq 1 ]; then - sendNotification "Save your works before immediate shutdown." - playsound - notify_count=$((notify_count - 1)) - sleep 180 - fi - else - notify_count=0 - sleep 120 - fi -done + elif [ "$notify_count" -eq 1 ]; then + sendNotification "Save your works before immediate shutdown." + playsound + notify_count=$((notify_count - 1)) + sleep 180 + fi + else + notify_count=0 + sleep 120 + fi + done ''; -} + } diff --git a/modules/scripts/btm.nix b/modules/scripts/btm.nix index d899c0b..e459738 100644 --- a/modules/scripts/btm.nix +++ b/modules/scripts/btm.nix @@ -1,12 +1,16 @@ -{ writeShellApplication, kitty, bottom,... }: - +{ + writeShellApplication, + kitty, + bottom, + ... +}: writeShellApplication { - name = "custom-bottom"; - runtimeInputs = [ - kitty - bottom - ]; - text = '' - kitty --class "custom-bottom" -o font_size=10 --name "custom-bottom" -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T -''; + name = "custom-bottom"; + runtimeInputs = [ + kitty + bottom + ]; + text = '' + kitty --class "custom-bottom" -o font_size=10 --name "custom-bottom" -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T + ''; } diff --git a/modules/scripts/colorpicker.nix b/modules/scripts/colorpicker.nix index 6137039..4718109 100644 --- a/modules/scripts/colorpicker.nix +++ b/modules/scripts/colorpicker.nix @@ -1,79 +1,82 @@ - # useless # used to come from my old dotfiles which were copied from fedora-hyprdots # just use hyprpicker | tee >(wl-copy) | cliphist store # because hyprpicker and cliphist are inside my configuration.nix # no need to verify their existence - - -{ writeShellApplication, hyprpicker, libnotify, toybox, wl-clipboard, ... }: - +{ + writeShellApplication, + hyprpicker, + libnotify, + toybox, + wl-clipboard, + ... +}: writeShellApplication { - name = "custom-colorpicker-useless"; - runtimeInputs = [ - hyprpicker - libnotify - toybox - wl-clipboard - ]; - text = '' -check() { - command -v "$1" 1>/dev/null -} + name = "custom-colorpicker-useless"; + runtimeInputs = [ + hyprpicker + libnotify + toybox + wl-clipboard + ]; + text = '' + check() { + command -v "$1" 1>/dev/null + } -notify() { - check notify-send && { - notify-send -a "Color Picker" "$@" - return - } - echo "$@" -} + notify() { + check notify-send && { + notify-send -a "Color Picker" "$@" + return + } + echo "$@" + } -loc="$HOME/.cache/colorpicker" -[ -d "$loc" ] || mkdir -p "$loc" -[ -f "$loc/colors" ] || touch "$loc/colors" + loc="$HOME/.cache/colorpicker" + [ -d "$loc" ] || mkdir -p "$loc" + [ -f "$loc/colors" ] || touch "$loc/colors" -limit=10 + limit=10 -[[ $# -eq 1 && $1 = "-l" ]] && { - cat "$loc/colors" - exit -} + [[ $# -eq 1 && $1 = "-l" ]] && { + cat "$loc/colors" + exit + } -[[ $# -eq 1 && $1 = "-j" ]] && { - text="$(head -n 1 "$loc/colors")" + [[ $# -eq 1 && $1 = "-j" ]] && { + text="$(head -n 1 "$loc/colors")" - mapfile -t allcolors < <(tail -n +2 "$loc/colors") - # allcolors=($(tail -n +2 "$loc/colors")) - tooltip=" COLORS\n\n" + mapfile -t allcolors < <(tail -n +2 "$loc/colors") + # allcolors=($(tail -n +2 "$loc/colors")) + tooltip=" COLORS\n\n" - tooltip+="-> $text 󰸌 \n" - for i in "''${allcolors[@]}"; do - tooltip+=" $i 󰸌 \n" - done + tooltip+="-> $text 󰸌 \n" + for i in "''${allcolors[@]}"; do + tooltip+=" $i 󰸌 \n" + done - cat <󰸌", "tooltip":"$tooltip"} -EOF + cat <󰸌", "tooltip":"$tooltip"} + EOF - exit -} + exit + } -check hyprpicker || { - notify "hyprpicker is not installed" - exit -} -killall -q hyprpicker -color=$(hyprpicker) + check hyprpicker || { + notify "hyprpicker is not installed" + exit + } + killall -q hyprpicker + color=$(hyprpicker) -check wl-copy && { - echo "$color" | sed -z 's/\n//g' | wl-copy -} + check wl-copy && { + echo "$color" | sed -z 's/\n//g' | wl-copy + } -prevColors=$(head -n $((limit - 1)) "$loc/colors") -echo "$color" >"$loc/colors" -echo "$prevColors" >>"$loc/colors" -sed -i '/^$/d' "$loc/colors" -pkill -RTMIN+1 waybar -''; + prevColors=$(head -n $((limit - 1)) "$loc/colors") + echo "$color" >"$loc/colors" + echo "$prevColors" >>"$loc/colors" + sed -i '/^$/d' "$loc/colors" + pkill -RTMIN+1 waybar + ''; } diff --git a/modules/scripts/cowsay.nix b/modules/scripts/cowsay.nix index 08b0021..9bbb7ad 100644 --- a/modules/scripts/cowsay.nix +++ b/modules/scripts/cowsay.nix @@ -1,80 +1,83 @@ -{ writeShellApplication, cowsay, ... }: - +{ + writeShellApplication, + cowsay, + ... +}: writeShellApplication { - name = "custom-cowsay"; - runtimeInputs = [ cowsay ]; - text = '' + name = "custom-cowsay"; + runtimeInputs = [cowsay]; + text = '' -cows=("actually" "alpaca" "bud-frogs" "daemon" "elephant-in-snake" "moofasa" "skeleton" "three-eyes" "supermilker" "tux" "vader" "www") -declare -a sentences=( -"Sharing knowledge is the most fundamental act of friendship. Because it is a way you can give something without loosing something. -Richard Stallman" -"Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer'. -Richard Stallman" -"Programming is not a science. Programming is a craft. -Richard Stallman" -"I did write some code in Java once, but that was the island in Indonesia. -Richard Stallman" -"Facebook is not your friend, it is a surveillance engine. -Richard Stallman" -"People said I should accept the world. Bullshit! I don't accept the world. -Richard Stallman" -"You can use any editor you want, but remember that vi vi vi is the text editor of the beast. -Richard Stallman" -"The idea of copyright did not exist in ancient times, when authors frequently copied other authors at length in works of non-fiction. This practice was useful, and is the only way many authors' works have survived even in part. -Richard Stallman" -"Idiots can be defeated but they never admit it. -Richard Stallman" -"Open source is a development methodology; free software is a social movement. -Richard Stallman" -"People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. -Richard Stallman" -"A computer is like air conditioning - it becomes useless when you open Windows -Linus Torvald" -"Intelligence is the ability to avoid doing work, yet getting the work done. -Linus Torvald" -"Software is like sex: It's better when it's free. -Linus Torvald" -"All operating systems sucks, but Linux just sucks less -Linus Torvald" -"I like offending people, because I think people who get offended should be offended. -Linus Torval" -"Talk is cheap. Show me the code. -Linus Torval" -"Most of the good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program. -Linus Torvald" -"Bad programmers worry about the code. Good programmers worry about data structures and their relationships. -Linus Torvald" -"If Microsoft ever does applications for Linux it means I've won. -Linus Torvald" -"Avoiding complexity reduces bugs. -Linus Torvald" -"Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it. -Linus Torvald" -"Nobody actually creates perfect code the first time around, except me. But there's only one of me. -Linus Torvald" -"Microsoft isn't evil, they just make really crappy operating systems. -Linus Torvald" -"When you say 'I wrote a program that crashed Windows,' people just stare at you blankly and say 'Hey, I got those with the system, for free.' -Linus Torval" -"C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. -Linus Torvald" -"If you think your users are idiots, only idiots will use it. -Linus Torvald" -"My name is Linus, and I am your God. -Linus Torvald" -"An infinite number of monkeys typing into GNU emacs would never make a good program. -Linus Torvald" -"Object-oriented programming is an exceptionally bad idea which could only have originated in California. -Edgser Dijkstra" -"If debugging is the process of removing software bugs, then programming must be the process of putting them in. -Edgser Dijkstra" -"The art of programming is the art of organizing complexity. -Edgser Dijkstra" -"Program testing can be used to show the presence of bugs, but never to show their absence! -Edgser Dijkstra" -"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. -Edgser Dijkstra" -"The effort of using machines to mimic the human mind has always struck me as rather silly. I would rather use them to mimic something better. -Edgser Dijkstra" -"Computer science is no more about computers than astronomy is about telescopes. -Edgser Dijkstra" -"Programming in Basic causes brain damage. -Edgser Dijkstra" -"The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. -Edgser Dijkstra" -"If in physics there's something you don't understand, you can always hide behind the uncharted depths of nature. You can always blame God. You didn't make it so complex yourself. But if your program doesn't work, there is no one to hide behind. You cannot hide behind an obstinate nature. If it doesn't work, you've messed up. -Edgser Dijkstra" -"Teaching COBOL ought to be regarded as a criminal act. -Edgser Dijkstra" -"If you want more effective programmers, you will discover that they should not waste their time debugging, they should not introduce the bugs to start with. -Edgser Dijkstra" -"If we wish to count lines of code, we should not regard them as 'lines produced' but as 'lines spent.' -Edgser Dijkstra" -"In almost every computation a great variety of arrangements for the succession of the processes is possible, and various considerations must influence the selections amongst them for the purposes of a calculating engine. One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation. -Ada Lovelace" -"I’m making an operating system myself, so I know what it’s like to be God. -Terry Davis" -"I’m schizophrenic and so am I. -Terry Davis" -"If I was a dog, I would bark. -Terry Davis" -"Who has a better kernel? Debian? No. -Terry Davis" -"Computers are fast, programmers keep it slow. -A random Reddit user" -"Before software can be reusable it first has to be usable. -Ralph Johnson" -"The best thing about a Boolean is that even if you are wrong, you're only off by a bit. -Anonymous" -"It's not a bug, it's a feature. -Programmers" -"NVIDIA, fuck you -Linus Torvald" -) -while true -do - echo - echo - echo - echo - echo - echo - SIndex=$(( RANDOM % ''${#sentences[@]} )) - index=$(( RANDOM % ''${#cows[@]} )) - #cow="/usr/share/cowsay/cows/''${cows[index]}.cow" - cowsay -f "''${cows[index]}" "''${sentences[SIndex]}" - sleep 10 - clear -done - ''; -# reduce terminal size for actually + cows=("actually" "alpaca" "bud-frogs" "daemon" "elephant-in-snake" "moofasa" "skeleton" "three-eyes" "supermilker" "tux" "vader" "www") + declare -a sentences=( + "Sharing knowledge is the most fundamental act of friendship. Because it is a way you can give something without loosing something. -Richard Stallman" + "Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer'. -Richard Stallman" + "Programming is not a science. Programming is a craft. -Richard Stallman" + "I did write some code in Java once, but that was the island in Indonesia. -Richard Stallman" + "Facebook is not your friend, it is a surveillance engine. -Richard Stallman" + "People said I should accept the world. Bullshit! I don't accept the world. -Richard Stallman" + "You can use any editor you want, but remember that vi vi vi is the text editor of the beast. -Richard Stallman" + "The idea of copyright did not exist in ancient times, when authors frequently copied other authors at length in works of non-fiction. This practice was useful, and is the only way many authors' works have survived even in part. -Richard Stallman" + "Idiots can be defeated but they never admit it. -Richard Stallman" + "Open source is a development methodology; free software is a social movement. -Richard Stallman" + "People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. -Richard Stallman" + "A computer is like air conditioning - it becomes useless when you open Windows -Linus Torvald" + "Intelligence is the ability to avoid doing work, yet getting the work done. -Linus Torvald" + "Software is like sex: It's better when it's free. -Linus Torvald" + "All operating systems sucks, but Linux just sucks less -Linus Torvald" + "I like offending people, because I think people who get offended should be offended. -Linus Torval" + "Talk is cheap. Show me the code. -Linus Torval" + "Most of the good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program. -Linus Torvald" + "Bad programmers worry about the code. Good programmers worry about data structures and their relationships. -Linus Torvald" + "If Microsoft ever does applications for Linux it means I've won. -Linus Torvald" + "Avoiding complexity reduces bugs. -Linus Torvald" + "Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it. -Linus Torvald" + "Nobody actually creates perfect code the first time around, except me. But there's only one of me. -Linus Torvald" + "Microsoft isn't evil, they just make really crappy operating systems. -Linus Torvald" + "When you say 'I wrote a program that crashed Windows,' people just stare at you blankly and say 'Hey, I got those with the system, for free.' -Linus Torval" + "C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. -Linus Torvald" + "If you think your users are idiots, only idiots will use it. -Linus Torvald" + "My name is Linus, and I am your God. -Linus Torvald" + "An infinite number of monkeys typing into GNU emacs would never make a good program. -Linus Torvald" + "Object-oriented programming is an exceptionally bad idea which could only have originated in California. -Edgser Dijkstra" + "If debugging is the process of removing software bugs, then programming must be the process of putting them in. -Edgser Dijkstra" + "The art of programming is the art of organizing complexity. -Edgser Dijkstra" + "Program testing can be used to show the presence of bugs, but never to show their absence! -Edgser Dijkstra" + "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. -Edgser Dijkstra" + "The effort of using machines to mimic the human mind has always struck me as rather silly. I would rather use them to mimic something better. -Edgser Dijkstra" + "Computer science is no more about computers than astronomy is about telescopes. -Edgser Dijkstra" + "Programming in Basic causes brain damage. -Edgser Dijkstra" + "The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. -Edgser Dijkstra" + "If in physics there's something you don't understand, you can always hide behind the uncharted depths of nature. You can always blame God. You didn't make it so complex yourself. But if your program doesn't work, there is no one to hide behind. You cannot hide behind an obstinate nature. If it doesn't work, you've messed up. -Edgser Dijkstra" + "Teaching COBOL ought to be regarded as a criminal act. -Edgser Dijkstra" + "If you want more effective programmers, you will discover that they should not waste their time debugging, they should not introduce the bugs to start with. -Edgser Dijkstra" + "If we wish to count lines of code, we should not regard them as 'lines produced' but as 'lines spent.' -Edgser Dijkstra" + "In almost every computation a great variety of arrangements for the succession of the processes is possible, and various considerations must influence the selections amongst them for the purposes of a calculating engine. One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation. -Ada Lovelace" + "I’m making an operating system myself, so I know what it’s like to be God. -Terry Davis" + "I’m schizophrenic and so am I. -Terry Davis" + "If I was a dog, I would bark. -Terry Davis" + "Who has a better kernel? Debian? No. -Terry Davis" + "Computers are fast, programmers keep it slow. -A random Reddit user" + "Before software can be reusable it first has to be usable. -Ralph Johnson" + "The best thing about a Boolean is that even if you are wrong, you're only off by a bit. -Anonymous" + "It's not a bug, it's a feature. -Programmers" + "NVIDIA, fuck you -Linus Torvald" + ) + while true + do + echo + echo + echo + echo + echo + echo + SIndex=$(( RANDOM % ''${#sentences[@]} )) + index=$(( RANDOM % ''${#cows[@]} )) + #cow="/usr/share/cowsay/cows/''${cows[index]}.cow" + cowsay -f "''${cows[index]}" "''${sentences[SIndex]}" + sleep 10 + clear + done + ''; + # reduce terminal size for actually } diff --git a/modules/scripts/dontkillsteam.nix b/modules/scripts/dontkillsteam.nix index 73d6e5c..b30a3ed 100644 --- a/modules/scripts/dontkillsteam.nix +++ b/modules/scripts/dontkillsteam.nix @@ -1,18 +1,22 @@ -{ writeShellApplication, hyprland, jq, ...}: - +{ + writeShellApplication, + hyprland, + jq, + ... +}: writeShellApplication { -name = "custom-dontkillsteam"; - runtimeInputs = [ - hyprland - jq - ]; - text = '' - class=$(hyprctl activewindow -j | jq -r ".class") - if [[ "$class" == "Steam" || "$class" == "custom-pomodoro" ]]; then - hyprctl dispatch movetoworkspacesilent special - else - hyprctl dispatch killactive "" - fi + name = "custom-dontkillsteam"; + runtimeInputs = [ + hyprland + jq + ]; + text = '' + class=$(hyprctl activewindow -j | jq -r ".class") + if [[ "$class" == "Steam" || "$class" == "custom-pomodoro" ]]; then + hyprctl dispatch movetoworkspacesilent special + else + hyprctl dispatch killactive "" + fi - ''; + ''; } diff --git a/modules/scripts/gitnotify.nix b/modules/scripts/gitnotify.nix index f7800e2..e54ef5b 100644 --- a/modules/scripts/gitnotify.nix +++ b/modules/scripts/gitnotify.nix @@ -1,24 +1,28 @@ -{ writeShellApplication, git, libnotify, ... }: - +{ + writeShellApplication, + git, + libnotify, + ... +}: writeShellApplication { - name = "custom-gitnotify"; - runtimeInputs = [ - git - libnotify - ]; - text = '' -# Check if git is installed -if ! command -v git >/dev/null 2>&1; then - exit 0 -fi + name = "custom-gitnotify"; + runtimeInputs = [ + git + libnotify + ]; + text = '' + # Check if git is installed + if ! command -v git >/dev/null 2>&1; then + exit 0 + fi -NAME=$(git config --global user.name) -EMAIL=$(git config --global user.email) + NAME=$(git config --global user.name) + EMAIL=$(git config --global user.email) -if [[ -z "$NAME" || -z "$EMAIL" ]]; then - notify-send \ - "Git not configured" \ - "Set your identity\n or remove this warning by removing the custom-gitnotify line in\n ~/nixos/modules/home-manager/hyprland.nix" -fi - ''; + if [[ -z "$NAME" || -z "$EMAIL" ]]; then + notify-send \ + "Git not configured" \ + "Set your identity\n or remove this warning by removing the custom-gitnotify line in\n ~/nixos/modules/home-manager/hyprland.nix" + fi + ''; } diff --git a/modules/scripts/killall.nix b/modules/scripts/killall.nix index ad8a4fa..860ae7d 100644 --- a/modules/scripts/killall.nix +++ b/modules/scripts/killall.nix @@ -1,19 +1,23 @@ -{ writeShellApplication, hyprland, jq, ... }: - +{ + writeShellApplication, + hyprland, + jq, + ... +}: writeShellApplication { - name = "custom-killall"; - runtimeInputs = [ - hyprland - jq - ]; - text = '' - active_workspace_id=$(hyprctl activeworkspace -j | jq -r '.id') + name = "custom-killall"; + runtimeInputs = [ + hyprland + jq + ]; + text = '' + active_workspace_id=$(hyprctl activeworkspace -j | jq -r '.id') - hyprctl clients -j | - jq -r ".[] - | select(.workspace.id==''${active_workspace_id}) - | select(.focusHistoryID!=0) - | .pid" | - xargs -r kill -''; + hyprctl clients -j | + jq -r ".[] + | select(.workspace.id==''${active_workspace_id}) + | select(.focusHistoryID!=0) + | .pid" | + xargs -r kill + ''; } diff --git a/modules/scripts/launch.nix b/modules/scripts/launch.nix index 15268ea..1827989 100644 --- a/modules/scripts/launch.nix +++ b/modules/scripts/launch.nix @@ -1,15 +1,17 @@ # used for the terminal autostart. Needs to get cleared and recall fastfetch so that the bar from oh-my-zsh get resized - -{ writeShellApplication, zsh, ... }: - +{ + writeShellApplication, + zsh, + ... +}: writeShellApplication { - name = "custom-launch"; - runtimeInputs = [ - zsh - ]; - text = '' -sleep 2 -clear -zsh -''; + name = "custom-launch"; + runtimeInputs = [ + zsh + ]; + text = '' + sleep 2 + clear + zsh + ''; } diff --git a/modules/scripts/librewolfprofiles.nix b/modules/scripts/librewolfprofiles.nix index 2b055a7..b12c34b 100644 --- a/modules/scripts/librewolfprofiles.nix +++ b/modules/scripts/librewolfprofiles.nix @@ -1,5 +1,10 @@ -{ writeShellApplication, zsh, kitty, fzf,... }: - +{ + writeShellApplication, + zsh, + kitty, + fzf, + ... +}: writeShellApplication { name = "custom-librewolfprofiles"; runtimeInputs = [ @@ -7,21 +12,21 @@ writeShellApplication { fzf ]; text = '' -# List of profiles -profiles=("work" "other") + # List of profiles + profiles=("work" "other") -# Use fzf to select -selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select LibreWolf profile:") + # Use fzf to select + selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select LibreWolf profile:") -# If user cancels, exit -[[ -z "$selected" ]] && exit 0 + # If user cancels, exit + [[ -z "$selected" ]] && exit 0 -# Launch LibreWolf detached, keeping environment -setsid librewolf -P "$selected" --no-remote >/dev/null 2>&1 & - pkill -f "kitty.*Select LibreWolf profile" + # Launch LibreWolf detached, keeping environment + setsid librewolf -P "$selected" --no-remote >/dev/null 2>&1 & + pkill -f "kitty.*Select LibreWolf profile" -# Exit the kitty terminal after selection -exit -''; + # Exit the kitty terminal after selection + exit + ''; } diff --git a/modules/scripts/man.nix b/modules/scripts/man.nix index 4ead15f..0b1766d 100644 --- a/modules/scripts/man.nix +++ b/modules/scripts/man.nix @@ -1,43 +1,46 @@ -{ writeShellApplication, man, ripgrep, fzf, ... }: - -let +{ + writeShellApplication, + man, + ripgrep, + fzf, + ... +}: let cacheTime = "10"; in - -writeShellApplication { - name = "custom-man"; - runtimeInputs = [ - man - ripgrep - fzf - ]; + writeShellApplication { + name = "custom-man"; + runtimeInputs = [ + man + ripgrep + fzf + ]; text = '' -CACHE_DIR="''${XDG_CACHE_HOME:-$HOME/.cache}" -CACHE_FILE="$CACHE_DIR/custom-man-options.txt" -mkdir -p "$CACHE_DIR" + CACHE_DIR="''${XDG_CACHE_HOME:-$HOME/.cache}" + CACHE_FILE="$CACHE_DIR/custom-man-options.txt" + mkdir -p "$CACHE_DIR" -REGENERATE=0 + REGENERATE=0 -# check if -r flag was passed -if [ "''${1:-}" = "-r" ]; then - REGENERATE=1 -fi + # check if -r flag was passed + if [ "''${1:-}" = "-r" ]; then + REGENERATE=1 + fi -# regenerate if file does not exist or is older than cacheTime days -if [ ! -f "$CACHE_FILE" ] || [ "$(find "$CACHE_FILE" -mtime +${cacheTime} -print)" ]; then - REGENERATE=1 -fi + # regenerate if file does not exist or is older than cacheTime days + if [ ! -f "$CACHE_FILE" ] || [ "$(find "$CACHE_FILE" -mtime +${cacheTime} -print)" ]; then + REGENERATE=1 + fi -if [ $REGENERATE -eq 1 ]; then - echo "(Re)building custom-manix cache..." - mkdir -p "$(dirname "$CACHE_FILE")" - man -k . > "$CACHE_FILE" -fi + if [ $REGENERATE -eq 1 ]; then + echo "(Re)building custom-manix cache..." + mkdir -p "$(dirname "$CACHE_FILE")" + man -k . > "$CACHE_FILE" + fi -# read from cache and pipe into fzf -cat "$CACHE_FILE" \ - | fzf --preview "man {1}" \ - | xargs man - ''; -} + # read from cache and pipe into fzf + cat "$CACHE_FILE" \ + | fzf --preview "man {1}" \ + | xargs man + ''; + } diff --git a/modules/scripts/manix.nix b/modules/scripts/manix.nix index 2ebad5c..cdbbd8e 100644 --- a/modules/scripts/manix.nix +++ b/modules/scripts/manix.nix @@ -1,43 +1,46 @@ -{ writeShellApplication, manix, ripgrep, fzf, ... }: - -let +{ + writeShellApplication, + manix, + ripgrep, + fzf, + ... +}: let cacheTime = "10"; in - -writeShellApplication { - name = "custom-manix"; - runtimeInputs = [ - manix - ripgrep - fzf - ]; + writeShellApplication { + name = "custom-manix"; + runtimeInputs = [ + manix + ripgrep + fzf + ]; text = '' -CACHE_DIR="''${XDG_CACHE_HOME:-$HOME/.cache}" -CACHE_FILE="$CACHE_DIR/custom-manix-options.txt" -mkdir -p "$CACHE_DIR" + CACHE_DIR="''${XDG_CACHE_HOME:-$HOME/.cache}" + CACHE_FILE="$CACHE_DIR/custom-manix-options.txt" + mkdir -p "$CACHE_DIR" -REGENERATE=0 + REGENERATE=0 -# check if -r flag was passed -if [ "''${1:-}" = "-r" ]; then - REGENERATE=1 -fi + # check if -r flag was passed + if [ "''${1:-}" = "-r" ]; then + REGENERATE=1 + fi -# regenerate if file does not exist or is older than cacheTime days -if [ ! -f "$CACHE_FILE" ] || [ "$(find "$CACHE_FILE" -mtime +${cacheTime} -print)" ]; then - REGENERATE=1 -fi + # regenerate if file does not exist or is older than cacheTime days + if [ ! -f "$CACHE_FILE" ] || [ "$(find "$CACHE_FILE" -mtime +${cacheTime} -print)" ]; then + REGENERATE=1 + fi -if [ $REGENERATE -eq 1 ]; then - echo "(Re)building custom-manix cache..." - mkdir -p "$(dirname "$CACHE_FILE")" - manix "" | rg -N '^(?:\x1b\[[0-9;]*m)*# ' | sed 's/\x1b\[[0-9;]*m//g; s/^# //' | rg -Nv '^(<|.*https?://)' > "$CACHE_FILE" -fi + if [ $REGENERATE -eq 1 ]; then + echo "(Re)building custom-manix cache..." + mkdir -p "$(dirname "$CACHE_FILE")" + manix "" | rg -N '^(?:\x1b\[[0-9;]*m)*# ' | sed 's/\x1b\[[0-9;]*m//g; s/^# //' | rg -Nv '^(<|.*https?://)' > "$CACHE_FILE" + fi -# read from cache and pipe into fzf -cat "$CACHE_FILE" \ - | fzf --preview "manix {}" \ - | xargs manix - ''; -} + # read from cache and pipe into fzf + cat "$CACHE_FILE" \ + | fzf --preview "manix {}" \ + | xargs manix + ''; + } diff --git a/modules/scripts/mountkdrive.nix b/modules/scripts/mountkdrive.nix index ed1dd6c..4786590 100644 --- a/modules/scripts/mountkdrive.nix +++ b/modules/scripts/mountkdrive.nix @@ -1,22 +1,26 @@ -{ writeShellApplication, rclone, libnotify, ... }: - +{ + writeShellApplication, + rclone, + libnotify, + ... +}: writeShellApplication { - name = "custom-mountkdrive"; - runtimeInputs = [ - rclone - libnotify - ]; - text = '' -REMOTE_NAME="kdrive" -MOUNT_POINT="$HOME/kdrive" + name = "custom-mountkdrive"; + runtimeInputs = [ + rclone + libnotify + ]; + text = '' + REMOTE_NAME="kdrive" + MOUNT_POINT="$HOME/kdrive" -if rclone listremotes | rg "^''${REMOTE_NAME}:"; then - echo "Mounting ''${REMOTE_NAME}..." - rclone mount "''${REMOTE_NAME}:" "$MOUNT_POINT" --vfs-cache-mode writes & -else - notify-send "rclone mount failed" \ - "Remote ''${REMOTE_NAME} not found.\nConfigure rclone and create the dir ~/kdrive/ or comment out the exec line in hyprland.nix." -echo "Remote ''${REMOTE_NAME} not found. Configure rclone or comment out the exec line in hyprland.nix." -fi - ''; + if rclone listremotes | rg "^''${REMOTE_NAME}:"; then + echo "Mounting ''${REMOTE_NAME}..." + rclone mount "''${REMOTE_NAME}:" "$MOUNT_POINT" --vfs-cache-mode writes & + else + notify-send "rclone mount failed" \ + "Remote ''${REMOTE_NAME} not found.\nConfigure rclone and create the dir ~/kdrive/ or comment out the exec line in hyprland.nix." + echo "Remote ''${REMOTE_NAME} not found. Configure rclone or comment out the exec line in hyprland.nix." + fi + ''; } diff --git a/modules/scripts/performance-mode.nix b/modules/scripts/performance-mode.nix index eb55a35..204cf17 100644 --- a/modules/scripts/performance-mode.nix +++ b/modules/scripts/performance-mode.nix @@ -1,33 +1,37 @@ # used for the terminal autostart. Needs to get cleared and recall fastfetch so that the bar from oh-my-zsh get resized - -{ writeShellApplication, hyprland, gawk, libnotify, ... }: - +{ + writeShellApplication, + hyprland, + gawk, + libnotify, + ... +}: writeShellApplication { - name = "custom-performance"; - runtimeInputs = [ - "hyprland" - "gawk" - "libnotify" - ]; - text = '' -HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') -if [ "$HYPRGAMEMODE" = 1 ] ; then - hyprctl --batch "\ - keyword animations:enabled 0;\ - keyword animation borderangle,0; \ - keyword decoration:shadow:enabled 0;\ - keyword decoration:blur:enabled 0;\ - keyword decoration:fullscreen_opacity 1;\ - keyword general:gaps_in 0;\ - keyword general:gaps_out 0;\ - keyword general:border_size 1;\ - keyword decoration:rounding 0" - notify-send -u critical -t 5000 "Performance mode [ON]" - exit -else - notify-send -u critical -t 5000 "Performance mode [OFF]" - hyprctl reload - exit 0 -fi - ''; + name = "custom-performance"; + runtimeInputs = [ + "hyprland" + "gawk" + "libnotify" + ]; + text = '' + HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') + if [ "$HYPRGAMEMODE" = 1 ] ; then + hyprctl --batch "\ + keyword animations:enabled 0;\ + keyword animation borderangle,0; \ + keyword decoration:shadow:enabled 0;\ + keyword decoration:blur:enabled 0;\ + keyword decoration:fullscreen_opacity 1;\ + keyword general:gaps_in 0;\ + keyword general:gaps_out 0;\ + keyword general:border_size 1;\ + keyword decoration:rounding 0" + notify-send -u critical -t 5000 "Performance mode [ON]" + exit + else + notify-send -u critical -t 5000 "Performance mode [OFF]" + hyprctl reload + exit 0 + fi + ''; } diff --git a/modules/scripts/tomato.nix b/modules/scripts/tomato.nix index 3a2fde9..68c5526 100644 --- a/modules/scripts/tomato.nix +++ b/modules/scripts/tomato.nix @@ -1,12 +1,16 @@ -{ writeShellApplication, kitty, tomato-c,... }: - +{ + writeShellApplication, + kitty, + tomato-c, + ... +}: writeShellApplication { - name = "custom-tomato"; - runtimeInputs = [ - kitty - tomato-c - ]; - text = '' - kitty --class "custom-pomodoro" --name "custom-pomodoro" -e tomato -''; + name = "custom-tomato"; + runtimeInputs = [ + kitty + tomato-c + ]; + text = '' + kitty --class "custom-pomodoro" --name "custom-pomodoro" -e tomato + ''; } diff --git a/modules/scripts/wallpaper.nix b/modules/scripts/wallpaper.nix index 96e621a..62916a2 100644 --- a/modules/scripts/wallpaper.nix +++ b/modules/scripts/wallpaper.nix @@ -1,47 +1,49 @@ -{ writeShellApplication, socat, swww, ... }: - -let - wallpaper1 = ../../assets/wallpaper1.jpg; - wallpaper2 = ../../assets/wallpaper2.jpg; - wallpaper3 = ../../assets/wallpaper3.jpg; - wallpaper4 = ../../assets/wallpaper4.jpg; - wallpaper5 = ../../assets/wallpaper5.jpg; +{ + writeShellApplication, + socat, + swww, + ... +}: let + wallpaper1 = ../../assets/wallpaper1.jpg; + wallpaper2 = ../../assets/wallpaper2.jpg; + wallpaper3 = ../../assets/wallpaper3.jpg; + wallpaper4 = ../../assets/wallpaper4.jpg; + wallpaper5 = ../../assets/wallpaper5.jpg; in + writeShellApplication { + name = "custom-wallpaper"; + runtimeInputs = [ + socat + swww + ]; + text = '' + handle() { + case $1 in + workspace*) + str=$1 + i=$((''${#str}-1)) + workspace="''${str:$i:1}" + case $workspace in + 1 | 6) + swww img -t none ${wallpaper1} + ;; + 2 | 7) + swww img -t none ${wallpaper2} + ;; + 3 | 8) + swww img -t none ${wallpaper3} + ;; + 4 | 9) + swww img -t none ${wallpaper4} + ;; + 5 | 10 | 0) + swww img -t none ${wallpaper5} + ;; + esac + ;; + esac + } -writeShellApplication { - name = "custom-wallpaper"; - runtimeInputs = [ - socat - swww - ]; - text = '' -handle() { - case $1 in - workspace*) - str=$1 - i=$((''${#str}-1)) - workspace="''${str:$i:1}" - case $workspace in - 1 | 6) - swww img -t none ${wallpaper1} - ;; - 2 | 7) - swww img -t none ${wallpaper2} - ;; - 3 | 8) - swww img -t none ${wallpaper3} - ;; - 4 | 9) - swww img -t none ${wallpaper4} - ;; - 5 | 10 | 0) - swww img -t none ${wallpaper5} - ;; - esac - ;; - esac -} - -socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR"/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock | while read -r line; do handle "$line"; done - ''; -} + socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR"/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock | while read -r line; do handle "$line"; done + ''; + } diff --git a/modules/scripts/weather.nix b/modules/scripts/weather.nix index bcc53fb..5ff2e36 100644 --- a/modules/scripts/weather.nix +++ b/modules/scripts/weather.nix @@ -1,14 +1,17 @@ -{ writeShellApplication, curl, ... }: - +{ + writeShellApplication, + curl, + ... +}: writeShellApplication { - name = "custom-weather"; - runtimeInputs = [ - curl - ]; - text = '' -while true; do - curl "https://wttr.in/?0&d&q&F&lang=fr" - sleep 7200 -done - ''; + name = "custom-weather"; + runtimeInputs = [ + curl + ]; + text = '' + while true; do + curl "https://wttr.in/?0&d&q&F&lang=fr" + sleep 7200 + done + ''; } diff --git a/modules/scripts/weatherwaybar.nix b/modules/scripts/weatherwaybar.nix index fa75032..8e6a390 100644 --- a/modules/scripts/weatherwaybar.nix +++ b/modules/scripts/weatherwaybar.nix @@ -1,20 +1,23 @@ -{ writeShellApplication, curl, ... }: - +{ + writeShellApplication, + curl, + ... +}: writeShellApplication { - name = "custom-weatherwaybar"; - runtimeInputs = [ - curl - ]; - text = '' -PATTERN="C" -PATTERN2=" " -TEXT1="''$(curl -s "https://wttr.in/?format=%c")" -TEXT1=''${TEXT1/$PATTERN2/} -TEXT2="''$(curl -s "https://wttr.in/?format=%t")" -TEXT2=''${TEXT2/$PATTERN/} -TEXT3="''$(curl -s "https://wttr.in/?format=%f")" -TEXT3=''${TEXT3/$PATTERN/} -printf '{"text":" %s\\n %s\\n %s", "tooltip": false, "class": "weather"}\\n' \ - "$TEXT1" "$TEXT2" "$TEXT3" -''; + name = "custom-weatherwaybar"; + runtimeInputs = [ + curl + ]; + text = '' + PATTERN="C" + PATTERN2=" " + TEXT1="''$(curl -s "https://wttr.in/?format=%c")" + TEXT1=''${TEXT1/$PATTERN2/} + TEXT2="''$(curl -s "https://wttr.in/?format=%t")" + TEXT2=''${TEXT2/$PATTERN/} + TEXT3="''$(curl -s "https://wttr.in/?format=%f")" + TEXT3=''${TEXT3/$PATTERN/} + printf '{"text":" %s\\n %s\\n %s", "tooltip": false, "class": "weather"}\\n' \ + "$TEXT1" "$TEXT2" "$TEXT3" + ''; }