arch/roles/dots/files/home/bin/firefox_profiles.sh
2025-02-18 01:36:51 +06:00

28 lines
957 B
Bash
Executable File

#!/bin/bash
# Путь к файлу profiles.ini
PROFILES_INI="$HOME/.mozilla/firefox/profiles.ini"
# if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
if [ "$XDG_SESSION_TYPE" == "no" ]; then
# while read -r line; do export "$line"; done < /home/fs/scale_vars
profiles_ini="$HOME/.mozilla/firefox/profiles.ini"
profiles=$(grep '\[Profile' -A 2 "$profiles_ini" | grep 'Name=' | cut -d '=' -f 2)
selected_profile=$(echo "$profiles" | wofi --dmenu --prompt "Choose Firefox Profile:")
if [ ! "$selected_profile" = "" ]; then
firefox -P "$selected_profile";
fi
else
while read -r line; do export "$line"; done < /home/fs/scale_vars
dpi="100"
# profile=$(grep '\[Profile' -A 2 "$PROFILES_INI" | grep "Name=" | sed 's/Name=//' | rofi -dmenu -dpi $dpi)
profile=$(grep '\[Profile' -A 2 "$PROFILES_INI" | grep "Name=" | sed 's/Name=//' | dmenu -l 15)
if [ ! "$profile" = "" ]; then
firefox -P "$profile";
fi
fi