From ff65efd7021cfb982882c6c49d3297eb089ecac0 Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Wed, 4 Jun 2025 16:59:43 +0100 Subject: [PATCH 1/9] switched to fish oh-my-fish/theme-agnoster has issues on nix so i forked it and am working on fixing it, for now i have it in a state where the annoying thing doesnt happen, and this means i have the same functionality actually better because the autocomplete and syntax highlighting is much nicer fish ftw --- home-manager/fish.nix | 35 ++++++++++++++++++++++ home-manager/home.nix | 4 +-- home-manager/hyprland.nix | 2 +- home-manager/zellij.nix | 2 +- home-manager/zsh.nix | 43 ---------------------------- hosts/gabbielaptop/configuration.nix | 20 +++---------- 6 files changed, 43 insertions(+), 63 deletions(-) create mode 100644 home-manager/fish.nix delete mode 100644 home-manager/zsh.nix diff --git a/home-manager/fish.nix b/home-manager/fish.nix new file mode 100644 index 0000000..697a096 --- /dev/null +++ b/home-manager/fish.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: +{ + programs.fish = { + enable = true; + generateCompletions = true; + shellAliases = { + ls = "eza -lh"; + ip = "ip --color=auto"; + nano = "nvim"; + cd = "z"; + cat = "bat"; + + # Aliases for my nixos workflow + nixos-switch = "sudo nixos-rebuild switch --flake ~/nixconf &| nom"; + home-switch = "home-manager switch --flake ~/nixconf &| nom"; + server-switch = "nixos-rebuild switch --flake ~/nixconf#biggerpi --target-host blue@biggerpi --use-remote-sudo &| nom"; + }; + shellInit = " + set --global --export theme_virtual_env_prompt_enabled no + set --global --export VIRTUAL_ENV_DISABLE_PROMPT 1 + set --global --export theme_env_packages_hide binutils-wrapper hyprland-qtutils pciutils pkgconf-wrapper + "; + plugins = [ + { + name = "agnoster"; + src = pkgs.fetchFromGitHub { + owner = "IBeTheBlueCat"; + repo = "theme-agnoster"; + rev = "c6b1e6b5671f75d30d2d81a11963ef445e78d8e6"; + hash = "sha256-hO5ow+7nBqFeXWj8sjd6whuSYqsKYCpvcINU6zpAzsU="; + }; + } + ]; + }; +} diff --git a/home-manager/home.nix b/home-manager/home.nix index 461ba21..25b3b62 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -12,7 +12,7 @@ ./waybar.nix ./swaync.nix ./hyprlock.nix - ./zsh.nix + ./fish.nix ./eza.nix ./nvf.nix ./nextcloud.nix @@ -30,7 +30,7 @@ services.gnome-keyring.enable = true; # used for nextcloud-client home.sessionVariables = { - DEFAULT_BROWSER = "${lib.getExe pkgs.firefox}"; # even though im using floorp this still works, and pkgs.floorp doesnt + DEFAULT_BROWSER = "${lib.getExe pkgs.floorp}"; # Allow XWayland apps to not be weird after turning off xwayland scaling in hyprland.conf GDK_SCALE = 1; XCURSOR_SIZE = 24; diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index 77eb492..d798591 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -65,7 +65,7 @@ "$mod, F, exec, floorp" "$mod, 1, exec, alacritty" "$mod, D, exec, vesktop" - "$mod, space, exec, zsh -c 'wofi --show drun, run'" + "$mod, space, exec, bash -c 'wofi --show drun, run'" # Screenshot tool ", Print, exec, grimblast copy area" diff --git a/home-manager/zellij.nix b/home-manager/zellij.nix index 54978c2..562ed92 100644 --- a/home-manager/zellij.nix +++ b/home-manager/zellij.nix @@ -2,7 +2,7 @@ { programs.zellij = { enable = true; - enableZshIntegration = true; + enableFishIntegration = true; exitShellOnExit = true; attachExistingSession = true; }; diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix deleted file mode 100644 index a8844c6..0000000 --- a/home-manager/zsh.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - pkgs, - ... -}: - -{ - programs.zsh = { - enable = true; - autocd = true; - dotDir = ".config/zsh"; - autosuggestion.enable = true; - enableCompletion = true; - shellAliases = { - ls = "eza -lh"; - ip = "ip --color=auto"; - nano = "nvim"; - cd = "z"; - cat = "bat"; - - # Aliases for my nixos workflow - switch = "sudo nixos-rebuild switch --flake ~/nixconf |& nom"; - homeswitch = "home-manager switch --flake ~/nixconf |& nom"; - serverswitch = "nixos-rebuild switch --flake ~/nixconf#biggerpi --target-host blue@biggerpi --use-remote-sudo |& nom"; - }; - - plugins = with pkgs; [ - { - name = "zsh-syntax-highlighting"; - src = fetchFromGitHub { - owner = "zsh-users"; - repo = "zsh-syntax-highlighting"; - rev = "0.6.0"; - sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4"; - }; - file = "agkozak-zsh-prompt.plugin.zsh"; - } - ]; - oh-my-zsh = { - enable = true; - theme = "agnoster"; - }; - }; -} diff --git a/hosts/gabbielaptop/configuration.nix b/hosts/gabbielaptop/configuration.nix index 35e18ff..3d8dd24 100644 --- a/hosts/gabbielaptop/configuration.nix +++ b/hosts/gabbielaptop/configuration.nix @@ -116,19 +116,6 @@ }; }; - musnix.enable = true; - - # pam.services = [ - # { name = "gnome_keyring" - # text = '' - # auth optional ${gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so - # session optional ${gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so auto_start - # - # password optional ${gnome3.gnome_keyring}/lib/security/pam_gnome_keyring.so - # ''; - # } - # ]; - services.gnome.gnome-keyring.enable = true; nix.settings.trusted-users = [ @@ -136,7 +123,7 @@ "blue" ]; - programs.zsh.enable = true; + programs.fish.enable = true; users.users.blue = { isNormalUser = true; description = "Gabriella Bere"; @@ -146,12 +133,11 @@ "dialout" "audio" ]; - shell = pkgs.zsh; + shell = pkgs.fish; }; # Enable fingerprint daemon services.fprintd.enable = true; - # services.fprintd.tod.enable = true; # Enable bluetooth and blueman hardware.bluetooth = { @@ -178,6 +164,8 @@ programs.steam.remotePlay.openFirewall = true; programs.gamemode.enable = true; + # Enable musnix for realtime audio and other such useful things + musnix.enable = true; # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ 43391 # used to forward minecraft traffic to minecraft.gabbie.blue:33991 From 0e17b48ec5f839d29b014496152fa7238a1a2f9d Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Wed, 4 Jun 2025 17:14:59 +0100 Subject: [PATCH 2/9] added neorg, a norg editor for nvim --- home-manager/nvf.nix | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/home-manager/nvf.nix b/home-manager/nvf.nix index 41c077b..4b2d119 100644 --- a/home-manager/nvf.nix +++ b/home-manager/nvf.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: +{...}: { programs.nvf = { enable = true; @@ -37,21 +34,11 @@ java.enable = true; }; autocomplete.blink-cmp.enable = true; - startPlugins = with pkgs.vimPlugins; [ - vimwiki - ]; - # the following doesnt seem to work, i fear i may have to properly package vimwiki but i dont want to do that right now so i will come back later - # luaConfigRC = '' - # - # -- set vimwiki settings that I want - # set nocompatible - # filetype plugin on - # syntax on - # - # let g:vimwiki_list = [{'path': '~/Notes/', - # \ 'syntax': 'markdown', 'ext': 'md'}] - # let g:vimwiki_global_ext = 0 - # ''; # Required settings for vimwiki + notes.neorg = { + enable = true; + setupOpts.load."core.defaults".enable = true; + treesitter.enable = true; + }; }; }; }; From 5fb7aef1e4b875541bc447d10ecffb5dfa176ffa Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Thu, 5 Jun 2025 11:34:09 +0100 Subject: [PATCH 3/9] configured neorg further --- home-manager/nvf.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/home-manager/nvf.nix b/home-manager/nvf.nix index 4b2d119..d86a97a 100644 --- a/home-manager/nvf.nix +++ b/home-manager/nvf.nix @@ -1,4 +1,4 @@ -{...}: +{ pkgs, ... }: { programs.nvf = { enable = true; @@ -36,8 +36,16 @@ autocomplete.blink-cmp.enable = true; notes.neorg = { enable = true; - setupOpts.load."core.defaults".enable = true; - treesitter.enable = true; + treesitter = { + enable = true; + norgPackage = pkgs.tree-sitter-grammars.tree-sitter-norg; + }; + setupOpts.load = { + "core.defaults".enable = true; + "core.concealer".config = { + conceallevel = 3; + }; + }; }; }; }; From 8beaa41bfee1735e20ac5e7a414374c73d4671d2 Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Thu, 5 Jun 2025 11:35:40 +0100 Subject: [PATCH 4/9] switched from grimblast to hyprshot --- home-manager/hyprland.nix | 3 +-- home-manager/packages.nix | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index d798591..05bec6e 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -68,8 +68,7 @@ "$mod, space, exec, bash -c 'wofi --show drun, run'" # Screenshot tool - ", Print, exec, grimblast copy area" - "SHIFT, Print, exec, grimblast save area" + ", Print, exec, hyprshot -m region" # Screen locking tool "$mod, l, exec, hyprlock" diff --git a/home-manager/packages.nix b/home-manager/packages.nix index 457610f..deb8d42 100644 --- a/home-manager/packages.nix +++ b/home-manager/packages.nix @@ -2,7 +2,7 @@ { # packages that i dont need to use a module for home.packages = with pkgs; [ - grimblast # Screenshot tool + hyprshot # Screenshot tool powerline-fonts # Fonts nix-output-monitor # Provides a dependency graph for nix builds bitwarden-desktop # Integrates with bitwarden extension From 2fbd6a05a47e89ad337068788610dcf306b2c8d2 Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Sat, 7 Jun 2025 19:31:25 +0100 Subject: [PATCH 5/9] set default browser to floorp using xdg-mime --- home-manager/home.nix | 11 +++++++++++ home-manager/hyprland.nix | 2 +- home-manager/packages.nix | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/home-manager/home.nix b/home-manager/home.nix index 25b3b62..d26ccc4 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -40,6 +40,17 @@ LD_LIBRARY_PATH = "${pkgs.libGL}/lib:${pkgs.gtk3}/lib:${pkgs.glib.out}/lib:${pkgs.xorg.libXtst}/lib"; }; + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = "floorp.desktop"; + "x-scheme-handler/http" = "floorp.desktop"; + "x-scheme-handler/https" = "floorp.desktop"; + "x-scheme-handler/about" = "floorp.desktop"; + "x-scheme-handler/unknown" = "floorp.desktop"; + }; + }; + # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index 05bec6e..0066068 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -30,7 +30,7 @@ follow_mouse = 1; mouse_refocus = false; touchpad = { - disable_while_typing = true; + disable_while_typing = false; }; }; gestures = { diff --git a/home-manager/packages.nix b/home-manager/packages.nix index deb8d42..913970e 100644 --- a/home-manager/packages.nix +++ b/home-manager/packages.nix @@ -34,7 +34,8 @@ tenacity # small DAW davinci-resolve # video editor libreoffice # office suite - + zoom-us # proprietary meeting app + # Audio Plugins calf zam-plugins From 7acd9dd34d1019b58b8add9b7c9ac05d9b97d1de Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Sun, 8 Jun 2025 03:33:59 +0100 Subject: [PATCH 6/9] renamed firefox.nix to floorp.nix --- home-manager/{firefox.nix => floorp.nix} | 0 home-manager/home.nix | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename home-manager/{firefox.nix => floorp.nix} (100%) diff --git a/home-manager/firefox.nix b/home-manager/floorp.nix similarity index 100% rename from home-manager/firefox.nix rename to home-manager/floorp.nix diff --git a/home-manager/home.nix b/home-manager/home.nix index d26ccc4..18c9f49 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -19,7 +19,7 @@ ./git.nix ./stylix.nix ./direnv.nix - ./firefox.nix + ./floorp.nix ./zellij.nix ./obs-studio.nix ./packages.nix From 452c3708d63c805270b673202cbf3cab341d8231 Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Sun, 8 Jun 2025 03:37:42 +0100 Subject: [PATCH 7/9] disabled fish greeting --- home-manager/fish.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/home-manager/fish.nix b/home-manager/fish.nix index 697a096..08d5557 100644 --- a/home-manager/fish.nix +++ b/home-manager/fish.nix @@ -16,9 +16,10 @@ server-switch = "nixos-rebuild switch --flake ~/nixconf#biggerpi --target-host blue@biggerpi --use-remote-sudo &| nom"; }; shellInit = " - set --global --export theme_virtual_env_prompt_enabled no - set --global --export VIRTUAL_ENV_DISABLE_PROMPT 1 - set --global --export theme_env_packages_hide binutils-wrapper hyprland-qtutils pciutils pkgconf-wrapper + set --global theme_virtual_env_prompt_enabled no + set --global VIRTUAL_ENV_DISABLE_PROMPT 1 + set --global theme_env_packages_hide binutils-wrapper hyprland-qtutils pciutils pkgconf-wrapper + set --erase fish_greeting "; plugins = [ { From 98ea496a196a5e9f0ebab300f41006128f6592d2 Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Sun, 8 Jun 2025 03:40:46 +0100 Subject: [PATCH 8/9] actually turned off fish greeting this time setting it to an empty string instead of using --erase worked --- home-manager/fish.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-manager/fish.nix b/home-manager/fish.nix index 08d5557..f086f1b 100644 --- a/home-manager/fish.nix +++ b/home-manager/fish.nix @@ -19,7 +19,7 @@ set --global theme_virtual_env_prompt_enabled no set --global VIRTUAL_ENV_DISABLE_PROMPT 1 set --global theme_env_packages_hide binutils-wrapper hyprland-qtutils pciutils pkgconf-wrapper - set --erase fish_greeting + set fish_greeting \"\" "; plugins = [ { From 772518df4f93f26b8d20b44c13465fa352ef5353 Mon Sep 17 00:00:00 2001 From: Gabriella Bere Date: Sun, 8 Jun 2025 05:17:39 +0100 Subject: [PATCH 9/9] attempted to add a keybind to toggle touchpad somehow i cant get the script to run when i use the touchpad, but hey, its in the repo now and the licence has been updated so i can get around to it later also i removed the default fish greeting it was annoying me --- LICENCE | 38 ++++++++++++++++ home-manager/fish.nix | 1 + home-manager/home.nix | 1 + home-manager/hyprland.nix | 7 ++- home-manager/packages.nix | 1 + scripts/hyprland/touchpad_toggle.sh | 70 +++++++++++++++++++++++++++++ 6 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 scripts/hyprland/touchpad_toggle.sh diff --git a/LICENCE b/LICENCE index e87ca7c..2dc3454 100644 --- a/LICENCE +++ b/LICENCE @@ -1,3 +1,40 @@ +Copyright for portions of this repository are held by Diana, 2024 as part of the files available at https://github.com/dianaw353/dotfiles and are provided under the BSD license. See the below lincences for details. +All other copyright for project Foo are held by Gabriella Bere, 2024. + +Licenses are specified as follows: + +file: +licence of file + + +./scripts/hyprland/touchpad_toggle.sh: +BSD 2-Clause License + +Copyright (c) 2024, Diana + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Everything else in this repo: MIT License Copyright (c) 2024 Gabriella Bere @@ -7,3 +44,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/home-manager/fish.nix b/home-manager/fish.nix index f086f1b..ba62530 100644 --- a/home-manager/fish.nix +++ b/home-manager/fish.nix @@ -14,6 +14,7 @@ nixos-switch = "sudo nixos-rebuild switch --flake ~/nixconf &| nom"; home-switch = "home-manager switch --flake ~/nixconf &| nom"; server-switch = "nixos-rebuild switch --flake ~/nixconf#biggerpi --target-host blue@biggerpi --use-remote-sudo &| nom"; + home-manager-news = "home-manager news --flake ~/nixconf"; }; shellInit = " set --global theme_virtual_env_prompt_enabled no diff --git a/home-manager/home.nix b/home-manager/home.nix index 18c9f49..49e61de 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -38,6 +38,7 @@ EDITOR = "nvim"; NIXOS_OZONE_WL = 1; LD_LIBRARY_PATH = "${pkgs.libGL}/lib:${pkgs.gtk3}/lib:${pkgs.glib.out}/lib:${pkgs.xorg.libXtst}/lib"; + scripts = "/home/blue/nixconf/scripts"; }; xdg.mimeApps = { diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index 0066068..3065b71 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -7,7 +7,7 @@ systemd.variables = [ "--all" ]; settings = { misc = { - enable_anr_dialog = false; + enable_anr_dialog = false; # disable application not repsonding dialog as it tends to just get in the way when trying to fix the unresponsive application }; # Monitor config for home desk layout monitor = [ @@ -30,7 +30,7 @@ follow_mouse = 1; mouse_refocus = false; touchpad = { - disable_while_typing = false; + disable_while_typing = true; }; }; gestures = { @@ -67,6 +67,9 @@ "$mod, D, exec, vesktop" "$mod, space, exec, bash -c 'wofi --show drun, run'" + # Keybind for toggling touchpad + "$mod, j, exec, sh $scripts/hyprland/touchpad_toggle.sh" + # Screenshot tool ", Print, exec, hyprshot -m region" diff --git a/home-manager/packages.nix b/home-manager/packages.nix index 913970e..5ebe093 100644 --- a/home-manager/packages.nix +++ b/home-manager/packages.nix @@ -35,6 +35,7 @@ davinci-resolve # video editor libreoffice # office suite zoom-us # proprietary meeting app + libnotify # notification server useful in scripting # Audio Plugins calf diff --git a/scripts/hyprland/touchpad_toggle.sh b/scripts/hyprland/touchpad_toggle.sh new file mode 100644 index 0000000..6697c47 --- /dev/null +++ b/scripts/hyprland/touchpad_toggle.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# +# Script to toggle a given device. +# Use the following command to choose what device you want to toggle: +# hyprctl devices +# +# Courtesy of r/hyprland Reddit community: +# https://reddit.com/r/hyprland/comments/11kr8bl/hotkey_disable_touchpad/ +# https://reddit.com/r/hyprland/comments/1bqohmd/dynamically_enabledisable_device/ +# +# Ported, generalized, improved and overengineered by Bahar Kurt for +# Diana's dotfiles. +# + +# HACK: Try to set a nonexistent config under "device:" so that +# Hyprland refreshes all properties inside. +hyprctl keyword device:a true > /dev/null 2>&1 + +# Set device to be toggled +export HYPRLAND_DEVICE="$(hyprctl devices | grep touchpad | sed '/2-synaptics-touchpad/d; s/.* //')" +export HYPRLAND_VARIABLE="device[${HYPRLAND_DEVICE}]:enabled" + +if [ -z "$XDG_RUNTIME_DIR" ]; then + export XDG_RUNTIME_DIR=/run/user/$(id -u) +fi + +# Check if device is currently enabled +export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status" + +# Try to get the touchpad status from status file. +if [ -f "$STATUS_FILE" ]; then + export TOUCHPAD_ENABLED="$(cat "$STATUS_FILE")" +fi + +# Toggle the touchpad +if [ "$TOUCHPAD_ENABLED" != "false" ]; then + # The touchpad is known to be, or assumed to be, enabled (not disabled). + export PREVIOUS_STATUS="true" + export TOUCHPAD_ENABLED="false" + # Try to disable the touchpad. If it fails, set the new status to enabled. + hyprctl --batch -r -- keyword "$HYPRLAND_VARIABLE" $TOUCHPAD_ENABLED || export TOUCHPAD_ENABLED="true" +else + # The touchpad is known to be disabled. + export PREVIOUS_STATUS="false" + export TOUCHPAD_ENABLED="true" + # Try to enable the touchpad. If it fails, set the new status to disabled. + hyprctl --batch -r -- keyword "$HYPRLAND_VARIABLE" $TOUCHPAD_ENABLED || export TOUCHPAD_ENABLED="false" +fi + +# Write the new touchpad status into the status file. +echo "$TOUCHPAD_ENABLED" > "$STATUS_FILE" + +# Generate the notification message. +export NOTIFMSG="Touchpad " + +if [ "$TOUCHPAD_ENABLED" == "$PREVIOUS_STATUS" ]; then + export NOTIFMSG+="could not be " + # Touchpad could not be... +fi + +if [ "$PREVIOUS_STATUS" == "true" ]; then + export NOTIFMSG+="disabled." + # Touchpad (could not be) disabled. +else + export NOTIFMSG+="enabled." + # Touchpad (could not be) enabled. +fi + +notify-send -u normal "$NOTIFMSG"