diff --git a/derivations/wluma/default.nix b/derivations/wluma/default.nix new file mode 100644 index 0000000..deb389b --- /dev/null +++ b/derivations/wluma/default.nix @@ -0,0 +1,54 @@ +{ lib +, stdenv +, fetchFromGitHub +, makeWrapper +, rustPlatform +, marked-man +, coreutils +, vulkan-loader +, wayland +, pkg-config +, udev +, v4l-utils +, dbus +, darwin +}: + +rustPlatform.buildRustPackage rec { + pname = "wluma"; + version = "unstable-2024-02-29"; + + src = fetchFromGitHub { + owner = "avalsch"; + repo = "wluma"; + rev = "27624132a862af36e7d51c8ca215cf6f2dfbed1d"; + hash = "sha256-C29i+y/J7ABsEewMhQXCHMRpADogzp4PYtL+Ar0CKTw="; + }; + + cargoHash = "sha256-aOdBNIpZqigcQC25bxtAqDSO5nwGzcJ3VC3z6MUgmO8="; + + nativeBuildInputs = [ + pkg-config + rustPlatform.bindgenHook + ]; + + buildInputs = [ + dbus + udev + vulkan-loader + v4l-utils + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreGraphics + darwin.apple_sdk.frameworks.IOKit + ] ++ lib.optionals stdenv.isLinux [ + wayland + ]; + + meta = with lib; { + description = "Automatic brightness adjustment based on screen contents and ALS"; + homepage = "https://github.com/avalsch/wluma/tree/als.cmd"; + license = licenses.isc; + maintainers = with maintainers; [ ]; + mainProgram = "wluma"; + }; +} diff --git a/derivations/wluma/wluma.nix b/derivations/wluma/wluma.nix new file mode 100644 index 0000000..079b96b --- /dev/null +++ b/derivations/wluma/wluma.nix @@ -0,0 +1,79 @@ +{ lib +, stdenv +, fetchFromGitHub +, makeWrapper +, rustPlatform +, marked-man +, coreutils +, vulkan-loader +, wayland +, pkg-config +, udev +, v4l-utils +, dbus +, nix-update-script +}: + +rustPlatform.buildRustPackage rec { + pname = "wluma"; + version = "4.40"; + + src = fetchFromGitHub { + owner = "avalsch"; + repo = "wluma"; + rev = "27624132a862af36e7d51c8ca215cf6f2dfbed1d"; + sha256 = "sha256-C29i+y/J7ABsEewMhQXCHMRpADogzp4PYtL+Ar0CKTw=="; + }; + + postPatch = '' + substituteInPlace Makefile --replace \ + 'target/release/$(BIN)' \ + 'target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/$(BIN)' + + # Needs chmod and chgrp + substituteInPlace 90-wluma-backlight.rules --replace \ + 'RUN+="/bin/' 'RUN+="${coreutils}/bin/' + + substituteInPlace wluma.service --replace \ + 'ExecStart=/usr/bin/wluma' 'ExecStart=${placeholder "out"}/bin/wluma' + ''; + + cargoHash = "sha256-90l1lO7ERrsbYCo7ZX7zikemehBgUHN/HTfx+EoBMjc="; + + nativeBuildInputs = [ + makeWrapper + pkg-config + rustPlatform.bindgenHook + marked-man + ]; + + buildInputs = [ + udev + v4l-utils + vulkan-loader + dbus + ]; + + postBuild = '' + make docs + ''; + + dontCargoInstall = true; + installFlags = [ "PREFIX=${placeholder "out"}" ]; + postInstall = '' + wrapProgram $out/bin/wluma \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ wayland ]}" + ''; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = "Automatic brightness adjustment based on screen contents and ALS"; + homepage = "https://github.com/maximbaz/wluma"; + changelog = "https://github.com/maximbaz/wluma/releases/tag/${version}"; + license = licenses.isc; + maintainers = with maintainers; [ yshym jmc-figueira atemu ]; + platforms = platforms.linux; + mainProgram = "wluma"; + }; +} \ No newline at end of file diff --git a/flake.lock b/flake.lock index 67652a6..6775252 100644 --- a/flake.lock +++ b/flake.lock @@ -38,6 +38,45 @@ "type": "github" } }, + "chaotic": { + "inputs": { + "compare-to": "compare-to", + "flake-schemas": "flake-schemas", + "home-manager": "home-manager", + "jovian": "jovian", + "nixpkgs": "nixpkgs", + "systems": "systems_2", + "yafas": "yafas" + }, + "locked": { + "lastModified": 1718673414, + "narHash": "sha256-1qT6lASTdJ19MMd1KX6nsJgvtt1ttO40n4jZOmVoDdw=", + "owner": "chaotic-cx", + "repo": "nyx", + "rev": "ae7b3c61e11fb89c2d893b92c83a0b9b1f342c3c", + "type": "github" + }, + "original": { + "owner": "chaotic-cx", + "ref": "nyxpkgs-unstable", + "repo": "nyx", + "type": "github" + } + }, + "compare-to": { + "locked": { + "lastModified": 1695341185, + "narHash": "sha256-htO6DSbWyCgaDkxi7foPjXwJFPzGjVt3RRUbPSpNtZY=", + "rev": "98b8e330823a3570d328720f87a1153f8a7f2224", + "revCount": 2, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/chaotic-cx/nix-empty-flake/0.1.2%2Brev-98b8e330823a3570d328720f87a1153f8a7f2224/018aba35-d228-7fa9-b205-7616c89ef4e0/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/chaotic-cx/nix-empty-flake/%3D0.1.2.tar.gz" + } + }, "devshell": { "inputs": { "flake-utils": "flake-utils_2", @@ -171,9 +210,23 @@ "type": "github" } }, + "flake-schemas": { + "locked": { + "lastModified": 1693491534, + "narHash": "sha256-ifw8Td8kD08J8DxFbYjeIx5naHcDLz7s2IFP3X42I/U=", + "rev": "c702cbb663d6d70bbb716584a2ee3aeb35017279", + "revCount": 21, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.1/018a4c59-80e1-708a-bb4d-854930c20f72/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.1.tar.gz" + } + }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1710146030, @@ -191,7 +244,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1701680307, @@ -209,7 +262,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1710146030, @@ -227,7 +280,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_6" + "systems": "systems_7" }, "locked": { "lastModified": 1710146030, @@ -293,6 +346,27 @@ } }, "home-manager": { + "inputs": { + "nixpkgs": [ + "chaotic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1718526747, + "narHash": "sha256-sKrD/utGvmtQALvuDj4j0CT3AJXP1idOAq2p+27TpeE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0a7ffb28e5df5844d0e8039c9833d7075cdee792", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -312,7 +386,7 @@ "type": "github" } }, - "home-manager_2": { + "home-manager_3": { "inputs": { "nixpkgs": [ "nixvim", @@ -368,8 +442,8 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs", - "systems": "systems_3", + "nixpkgs": "nixpkgs_2", + "systems": "systems_4", "xdph": "xdph" }, "locked": { @@ -514,6 +588,28 @@ "type": "github" } }, + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "chaotic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1718431241, + "narHash": "sha256-vOsklVeiGCvf9LBOz0sjHMNvohgUw8/Oe/8MpdFnF+Y=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "f02a01aab60c68b7898043c2e7f5bc97c93fb07b", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, "lib-aggregate": { "inputs": { "flake-utils": "flake-utils", @@ -570,13 +666,36 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "chaotic", + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1690328911, + "narHash": "sha256-fxtExYk+aGf2YbjeWQ8JY9/n9dwuEt+ma1eUFzF8Jeo=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "96df4a39c52f53cb7098b923224d8ce941b64747", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1718318537, - "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=", + "lastModified": 1718530797, + "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420", + "rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "type": "github" }, "original": { @@ -682,6 +801,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1718318537, + "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1717602782, "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", @@ -697,7 +832,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1716769173, "narHash": "sha256-7EXDb5WBw+d004Agt+JHC/Oyh/KTUglOaQ4MNjBbo5w=", @@ -713,7 +848,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1712791164, "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", @@ -729,7 +864,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1712883908, "narHash": "sha256-icE1IJE9fHcbDfJ0+qWoDdcBXUoZCcIJxME4lMHwvSM=", @@ -745,7 +880,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1714906307, "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", @@ -767,9 +902,9 @@ "flake-compat": "flake-compat_2", "flake-parts": "flake-parts_2", "git-hooks": "git-hooks", - "home-manager": "home-manager_2", + "home-manager": "home-manager_3", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -789,11 +924,12 @@ "root": { "inputs": { "anyrun": "anyrun", + "chaotic": "chaotic", "firefox": "firefox", - "home-manager": "home-manager", + "home-manager": "home-manager_2", "hyprland": "hyprland", "hyprland-contrib": "hyprland-contrib", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs2105": "nixpkgs2105", @@ -805,7 +941,7 @@ }, "secrets": { "inputs": { - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "sops-nix": "sops-nix" }, "locked": { @@ -849,7 +985,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { @@ -882,21 +1018,6 @@ } }, "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_3": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -911,7 +1032,7 @@ "type": "github" } }, - "systems_4": { + "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -926,6 +1047,21 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "systems_5": { "locked": { "lastModified": 1681028828, @@ -956,10 +1092,25 @@ "type": "github" } }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tdesktop": { "inputs": { "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1715005420, @@ -1025,6 +1176,31 @@ "repo": "xdg-desktop-portal-hyprland", "type": "github" } + }, + "yafas": { + "inputs": { + "flake-schemas": [ + "chaotic", + "flake-schemas" + ], + "systems": [ + "chaotic", + "systems" + ] + }, + "locked": { + "lastModified": 1695926485, + "narHash": "sha256-wNFFnItckgSs8XeYhhv8vlJs2WF09fSQaWgw4xkDqHQ=", + "owner": "UbiqueLambda", + "repo": "yafas", + "rev": "7772afd6686458ca0ddbc599a52cf5d337367653", + "type": "github" + }, + "original": { + "owner": "UbiqueLambda", + "repo": "yafas", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ad6bff5..efa36e2 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,8 @@ inputs.nixpkgs.follows = "nixpkgs-unstable"; }; + chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + }; outputs = inputs@{ self, nixpkgs, home-manager, ... }: diff --git a/home/theme.nix b/home/theme.nix index 133b630..5988605 100644 --- a/home/theme.nix +++ b/home/theme.nix @@ -25,6 +25,7 @@ in { colloid-icon-theme adw-gtk3 nerdfonts + tokyonight-gtk-theme ]; sessionVariables.XCURSOR_THEME = cursor-theme; pointerCursor = { diff --git a/hosts/dlaptop/hardware.nix b/hosts/dlaptop/hardware.nix index 3c1e374..8aac5f9 100644 --- a/hosts/dlaptop/hardware.nix +++ b/hosts/dlaptop/hardware.nix @@ -88,24 +88,45 @@ echo kernel: $(uname -r | tr '[:upper:]' '[:lower:]') "amd_pstate.shared_mem=1" "zfs.zfs_arc_max=19327352832" "resume=UUID=a2ff20bd-56f3-4c83-b1b4-933ba0c82f36" + + # # Disable all mitigations + # "mitigations=off" + # "nopti" + # "tsx=on" + + # https://www.phoronix.com/news/Linux-Splitlock-Hurts-Gaming + "split_lock_detect=off" ]; + boot.zfs.allowHibernation = true; + boot.zfs.forceImportRoot = false; + boot.resumeDevice = "/dev/mapper/cryptroot0p2"; + boot.kernelModules = [ "amd-pstate" "acpi_call" "amdgpu" "kvm-amd" "vfat" "nls_cp437" "nls_iso8859-1" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" "vfat" "nls_cp437" "nls_iso8859-1" ]; boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.efiSysMountPoint = "/boot"; boot.initrd.kernelModules = [ ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ usbip.out ]; - boot.kernelPackages = - with builtins; with lib; let - latestCompatibleVersion = config.boot.zfs.package.latestCompatibleLinuxPackages.kernel.version; - xanPackages = filterAttrs (name: packages: hasSuffix "_xanmod" name && (tryEval packages).success) pkgs.linuxKernel.packages; - compatiblePackages = filter (packages: compareVersions packages.kernel.version latestCompatibleVersion <= 0) (attrValues xanPackages); - orderedCompatiblePackages = sort (x: y: compareVersions x.kernel.version y.kernel.version > 0) compatiblePackages; - selectedKernelPackage = head orderedCompatiblePackages; - in selectedKernelPackage // { - extraPackages = with selectedKernelPackage; [ acpi_call ]; - }; + # boot.extraModulePackages = with config.boot.kernelPackages; [ usbip.out acpi_call zfs]; + # boot.kernelPackages = + # with builtins; with lib; let + # latestCompatibleVersion = config.boot.zfs.package.latestCompatibleLinuxPackages.kernel.version; + # xanPackages = filterAttrs (name: packages: hasSuffix "_xanmod" name && (tryEval packages).success) pkgs.linuxKernel.packages; + # compatiblePackages = filter (packages: compareVersions packages.kernel.version latestCompatibleVersion <= 0) (attrValues xanPackages); + # orderedCompatiblePackages = sort (x: y: compareVersions x.kernel.version y.kernel.version > 0) compatiblePackages; + # selectedKernelPackage = head orderedCompatiblePackages; + # in selectedKernelPackage // { + # extraPackages = with selectedKernelPackage; [ acpi_call ]; + # }; + + boot.kernelPackages = lib.mkOverride 99 pkgs.linuxPackages_cachyos; + boot.zfs.package = lib.mkOverride 99 pkgs.zfs_cachyos; + chaotic.scx.scheduler = "scx_rusty"; + boot.extraModulePackages = with config.boot.kernelPackages; [ usbip acpi_call ]; + + + + boot.plymouth.enable = false; @@ -116,7 +137,7 @@ echo kernel: $(uname -r | tr '[:upper:]' '[:lower:]') ''; boot.initrd.luks = { - yubikeySupport = false; + yubikeySupport = true; devices."cryptroot0" = { device = "/dev/nvme0n1p2"; postOpenCommands = " diff --git a/hosts/dlaptop/services.nix b/hosts/dlaptop/services.nix index f9e4b27..f41eb20 100644 --- a/hosts/dlaptop/services.nix +++ b/hosts/dlaptop/services.nix @@ -44,7 +44,10 @@ services.openssh.enable = true; systemd.services.sshd.wantedBy = lib.mkForce []; - services.tailscale.enable = true; + services.tailscale = { + enable = true; + extraUpFlags = "--accept-dns=false"; + }; services.syncthing.enable = true; #services.blueman.enable = true; services.tumbler.enable = true; diff --git a/hosts/dlaptop/system.nix b/hosts/dlaptop/system.nix index ee84223..1606eb7 100644 --- a/hosts/dlaptop/system.nix +++ b/hosts/dlaptop/system.nix @@ -9,12 +9,16 @@ ./hardware.nix ./services.nix ./xorg.nix + "${self}/pkgs/apps.nix" "${self}/pkgs/socks.nix" "${self}/pkgs/scripts.nix" "${self}/pkgs/work.nix" + "${self}/pkgs/dns.nix" + inputs.secrets.nixosModules.dlaptop inputs.home-manager.nixosModules.home-manager homeSettings + inputs.chaotic.nixosModules.default ]; services.blueman.enable = true; @@ -27,11 +31,17 @@ LC_TIME = "en_GB.UTF-8"; }; + documentation.man.enable = false; + documentation.nixos.enable = false; + + # networking.timeServers = ""; + # services.ntp.servers = ""; + networking = { hostName = "dlaptop"; - nameservers = [ "1.1.1.1" ]; - #nameservers = [ "100.92.15.128" "fd7a:115c:a1e0::b21c:f80" ]; - networkmanager.dns = "none"; + # nameservers = [ "1.1.1.1" ]; + nameservers = [ "127.0.0.1" ]; + networkmanager.dns = lib.mkForce "none"; networkmanager.enable = true; useDHCP = lib.mkDefault true; interfaces.wlp1s0.proxyARP = true; diff --git a/hosts/dlaptop/xorg.nix b/hosts/dlaptop/xorg.nix index 1cc33b9..83da416 100644 --- a/hosts/dlaptop/xorg.nix +++ b/hosts/dlaptop/xorg.nix @@ -16,6 +16,7 @@ EDITOR = "hx"; BROWSER = "firefox"; TERMINAL = "foot"; + WLR_DRM_NO_MODIFIERS = 1; # fixes graphical glitches on amd laptop }; environment.variables = lib.mkForce { diff --git a/hosts/generic.nix b/hosts/generic.nix index a091d73..67caa6d 100644 --- a/hosts/generic.nix +++ b/hosts/generic.nix @@ -49,7 +49,7 @@ in { users.users.delta = { isNormalUser = true; description = "delta"; - extraGroups = [ "networkmanager" "wheel" "libvirtd" "adbusers" ]; + extraGroups = [ "networkmanager" "wheel" "libvirtd" "adbusers" "video"]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGGL2UD0frl9F2OPBiPlSQqxDsuACbAVgwH24F0KT14L" ]; diff --git a/pkgs/apps.nix b/pkgs/apps.nix index 5fc6ae3..c621387 100644 --- a/pkgs/apps.nix +++ b/pkgs/apps.nix @@ -42,6 +42,7 @@ in { (fishPlugins.callPackage ../derivations/fish/fish-functions.nix { }) (callPackage ../derivations/opera-proxy.nix { }) (callPackage ../derivations/hyprdrop/hyprdrop.nix { }) + (callPackage ../derivations/wluma/wluma.nix { }) xorg.xwininfo jq dropbox @@ -68,6 +69,7 @@ in { nom localsend ktailctl + trayscale fishPlugins.done monero-gui translate-shell @@ -87,6 +89,7 @@ in { shwewo.ephemeralbrowser shwewo.ruchrome shwewo.spotify + telegram-desktop #(pkgs.symlinkJoin { # name = "ExprSelect"; # paths = [ shwewo.spotify ]; @@ -117,6 +120,7 @@ in { qrtool appimage-run lf + hydra-check (pkgs.writeScriptBin "reboot" ''read -p "Do you REALLY want to reboot? (y/N) " answer; [[ $answer == [Yy]* ]] && ${pkgs.systemd}/bin/reboot'') ]); @@ -258,6 +262,9 @@ in { abbr -a --position command ttlfix TTLfix abbr -a --position command syspend systemctl suspend abbr -a --position command suspend systemctl suspend + abbr -a --position command hibernate systemctl hibernate + abbr -a --position command hybernate systemctl hibernate + abbr -- - 'cd -' abbr cdd 'cd ~/Downloads' @@ -375,7 +382,7 @@ in { lsp = { enable = true; servers = { - bashls.enable = true; + # bashls.enable = true; nixd.enable = true; }; keymaps.lspBuf = { diff --git a/pkgs/dns.nix b/pkgs/dns.nix new file mode 100644 index 0000000..d6ea1b3 --- /dev/null +++ b/pkgs/dns.nix @@ -0,0 +1,62 @@ +{ lib, ... }: +{ + networking.nameservers = lib.mkForce [ "127.0.0.1" ]; + + services.unbound = { + enable = true; + settings = { + server = { + interface = [ "127.0.0.1" ]; + do-ip6 = false; + cache-max-ttl = 86400; + cache-min-ttl = 1024; + cache-max-negative-ttl = 86400; + serve-expired = "yes"; + serve-expired-ttl = 86400; + serve-expired-ttl-reset = "yes"; + prefetch = "yes"; + prefetch-key = "yes"; + }; + + forward-zone = [ + { + name = "."; + forward-addr = [ + "100.92.15.128" + "192.168.150.2@53" + ]; + forward-first = true; + } + ]; + + remote-control = { + control-enable = true; + control-interface = "127.0.0.1"; + control-port = 8953; + }; + }; + }; + + # Not using unbound's dnscrypt so i can do it from novpn ns + services.dnscrypt-proxy2 = { + enable = true; + settings = { + ipv6_servers = true; + require_dnssec = true; + server_names = [ "cloudflare" ]; + listen_addresses = [ "127.0.0.1:53" "192.168.150.2:53"]; + }; + }; + + systemd.services.dnscrypt-proxy2 = { + after = [ "novpn.service" "network-online.target" ]; + wants = [ "novpn.service" "network-online.target" ]; + bindsTo = [ "novpn.service" ]; + + wantedBy = lib.mkForce []; + serviceConfig = { + StateDirectory = "dnscrypt-proxy"; + NetworkNamespacePath = "/run/netns/novpn"; + }; + }; +} \ No newline at end of file diff --git a/pkgs/helix/default.nix b/pkgs/helix/default.nix index 4dd602c..e52eaa3 100644 --- a/pkgs/helix/default.nix +++ b/pkgs/helix/default.nix @@ -42,7 +42,7 @@ }; }; - extraPackages = [ pkgs.marksman pkgs.nil pkgs.nodePackages.bash-language-server]; + extraPackages = [ pkgs.marksman pkgs.nil ]; }; #programs.dircolors.enable = true; diff --git a/pkgs/hyprland/hypr/default.nix b/pkgs/hyprland/hypr/default.nix index 719a7af..af0472a 100644 --- a/pkgs/hyprland/hypr/default.nix +++ b/pkgs/hyprland/hypr/default.nix @@ -11,7 +11,7 @@ users.users.delta.packages = with pkgs; [ swww waybar - stable.swaynotificationcenter + swaynotificationcenter cliphist fzf hyprshot @@ -28,6 +28,9 @@ hyprshade # hyprshade toggle blue-light-filter gammastep # gammastep -O 4500K hyprlock + # wluma + + ]; # environment.systemPackages = [ # inputs.hyprland-contrib.packages.${pkgs.system}.grimblast.override { license = licenses.gpl3; } @@ -68,5 +71,7 @@ # ]; }; home.file.".config/hypr/env_var.conf".text = builtins.readFile ./env_var.conf; + home.file.".config/hypr/media-binds.conf".text = builtins.readFile ./media-binds.conf; + }; } diff --git a/pkgs/hyprland/hypr/env_var.conf b/pkgs/hyprland/hypr/env_var.conf index f27e78c..af05596 100644 --- a/pkgs/hyprland/hypr/env_var.conf +++ b/pkgs/hyprland/hypr/env_var.conf @@ -11,7 +11,7 @@ env = TERMINAL,footclient #env = XCURSOR_SIZE,24 # Set a GTK theme manually, for those who want to avoid appearance tools such as lxappearance or nwg-look -#env = GTK_THEME, +env = GTK_THEME,Tokyonight-Dark-B # Set your cursor theme. The theme needs to be installed and readable by your user. #env = XCURSOR_THEME, @@ -53,6 +53,11 @@ env = CLUTTER_BACKEND,wayland env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 #Tells QT based applications to pick your theme from qt5ct, use with Kvantum. -# env = QT_QPA_PLATFORMTHEME,qt5ct -env = QT_SCALE_FACTOR,2 -env = GDK_SCALE,2 +env = QT_QPA_PLATFORMTHEME,gtk + +env = QT_SCALE_FACTOR,1.3 +env = GDK_SCALE,1.3 + +env = XDG_CURRENT_DESKTOP,Hyprland +env = XDG_SESSION_TYPE,wayland +env = XDG_SESSION_DESKTOP,Hyprland \ No newline at end of file diff --git a/pkgs/hyprland/hypr/hyprland.conf b/pkgs/hyprland/hypr/hyprland.conf index a96869f..2829d16 100644 --- a/pkgs/hyprland/hypr/hyprland.conf +++ b/pkgs/hyprland/hypr/hyprland.conf @@ -53,7 +53,7 @@ exec-once = hyprctl setcursor Bibata-Modern-Classic 16 # exec-once = trayscale --hide-window # change tp ktailctl later # exec-once = hyprctl dispatch -- exec [workspace special:hdrop silent] "QT_QPA_PLATFORM=xcb telegram-desktop" exec-once = /home/delta/.config/hypr/hdrop -b -g '30' -h '60' -f 'keepassxc_lite' --class org.keepassxc.KeePassXC -exec-once = hyprdrop kitty -b -i kitty_hyprdrop +exec-once = hyprdrop kitty -b -i kitty_hyprdrop & hyprctl dispatch -- focuswindow "^$CLASS$" || notify "hdrop: Error focusing '$COMMANDLINE' on current workspace" exec-once = dropbox exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP @@ -404,6 +404,7 @@ bind = $mainMod, P, pseudo, # dwindle #bind = $mainMod, S, exec,XCURSOR_SIZE=16 sh -c "grim -g "$(slurp)" - | tee >(swappy -f -) | wl-copy" # take a screenshot bind = $mainMod, S, exec,XCURSOR_SIZE=16 grimblast --freeze copy area # take a screenshot bind = $mainMod SHIFT, S, exec,XCURSOR_SIZE=16 sh -c 'grim -g "$(slurp)" - | qrtool decode | tee >(wl-copy) >(notify-send --icon=clipboard "QR Code Content" "$(cat)")' +bind = $mainMod CONTROL, S, exec,hyprshade #bind = $mainMod, Print, exec, /home/delta/.config/hypr/grimblast.sh # take a screenshot # bind = $mainMod, Print, exec, /home/delta/scripts/screenshoter.sh # take a screenshot bind = ,Print , exec, wl-paste | swappy -f - # take a screenshot @@ -532,5 +533,5 @@ binde = $mainMod SHIFT CTRL, L, moveactive, 30 0 # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf -###source = ~/.config/hypr/media-binds.conf -###source = ~/.config/hypr/env_var.conf +source = ~/.config/hypr/media-binds.conf +source = ~/.config/hypr/env_var.conf diff --git a/pkgs/hyprland/hypr/media-binds.conf b/pkgs/hyprland/hypr/media-binds.conf index 03c0c24..f479ec6 100644 --- a/pkgs/hyprland/hypr/media-binds.conf +++ b/pkgs/hyprland/hypr/media-binds.conf @@ -1,18 +1,19 @@ -$SCRIPT = ~/.config/HyprV/waybar/scripts -bind = , xf86audioraisevolume, exec, $SCRIPT/volume --inc -bind = , xf86audiolowervolume, exec, $SCRIPT/volume --dec -bind = , xf86AudioMicMute, exec, $SCRIPT/volume --toggle-mic -bind = , xf86audioMute, exec, $SCRIPT/volume --toggle +bind = , xf86audioraisevolume, exec, volume --inc +bind = , xf86audiolowervolume, exec, volume --dec +bind = , xf86AudioMicMute, exec, volume --toggle-mic +bind = , xf86audioMute, exec, volume --toggle #bind = , XF86PowerOff, exec, swaynag -m 'Shutdown?' -Z 'No' '' -b 'Yes' 'systemctl poweroff' -bind = , xf86KbdBrightnessDown, exec, $SCRIPT/kb-brightness --dec -bind = , xf86KbdBrightnessUp, exec, $SCRIPT/kb-brightness --inc +# bind = , xf86KbdBrightnessDown, exec, $SCRIPT/kb-brightness --dec +# bind = , xf86KbdBrightnessUp, exec, $SCRIPT/kb-brightness --inc -bind = , xf86MonBrightnessDown, exec, $SCRIPT/brightness --dec -bind = , xf86MonBrightnessUp, exec, $SCRIPT/brightness --inc +bind = , xf86MonBrightnessDown, exec, brightness --dec +bind = , xf86MonBrightnessUp, exec, brightness --inc bind = , XF86AudioPlay, exec, playerctl play-pause bind = , XF86AudioNext, exec, playerctl next bind = , XF86AudioPrev, exec, playerctl previous + +bind = CONTROL ALT, DEL, exec, powermenu \ No newline at end of file diff --git a/pkgs/scripts.nix b/pkgs/scripts.nix index ca67b0e..48287d7 100644 --- a/pkgs/scripts.nix +++ b/pkgs/scripts.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, stable, ... }: let ephemeralbrowser = pkgs.writeScriptBin "ephemeralbrowser" '' @@ -35,7 +35,7 @@ let browser_path="${pkgs.google-chrome}/bin/google-chrome-stable https://ifconfig.me" profile="google-chrome" elif [[ $browser == "ungoogled_chromium" ]]; then - browser_path="${pkgs.ungoogled-chromium}/bin/chromium --user-data-dir=/tmp/ephemeralbrowser/.config/chromium https://ifconfig.me" + browser_path="${stable.ungoogled-chromium}/bin/chromium --user-data-dir=/tmp/ephemeralbrowser/.config/chromium https://ifconfig.me" profile="chromium" elif [[ $browser == "firefox" ]]; then browser_path="${pkgs.firefox}/bin/firefox -no-remote https://ifconfig.me" diff --git a/pkgs/scripts/bluetoothcharge.sh b/pkgs/scripts/bluetoothcharge.sh new file mode 100755 index 0000000..b050bd8 --- /dev/null +++ b/pkgs/scripts/bluetoothcharge.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +output=$(bluetoothctl info 2>&1) + +if [[ $output == *"Missing device address argument"* ]] || [[ $output == *"DeviceSet (null) not available"* ]]; then + exit 0 +fi + +charge=$(bluetoothctl info | awk -F ':' '/Battery Percentage: [0-9A-F]+/ {gsub(/.*\(|\).*/, "", $2); print $2}') +tooltip=$(bluetoothctl info | awk -F': ' '/Name/ {print $2}') + + #if [[ "$CHARGE" = "0" ]] + #then + # echo "" + #else + + #echo "{\"text\":\""$CHARGE"\", \"tooltip\":\""$tooltip"\"}" + #fi + #echo '{"number": "2", "tooltip": "text-text-text"}' + echo -e $charge'%\n'$tooltip + exit 0 + + + + diff --git a/pkgs/scripts/brightness.sh b/pkgs/scripts/brightness.sh new file mode 100755 index 0000000..1dafa13 --- /dev/null +++ b/pkgs/scripts/brightness.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +iDIR="$HOME/Documents/dotfiles/pkgs/scripts/icons" + +# Get brightness +get_backlight() { + LIGHT=$(printf "%.0f\n" $(brightnessctl i)) + echo "${LIGHT}%" +} + +# Get icons +get_icon() { + backlight="$(brightnessctl g)" + current="${backlight%%%}" + if [[ ("$current" -ge "0") && ("$current" -le "52") ]]; then + icon="$iDIR/brightness-20.png" + elif [[ ("$current" -ge "52") && ("$current" -le "103") ]]; then + icon="$iDIR/brightness-40.png" + elif [[ ("$current" -ge "103") && ("$current" -le "155") ]]; then + icon="$iDIR/brightness-60.png" + elif [[ ("$current" -ge "155") && ("$current" -le "207") ]]; then + icon="$iDIR/brightness-80.png" + elif [[ ("$current" -ge "180") && ("$current" -le "255") ]]; then + icon="$iDIR/brightness-100.png" + fi +} + +# Notify +notify_user() { + notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$icon" "Brightness : $(brightnessctl g)" +} + +# Increase brightness +inc_backlight() { + brightnessctl set 10%+ && get_icon && notify_user +} + +# Decrease brightness +dec_backlight() { + brightnessctl set 10%- && get_icon && notify_user +} + +# Execute accordingly +if [[ "$1" == "--get" ]]; then + brightnessctl g +elif [[ "$1" == "--inc" ]]; then + inc_backlight +elif [[ "$1" == "--dec" ]]; then + dec_backlight +else + get_backlight +fi \ No newline at end of file diff --git a/pkgs/scripts/default.nix b/pkgs/scripts/default.nix index a876af5..2edd05a 100644 --- a/pkgs/scripts/default.nix +++ b/pkgs/scripts/default.nix @@ -8,6 +8,11 @@ let "fzfclipboard" "fzfmenuft" "swaylock" + "hyprshade" + "bluetoothcharge" + "brightness" + "volume" + "powermenu" ]; # Generate the script binaries diff --git a/pkgs/scripts/hyprshade.sh b/pkgs/scripts/hyprshade.sh new file mode 100755 index 0000000..cc92d84 --- /dev/null +++ b/pkgs/scripts/hyprshade.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Define the options +options=( + "off" + "blue-light-filter" + "extradark" + "noblue-light" + "noblue-smart" + "noblue" +) + +# Prompt user to select an option using dmenu +selected_option=$(printf "%s\n" "${options[@]}" | fzfmenuft) + +# Check if selected option is empty (user canceled) +if [[ -z "$selected_option" ]]; then + exit 1 +fi + +# Construct the hyprshade command based on selected option +if [[ "$selected_option" == "off" ]]; then + command="hyprshade off" +else + command="hyprshade on $selected_option" +fi + +# Execute the constructed command +eval $command diff --git a/pkgs/scripts/icons/brightness-100.png b/pkgs/scripts/icons/brightness-100.png new file mode 100644 index 0000000..1e28ac3 Binary files /dev/null and b/pkgs/scripts/icons/brightness-100.png differ diff --git a/pkgs/scripts/icons/brightness-20.png b/pkgs/scripts/icons/brightness-20.png new file mode 100644 index 0000000..aee9c52 Binary files /dev/null and b/pkgs/scripts/icons/brightness-20.png differ diff --git a/pkgs/scripts/icons/brightness-40.png b/pkgs/scripts/icons/brightness-40.png new file mode 100644 index 0000000..bbedd1c Binary files /dev/null and b/pkgs/scripts/icons/brightness-40.png differ diff --git a/pkgs/scripts/icons/brightness-60.png b/pkgs/scripts/icons/brightness-60.png new file mode 100644 index 0000000..4cd838b Binary files /dev/null and b/pkgs/scripts/icons/brightness-60.png differ diff --git a/pkgs/scripts/icons/brightness-80.png b/pkgs/scripts/icons/brightness-80.png new file mode 100644 index 0000000..6684bdb Binary files /dev/null and b/pkgs/scripts/icons/brightness-80.png differ diff --git a/pkgs/scripts/icons/microphone-mute.png b/pkgs/scripts/icons/microphone-mute.png new file mode 100644 index 0000000..1780e33 Binary files /dev/null and b/pkgs/scripts/icons/microphone-mute.png differ diff --git a/pkgs/scripts/icons/microphone.png b/pkgs/scripts/icons/microphone.png new file mode 100644 index 0000000..d1b6d76 Binary files /dev/null and b/pkgs/scripts/icons/microphone.png differ diff --git a/pkgs/scripts/icons/volume-high.png b/pkgs/scripts/icons/volume-high.png new file mode 100644 index 0000000..200f17b Binary files /dev/null and b/pkgs/scripts/icons/volume-high.png differ diff --git a/pkgs/scripts/icons/volume-low.png b/pkgs/scripts/icons/volume-low.png new file mode 100644 index 0000000..17cfff7 Binary files /dev/null and b/pkgs/scripts/icons/volume-low.png differ diff --git a/pkgs/scripts/icons/volume-mid.png b/pkgs/scripts/icons/volume-mid.png new file mode 100644 index 0000000..1a3ad3a Binary files /dev/null and b/pkgs/scripts/icons/volume-mid.png differ diff --git a/pkgs/scripts/icons/volume-mute.png b/pkgs/scripts/icons/volume-mute.png new file mode 100644 index 0000000..0b9b0c3 Binary files /dev/null and b/pkgs/scripts/icons/volume-mute.png differ diff --git a/pkgs/scripts/powermenu.sh b/pkgs/scripts/powermenu.sh new file mode 100755 index 0000000..b2ff31c --- /dev/null +++ b/pkgs/scripts/powermenu.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# Define the options +options="Hibernate\nShutdown\nReboot\nSuspend\nLogout\nLock" + +# Use dmenu to get the user's choice +choice=$(echo -e "$options" | fzfmenuft) + +# Execute the corresponding command based on the user's choice +case "$choice" in + Hibernate) + systemctl hibernate + ;; + Shutdown) + systemctl poweroff + ;; + Reboot) + systemctl reboot + ;; + Suspend) + systemctl suspend + ;; + Logout) + # Assuming you're using a desktop environment that supports 'logout' + # Adjust the command according to your DE/WM + pkill -KILL -u $USER + ;; + Lock) + hyprlock + ;; + *) + echo "Invalid option" && exit 1 + ;; +esac diff --git a/pkgs/scripts/swaylock.sh b/pkgs/scripts/swaylock.sh index f4a0ac5..a622aac 100755 --- a/pkgs/scripts/swaylock.sh +++ b/pkgs/scripts/swaylock.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash sh -c "swaylock -C /home/delta/.config/swaylock/config --indicator-x-position $(shuf -i 100-1750 -n 1) --indicator-y-position $(shuf -i 50-1000 -n 1)" & hyprctl switchxkblayout at-translated-set-2-keyboard 0 diff --git a/pkgs/scripts/volume.sh b/pkgs/scripts/volume.sh new file mode 100755 index 0000000..f1a011e --- /dev/null +++ b/pkgs/scripts/volume.sh @@ -0,0 +1,129 @@ +#!/usr/bin/env bash + +iDIR="$HOME/Documents/dotfiles/pkgs/scripts/icons" + +# Get Volume +get_volume() { + volume=$(pamixer --get-volume) + echo "$volume" +} + +# Get icons +get_icon() { + current=$(get_volume) + if [[ "$current" -eq "0" ]]; then + echo "$iDIR/volume-mute.png" + elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then + echo "$iDIR/volume-low.png" + elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then + echo "$iDIR/volume-mid.png" + elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then + echo "$iDIR/volume-high.png" + fi +} + +draw_progressbar() { + # Get the percentage as the first argument + local percentage=$1 + # Calculate the number of filled and empty bars based on the percentage + local filled=$((percentage / 4)) + local empty=$((25 - filled)) + # Create a string of filled bars + local fill=$(printf "%${filled}s") + # Create a string of empty bars + local empt=$(printf "%${empty}s") + # Replace the spaces with the bar symbols + fill=${fill// /█} + empt=${empt// /░} + # Print the progressbar with the percentage + printf "%s%s" "$fill" "$empt" +} + +# Notify +notify_user() { + local volume=$(get_volume) + # Call the draw_progressbar function with the volume as the argument + local progressbar=$(draw_progressbar "$volume") + notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "$volume %" "$progressbar" +} + +# Increase Volume +inc_volume() { + pamixer -i 5 && notify_user +} + +# Decrease Volume +dec_volume() { + pamixer -d 5 && notify_user +} + +# Toggle Mute +toggle_mute() { + if [ "$(pamixer --get-mute)" == "false" ]; then + pamixer -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF" "$(draw_progressbar "0")" + elif [ "$(pamixer --get-mute)" == "true" ]; then + pamixer -u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume Switched ON" "$(draw_progressbar "$(get_volume)")" + fi +} + +# Toggle Mic +toggle_mic() { + if [ "$(pamixer --default-source --get-mute)" == "false" ]; then + pamixer --default-source -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF" + elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then + pamixer -u --default-source u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone.png" "Microphone Switched ON" + fi +} +# Get icons +get_mic_icon() { + current=$(pamixer --default-source --get-volume) + if [[ "$current" -eq "0" ]]; then + echo "$iDIR/microphone.png" + elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then + echo "$iDIR/microphone.png" + elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then + echo "$iDIR/microphone.png" + elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then + echo "$iDIR/microphone.png" + fi +} +# Notify +notify_mic_user() { + local volume=$(pamixer --default-source --get-volume) + # Call the draw_progressbar function with the volume as the argument + local progressbar=$(draw_progressbar "$volume") + notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_mic_icon)" "Mic-Level : $volume %" "$progressbar" +} + +# Increase MIC Volume +inc_mic_volume() { + pamixer --default-source -i 5 && notify_mic_user +} + +# Decrease MIC Volume +dec_mic_volume() { + pamixer --default-source -d 5 && notify_mic_user +} + +# Execute accordingly +if [[ "$1" == "--get" ]]; then + get_volume +elif [[ "$1" == "--inc" ]]; then + inc_volume +elif [[ "$1" == "--dec" ]]; then + dec_volume +elif [[ "$1" == "--toggle" ]]; then + toggle_mute +elif [[ "$1" == "--toggle-mic" ]]; then + toggle_mic +elif [[ "$1" == "--get-icon" ]]; then + get_icon +elif [[ "$1" == "--get-mic-icon" ]]; then + get_mic_icon +elif [[ "$1" == "--mic-inc" ]]; then + inc_mic_volume +elif [[ "$1" == "--mic-dec" ]]; then + dec_mic_volume +else + get_volume +fi diff --git a/pkgs/waybar/config-offline.jsonc b/pkgs/waybar/config-offline.jsonc index b9bb5a2..f375488 100644 --- a/pkgs/waybar/config-offline.jsonc +++ b/pkgs/waybar/config-offline.jsonc @@ -8,7 +8,7 @@ "height": 20, "modules-left": [ "custom/power_btn", - "custom/launch_apps", + // "custom/launch_apps", "idle_inhibitor", "hyprland/workspaces", "hyprland/window" @@ -70,14 +70,14 @@ }, "custom/power_btn": { - "format": "", - "on-click": "sh -c '(wlogout --protocol layer-shell)'", + "format": " ", + "on-click": "sh -c '(powermenu)'", "tooltip": false }, "custom/lock_screen": { "format": "", - "on-click": "sh -c '(swaylock)'", + "on-click": "sh -c '(hyprlock)'", "tooltip": false }, @@ -120,10 +120,10 @@ "pulseaudio": { "format": "{icon}", "format-muted": "", - "on-click": "~/.config/utils/waybar/scripts/volume --toggle", + "on-click": "volume --toggle", "on-click-right": "pavucontrol", - "on-scroll-up": "~/.config/utils/waybar/scripts/volume --inc", - "on-scroll-down": "~/.config/utils/waybar/scripts/volume --dec", + "on-scroll-up": "volume --inc", + "on-scroll-down": "volume --dec", "scroll-step": 5, "format-icons": { "headphone": "", @@ -144,10 +144,10 @@ "format": "{format_source}", "format-source": "", "format-source-muted": "", - "on-click": "~/.config/utils/waybar/scripts/volume --toggle-mic", + "on-click": "volume --toggle-mic", "on-click-right": "pavucontrol", - "on-scroll-up": "~/.config/utils/waybar/scripts/volume --mic-inc", - "on-scroll-down": "~/.config/utils/waybar/scripts/volume --mic-dec", + "on-scroll-up": "volume --mic-inc", + "on-scroll-down": "volume --mic-dec", "scroll-step": 5, "format-alt-click": "click-middle", "format-alt": " {volume}%", @@ -161,8 +161,8 @@ "format-alt-click": "click-right", "format-alt": "{icon} {percent}%", "format-icons": ["󰃞", "󰃟", "󰃠"], - "on-scroll-up": "~/.config/utils/waybar/scripts/brightness --inc", - "on-scroll-down": "~/.config/utils/waybar/scripts/brightness --dec" + "on-scroll-up": "brightness --inc", + "on-scroll-down": "brightness --dec" }, "tray": { @@ -181,8 +181,8 @@ "custom/bluetoothcharge": { "format": "{}", "tooltip-format": "{}", - "exec": "~/.config/utils/waybar/scripts/bluetoothcharge", - "on-click": "~/.config/utils/waybar/scripts/bluetoothcharge", + "exec": "bluetoothcharge", + "on-click": "bluetoothcharge", "interval": 60, "tooltip": true }