librewolf profiles selector: added tor-browser

This commit is contained in:
2026-06-08 22:13:00 +02:00
parent eaa0698bc0
commit e42b1f9725
3 changed files with 12 additions and 9 deletions
@@ -1,18 +1,19 @@
_: {
perSystem = {pkgs, ...}: {
# fzf librewolf profile selector
packages.custom-librewolfprofiles = pkgs.writeShellApplication {
name = "custom-librewolfprofiles";
packages.custom-browserprofiles = pkgs.writeShellApplication {
name = "custom-browserprofiles";
runtimeInputs = with pkgs; [
zsh
fzf
tor-browser
];
text = ''
# List of profiles
profiles=("work" "other" "private window")
profiles=("work" "other" "private window" "tor-browser)
# Use fzf to select
selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select LibreWolf profile:")
selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select browser profile:")
# If user cancels, exit
[[ -z "$selected" ]] && exit 0
@@ -20,10 +21,12 @@ _: {
# Launch LibreWolf detached, keeping environment
if [[ "$selected" == "private window" ]]; then
setsid librewolf --private-window --no-remote >/dev/null 2>&1 &
pkill -f "kitty.*Select LibreWolf profile"
pkill -f "kitty.*Select browser profile"
elif [[ "$selected" == "tor-browser" ]]; then
setsid tor-browser >/dev/null 2>&1 & pkill -f "kitty.*Select browser profile"
else
setsid librewolf -P "$selected" --no-remote >/dev/null 2>&1 &
pkill -f "kitty.*Select LibreWolf profile"
pkill -f "kitty.*Select browser profile"
fi
# Exit the kitty terminal after selection