mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 10:30:44 +02:00
librewolf profiles selector: added tor-browser
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
chromium # used only to flash the firmware on my framework laptop 16 (keyboard.frame.work) as only chromium based browser support webHID.
|
chromium # used only to flash the firmware on my framework laptop 16 (keyboard.frame.work) as only chromium based browser support webHID.
|
||||||
pkgs-unstable.tor-browser
|
pkgs-unstable.tor-browser
|
||||||
self.packages.${pkgs.system}.custom-librewolfprofiles
|
self.packages.${pkgs.system}.custom-browserprofiles
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
flake.homeModules.librewolf = _: {
|
flake.homeModules.librewolf = _: {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
"$editor" = "nvim";
|
"$editor" = "nvim";
|
||||||
"$notes" = "kitty --class \"custom-obsidianvaults\" --name \"Select Obsidian vault\" --hold custom-obsidianvaults";
|
"$notes" = "kitty --class \"custom-obsidianvaults\" --name \"Select Obsidian vault\" --hold custom-obsidianvaults";
|
||||||
"$file" = "dolphin";
|
"$file" = "dolphin";
|
||||||
"$browser" = "kitty --class \"custom-librewolfprofiles\" --name \"Select LibreWolf profile\" --hold custom-librewolfprofiles";
|
"$browser" = "kitty --class \"custom-browserprofiles\" --name \"Select browser profile\" --hold custom-browserprofiles";
|
||||||
# ▄▀█ █▄░█ █ █▀▄▀█ ▄▀█ ▀█▀ █ █▀█ █▄░█
|
# ▄▀█ █▄░█ █ █▀▄▀█ ▄▀█ ▀█▀ █ █▀█ █▄░█
|
||||||
# █▀█ █░▀█ █ █░▀░█ █▀█ ░█░ █ █▄█ █░▀█
|
# █▀█ █░▀█ █ █░▀░█ █▀█ ░█░ █ █▄█ █░▀█
|
||||||
animations = {
|
animations = {
|
||||||
@@ -487,7 +487,7 @@
|
|||||||
"float on, match:class ^(kitty)$, match:title ^(htop)$"
|
"float on, match:class ^(kitty)$, match:title ^(htop)$"
|
||||||
"float on, match:class ^(vlc)$"
|
"float on, match:class ^(vlc)$"
|
||||||
"float on, match:class ^(eog)$"
|
"float on, match:class ^(eog)$"
|
||||||
"float on, size 400 225, match:class ^(custom-librewolfprofiles)$"
|
"float on, size 400 225, match:class ^(custom-browserprofiles)$"
|
||||||
"float on, size 1050 200, match:class ^(custom-changeAudioOutput)$"
|
"float on, size 1050 200, match:class ^(custom-changeAudioOutput)$"
|
||||||
"float on, size 400 175, match:class ^(custom-obsidianvaults)$"
|
"float on, size 400 175, match:class ^(custom-obsidianvaults)$"
|
||||||
"float on, size 600 600, match:initial_class ^(custom-pomodoro)$"
|
"float on, size 600 600, match:initial_class ^(custom-pomodoro)$"
|
||||||
|
|||||||
+9
-6
@@ -1,18 +1,19 @@
|
|||||||
_: {
|
_: {
|
||||||
perSystem = {pkgs, ...}: {
|
perSystem = {pkgs, ...}: {
|
||||||
# fzf librewolf profile selector
|
# fzf librewolf profile selector
|
||||||
packages.custom-librewolfprofiles = pkgs.writeShellApplication {
|
packages.custom-browserprofiles = pkgs.writeShellApplication {
|
||||||
name = "custom-librewolfprofiles";
|
name = "custom-browserprofiles";
|
||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
zsh
|
zsh
|
||||||
fzf
|
fzf
|
||||||
|
tor-browser
|
||||||
];
|
];
|
||||||
text = ''
|
text = ''
|
||||||
# List of profiles
|
# List of profiles
|
||||||
profiles=("work" "other" "private window")
|
profiles=("work" "other" "private window" "tor-browser)
|
||||||
|
|
||||||
# Use fzf to select
|
# 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
|
# If user cancels, exit
|
||||||
[[ -z "$selected" ]] && exit 0
|
[[ -z "$selected" ]] && exit 0
|
||||||
@@ -20,10 +21,12 @@ _: {
|
|||||||
# Launch LibreWolf detached, keeping environment
|
# Launch LibreWolf detached, keeping environment
|
||||||
if [[ "$selected" == "private window" ]]; then
|
if [[ "$selected" == "private window" ]]; then
|
||||||
setsid librewolf --private-window --no-remote >/dev/null 2>&1 &
|
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
|
else
|
||||||
setsid librewolf -P "$selected" --no-remote >/dev/null 2>&1 &
|
setsid librewolf -P "$selected" --no-remote >/dev/null 2>&1 &
|
||||||
pkill -f "kitty.*Select LibreWolf profile"
|
pkill -f "kitty.*Select browser profile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Exit the kitty terminal after selection
|
# Exit the kitty terminal after selection
|
||||||
Reference in New Issue
Block a user