focus more on qutebrowser

This commit is contained in:
Leonardo Eugênio 2023-01-22 00:10:08 -03:00
parent 783790a2e9
commit c49fa057cc
4 changed files with 28 additions and 7 deletions

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) desktop;
let inherit (import ./variables.nix) desktop browser;
in {
config = {
programs.firefox = {
@ -51,7 +51,7 @@ in {
};
};
};
systemd.user.services = {
systemd.user.services = lib.mkIf (browser == "firefox") {
firefox = {
Unit = {
Description = "Firefox Web client";

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key theme color accent font;
let inherit (import ./variables.nix) browser;
in {
config = {
xdg.desktopEntries = {
@ -66,6 +66,11 @@ in {
// (createMimeAssociations "image" "pqiv.desktop" image_suffixes)
// (createMimeAssociations "video" "mpv.desktop" video_suffixes);
browser_desktop = {
firefox = "firefox.desktop";
qutebrowser = "org.qutebrowser.qutebrowser.desktop";
}.${browser};
simple = {
"text/plain" = "kak.desktop";
"inode/directory" = "thunar.desktop";
@ -73,9 +78,9 @@ in {
"application/pdf" = "org.pwmt.zathura.desktop";
"application/epub+zip" = "org.pwmt.zathura.desktop";
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"text/html" = browser_desktop;
"x-scheme-handler/http" = browser_desktop;
"x-scheme-handler/https" = browser_desktop;
"x-scheme-handler/magnet" = "torrent.desktop";
"application/x-bittorrent" = "torrent.desktop";

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }:
let inherit (pkgs.uservars) key theme color accent font;
let inherit (pkgs.uservars) key theme color accent font browser;
in {
config = {
programs.qutebrowser = {
@ -227,6 +227,21 @@ in {
# config.source("config/config.py")
# '';
};
systemd.user.services = lib.mkIf (browser == "qutebrowser") {
qutebrowser = {
Unit = {
Description = "Qutebrowser Web client";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStartPre = "/usr/bin/env sleep 10s";
ExecStart = "${pkgs.qutebrowser}/bin/qutebrowser";
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
};
home.file = {
# For some stupid reason qutebrowser crashes if this dir does not exist
".local/share/qutebrowser/greasemonkey/.keep".text = "";

View file

@ -124,4 +124,5 @@ in rec {
dmenu = "bmenu";
desktop = "sway";
browser = "qutebrowser";
}