fix: reuse betterbird profile
This commit is contained in:
parent
8e225f5d82
commit
7da82701df
3 changed files with 74 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
{ ... }:
|
{ homeLib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
dconf.settings = {
|
dconf.settings = {
|
||||||
|
|
@ -40,6 +40,29 @@
|
||||||
noDisplay = true;
|
noDisplay = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.desktopEntries.betterbird = {
|
||||||
|
name = "Betterbird";
|
||||||
|
comment = "Mail, RSS and newsgroups client";
|
||||||
|
exec = "${homeLib.betterbirdLauncher}/bin/betterbird-profile %u";
|
||||||
|
icon = "betterbird";
|
||||||
|
terminal = false;
|
||||||
|
type = "Application";
|
||||||
|
categories = [
|
||||||
|
"Network"
|
||||||
|
"Email"
|
||||||
|
];
|
||||||
|
mimeType = [
|
||||||
|
"x-scheme-handler/mailto"
|
||||||
|
"message/rfc822"
|
||||||
|
"x-scheme-handler/webcal"
|
||||||
|
"x-scheme-handler/webcals"
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
StartupNotify = "false";
|
||||||
|
StartupWMClass = "eu.betterbird.Betterbird";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultApplications = {
|
defaultApplications = {
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,52 @@ let
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [ "x86_64-linux" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
betterbirdLauncher = pkgs.writeShellApplication {
|
||||||
|
name = "betterbird-profile";
|
||||||
|
runtimeInputs = [
|
||||||
|
pkgs.coreutils
|
||||||
|
pkgs.gawk
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
profile_root="''${HOME:-${config.home.homeDirectory}}/.thunderbird"
|
||||||
|
profile_link="$profile_root/betterbird-current"
|
||||||
|
profile=""
|
||||||
|
|
||||||
|
if [ -d "$profile_root" ]; then
|
||||||
|
for lock in "$profile_root"/*/.parentlock; do
|
||||||
|
if [ -e "$lock" ]; then
|
||||||
|
profile="''${lock%/.parentlock}"
|
||||||
|
ln -sfn "$profile" "$profile_link"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$profile" ] && [ -e "$profile_link" ]; then
|
||||||
|
profile="$(readlink -f "$profile_link")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$profile" ] && [ -f "$profile_root/profiles.ini" ]; then
|
||||||
|
install_default="$(awk '
|
||||||
|
/^\[Install/ { in_install = 1; next }
|
||||||
|
/^\[/ { in_install = 0 }
|
||||||
|
in_install && /^Default=/ { sub(/^Default=/, ""); print; exit }
|
||||||
|
' "$profile_root/profiles.ini")"
|
||||||
|
if [ -n "$install_default" ] && [ -d "$profile_root/$install_default" ]; then
|
||||||
|
profile="$profile_root/$install_default"
|
||||||
|
ln -sfn "$profile" "$profile_link"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$profile" ] && [ -d "$profile" ]; then
|
||||||
|
exec ${betterbird}/bin/betterbird --profile "$profile" "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec ${betterbird}/bin/betterbird "$@"
|
||||||
|
'';
|
||||||
|
};
|
||||||
nasaApodWallpaper = pkgs.writeShellApplication {
|
nasaApodWallpaper = pkgs.writeShellApplication {
|
||||||
name = "nasa-apod-wallpaper";
|
name = "nasa-apod-wallpaper";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
|
|
@ -385,7 +431,7 @@ let
|
||||||
name = "betterbird-startup";
|
name = "betterbird-startup";
|
||||||
desktopName = "Betterbird Startup";
|
desktopName = "Betterbird Startup";
|
||||||
comment = "Launch Betterbird in fullscreen";
|
comment = "Launch Betterbird in fullscreen";
|
||||||
exec = "${betterbird}/bin/betterbird";
|
exec = "${betterbirdLauncher}/bin/betterbird-profile";
|
||||||
terminal = false;
|
terminal = false;
|
||||||
noDisplay = true;
|
noDisplay = true;
|
||||||
categories = [ "Network" ];
|
categories = [ "Network" ];
|
||||||
|
|
@ -405,6 +451,7 @@ in
|
||||||
inherit
|
inherit
|
||||||
betterbirdStartup
|
betterbirdStartup
|
||||||
betterbird
|
betterbird
|
||||||
|
betterbirdLauncher
|
||||||
email
|
email
|
||||||
ghosttyZellijStartup
|
ghosttyZellijStartup
|
||||||
greptileSkills
|
greptileSkills
|
||||||
|
|
|
||||||
|
|
@ -50,13 +50,13 @@ let
|
||||||
"${config.programs.zen-browser.package}/bin/zen-beta"
|
"${config.programs.zen-browser.package}/bin/zen-beta"
|
||||||
"${pkgs.ghostty}/bin/ghostty --fullscreen=true -e ${homeLib.zellijPersistentSession}/bin/zellij-persistent-session"
|
"${pkgs.ghostty}/bin/ghostty --fullscreen=true -e ${homeLib.zellijPersistentSession}/bin/zellij-persistent-session"
|
||||||
"${pkgs.slack}/bin/slack"
|
"${pkgs.slack}/bin/slack"
|
||||||
"${homeLib.betterbird}/bin/betterbird"
|
"${homeLib.betterbirdLauncher}/bin/betterbird-profile"
|
||||||
];
|
];
|
||||||
personalStartup = [
|
personalStartup = [
|
||||||
"${config.programs.zen-browser.package}/bin/zen-beta"
|
"${config.programs.zen-browser.package}/bin/zen-beta"
|
||||||
"${pkgs.ghostty}/bin/ghostty --fullscreen=true -e ${homeLib.zellijPersistentSession}/bin/zellij-persistent-session"
|
"${pkgs.ghostty}/bin/ghostty --fullscreen=true -e ${homeLib.zellijPersistentSession}/bin/zellij-persistent-session"
|
||||||
"${pkgs.vesktop}/bin/vesktop --start-fullscreen"
|
"${pkgs.vesktop}/bin/vesktop --start-fullscreen"
|
||||||
"${homeLib.betterbird}/bin/betterbird"
|
"${homeLib.betterbirdLauncher}/bin/betterbird-profile"
|
||||||
"${pkgs.signal-desktop}/bin/signal-desktop --start-fullscreen"
|
"${pkgs.signal-desktop}/bin/signal-desktop --start-fullscreen"
|
||||||
"${pkgs.zulip}/bin/zulip --start-fullscreen"
|
"${pkgs.zulip}/bin/zulip --start-fullscreen"
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue