Initial commit
This commit is contained in:
77
modules/hm/vivaldi.nix
Normal file
77
modules/hm/vivaldi.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
let
|
||||
conf = config.programs.vivaldi;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf conf.enable {
|
||||
home.file.vivaldiKDEScript = {
|
||||
target = ".local/bin/vivaldi-kde.sh";
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
vivaldi --profile-directory=$(qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName $(qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity)) "$@"
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
|
||||
programs.vivaldi = {
|
||||
nativeMessagingHosts =
|
||||
[ ]
|
||||
++ lib.optionals (osConfig.services.desktopManager.plasma6.enable) [
|
||||
pkgs.kdePackages.plasma-browser-integration
|
||||
];
|
||||
};
|
||||
|
||||
xdg.desktopEntries = {
|
||||
vivaldi-stable-kde = {
|
||||
name = "Vivaldi-KDE";
|
||||
settings = {
|
||||
OnlyShowIn = "KDE";
|
||||
};
|
||||
genericName = "Web Browser for KDE";
|
||||
exec = "${config.home.file.vivaldiKDEScript.source} %U";
|
||||
terminal = false;
|
||||
actions = {
|
||||
"newPrivateWindow" = {
|
||||
name = "New Private Window";
|
||||
exec = "${config.home.file.vivaldiKDEScript.source} --incognito --remote";
|
||||
};
|
||||
"newWindow" = {
|
||||
name = "New Window";
|
||||
exec = "${config.home.file.vivaldiKDEScript.source} --new-window";
|
||||
};
|
||||
};
|
||||
icon = "vivaldi";
|
||||
startupNotify = true;
|
||||
categories = [
|
||||
"Application"
|
||||
"Network"
|
||||
"WebBrowser"
|
||||
];
|
||||
mimeType = [
|
||||
"application/pdf"
|
||||
"application/rdf+xml"
|
||||
"application/rss+xml"
|
||||
"application/xhtml+xml"
|
||||
"application/xhtml_xml"
|
||||
"application/xml"
|
||||
"image/gif"
|
||||
"image/jpeg"
|
||||
"image/png"
|
||||
"image/webp"
|
||||
"text/html"
|
||||
"text/xml"
|
||||
"x-scheme-handler/ftp"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
"x-scheme-handler/mailto"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user