From 8576abd055164359b59612531cd20371d44941ff Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 1 May 2025 09:31:11 -0500 Subject: [PATCH] gah --- home/home.nix | 6 +++--- scripts/fflof | 40 ++-------------------------------------- scripts/fflof.bak | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 41 deletions(-) create mode 100755 scripts/fflof.bak diff --git a/home/home.nix b/home/home.nix index bd742ac..ac84833 100644 --- a/home/home.nix +++ b/home/home.nix @@ -634,9 +634,9 @@ in { recursive = true; }; - home.file.".librewolf/native-messaging-hosts/tridactyl.json" = { - source = pkgs.tridactyl-native - }; + # home.file.".librewolf/native-messaging-hosts/tridactyl.json" = { + # source = pkgs.tridactyl-native; + # }; programs.librewolf = { enable = true; diff --git a/scripts/fflof b/scripts/fflof index f3ae5bc..4c772b3 100755 --- a/scripts/fflof +++ b/scripts/fflof @@ -1,39 +1,3 @@ -#!/usr/bin/env bash -export MOZ_ENABLE_WAYLAND=1 -echo $MOZ_ENABLE_WAYLAND +#!/usr/bin/env nu -# Check to see if librewolf is running -if [ $(pgrep -c librewolf) -gt 0 ]; then - echo "ff running" - - if [ "$XDG_SESSION_TYPE" = "x11" ]; then - #X11 - ffrg=$(wmctrl -lx | rg librewolf | awk '{print $1}') - # echo $emacsrg - - if [ -z $ffrg ]; then - exec librewolf - exit - else - exec wmctrl -ia $ffrg - exit - fi - else - if [ "$KDE_FULL_SESSION" = "true" ]; then - echo "KDE" - exec /home/chris/bin/ww -fa librewolf -c librewolf - exit - else - # WAYLAND - ffrg=$(hyprctl clients | rg ff) - - ffwin=$(echo $ffrg | sed 's/.*\: //') - # echo $ffwin - - exec hyprctl dispatch focuswindow "class:lw" - exit - fi - fi -else - exec librewolf --name "lw" -fi +if (hyprctl clients -j | from json | where initialTitle == LibreWolf | is-not-empty) { hyprctl dispatch focuswindow "initialtitle:LibreWolf" } else { librewolf --name "lw" } diff --git a/scripts/fflof.bak b/scripts/fflof.bak new file mode 100755 index 0000000..f3ae5bc --- /dev/null +++ b/scripts/fflof.bak @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +export MOZ_ENABLE_WAYLAND=1 +echo $MOZ_ENABLE_WAYLAND + +# Check to see if librewolf is running +if [ $(pgrep -c librewolf) -gt 0 ]; then + echo "ff running" + + if [ "$XDG_SESSION_TYPE" = "x11" ]; then + #X11 + ffrg=$(wmctrl -lx | rg librewolf | awk '{print $1}') + # echo $emacsrg + + if [ -z $ffrg ]; then + exec librewolf + exit + else + exec wmctrl -ia $ffrg + exit + fi + else + if [ "$KDE_FULL_SESSION" = "true" ]; then + echo "KDE" + exec /home/chris/bin/ww -fa librewolf -c librewolf + exit + else + # WAYLAND + ffrg=$(hyprctl clients | rg ff) + + ffwin=$(echo $ffrg | sed 's/.*\: //') + # echo $ffwin + + exec hyprctl dispatch focuswindow "class:lw" + exit + fi + fi +else + exec librewolf --name "lw" +fi