Better default app abstractions into hyprland conf

This commit is contained in:
Emmet 2023-08-13 20:57:11 -05:00
parent e0c265ecc6
commit 9e68d26497
4 changed files with 25 additions and 56 deletions

View file

@ -17,7 +17,8 @@
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
theme = "ayu-dark"; # selcted theme from my themes directory (./themes/) theme = "ayu-dark"; # selcted theme from my themes directory (./themes/)
wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/ wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/
browser = "librewolf-wayland"; # Default browser; must select one from ./user/app/browser/ wmType = "wayland"; # x11 or wayland
browser = "librewolf"; # Default browser; must select one from ./user/app/browser/
editor = "emacsclient"; # Default editor; editor = "emacsclient"; # Default editor;
term = "alacritty"; # Default terminal command; term = "alacritty"; # Default terminal command;
font = "Inconsolata"; # Selected font font = "Inconsolata"; # Selected font
@ -56,6 +57,7 @@
inherit font; inherit font;
inherit fontPkg; inherit fontPkg;
inherit wm; inherit wm;
inherit wmType;
inherit browser; inherit browser;
inherit editor; inherit editor;
inherit term; inherit term;

View file

@ -1,42 +0,0 @@
{ config, lib, pkgs, ... }:
{
# Module installing librewolf as default browser
home.packages = [ pkgs.librewolf-wayland ];
home.file.".librewolf/librewolf.overrides.cfg".text = ''
defaultPref("font.name.serif.x-western","Inconsolata");
defaultPref("font.size.variable.x-western",20);
defaultPref("browser.toolbars.bookmarks.visibility","always");
defaultPref("privacy.resisttFingerprinting.letterboxing", true);
defaultPref("network.http.referer.XOriginPolicy",2);
defaultPref("privacy.clearOnShutdown.history",true);
defaultPref("privacy.clearOnShutdown.downloads",true);
defaultPref("privacy.clearOnShutdown.cookies",true);
defaultPref("gfx.webrender.software.opengl",false);
defaultPref("webgl.disabled",true);
pref("font.name.serif.x-western","Inconsolata");
pref("font.size.variable.x-western",20);
pref("browser.toolbars.bookmarks.visibility","always");
pref("privacy.resisttFingerprinting.letterboxing", true);
pref("network.http.referer.XOriginPolicy",2);
pref("privacy.clearOnShutdown.history",true);
pref("privacy.clearOnShutdown.downloads",true);
pref("privacy.clearOnShutdown.cookies",true);
pref("gfx.webrender.software.opengl",false);
pref("webgl.disabled",true);
'';
xdg.mimeApps.defaultApplications = {
"text/html" = "librewolf.desktop";
"x-scheme-handler/http" = "librewolf.desktop";
"x-scheme-handler/https" = "librewolf.desktop";
"x-scheme-handler/about" = "librewolf.desktop";
"x-scheme-handler/unknown" = "librewolf.desktop";
};
home.sessionVariables = {
DEFAULT_BROWSER = "${pkgs.librewolf-wayland}/bin/librewolf";
};
}

View file

@ -1,8 +1,14 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, wmType, ... }:
{ {
# Module installing librewolf as default browser # Module installing librewolf as default browser
home.packages = [ pkgs.librewolf ]; home.packages = if (wmType == "wayland") then [ pkgs.librewolf-wayland ]
else [ pkgs.librewolf ];
home.sessionVariables = if (wmType == "wayland")
then { DEFAULT_BROWSER = "${pkgs.librewolf-wayland}/bin/librewolf";}
else
{ DEFAULT_BROWSER = "${pkgs.librewolf}/bin/librewolf";};
home.file.".librewolf/librewolf.overrides.cfg".text = '' home.file.".librewolf/librewolf.overrides.cfg".text = ''
defaultPref("font.name.serif.x-western","Inconsolata"); defaultPref("font.name.serif.x-western","Inconsolata");
@ -35,8 +41,4 @@
"x-scheme-handler/unknown" = "librewolf.desktop"; "x-scheme-handler/unknown" = "librewolf.desktop";
}; };
home.sessionVariables = {
DEFAULT_BROWSER = "${pkgs.librewolf}/bin/librewolf";
};
} }

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, browser, term, spawnEditor, fetchFromGitHub, ... }:
{ {
imports = [ imports = [
@ -19,15 +19,21 @@
exec-once = gnome-keyring-daemon --daemonize --login exec-once = gnome-keyring-daemon --daemonize --login
exec-once = gnome-keyring-daemon --start --components=secrets exec-once = gnome-keyring-daemon --start --components=secrets
exec = ~/.swaybg-stylix
general { general {
layout = master layout = master
} }
bind=SUPER,SPACE,fullscreen,1 bind=SUPER,SPACE,fullscreen,1
bind=ALT,TAB,cyclenext bind=ALT,TAB,cyclenext
bind=ALTSHIFT,TAB,cyclenext,prev bind=ALTSHIFT,TAB,cyclenext,prev
bind=SUPER,RETURN,exec,alacritty
bind=SUPER,A,exec,emacs bind=SUPER,RETURN,exec,''+term+''
bind=SUPER,S,exec,librewolf
bind=SUPER,A,exec,''+spawnEditor+''
bind=SUPER,S,exec,''+browser+''
bind=SUPER,code:47,exec,fuzzel bind=SUPER,code:47,exec,fuzzel
bind=SUPER,Q,killactive bind=SUPER,Q,killactive
bind=SUPERSHIFT,Q,exit bind=SUPERSHIFT,Q,exit
@ -79,14 +85,14 @@
windowrulev2 = workspace special silent,$scratchpad windowrulev2 = workspace special silent,$scratchpad
windowrulev2 = center,$scratchpad windowrulev2 = center,$scratchpad
$gearyscratchpad = class:^(geary)$ $gearyscratchpad = class:^(geary)$
windowrulev2 = float,$gearyscratchpad windowrulev2 = float,$gearyscratchpad
windowrulev2 = $scratchpadsize,$gearyscratchpad windowrulev2 = $scratchpadsize,$gearyscratchpad
windowrulev2 = workspace special silent,$gearyscratchpad windowrulev2 = workspace special silent,$gearyscratchpad
windowrulev2 = center,$gearyscratchpad windowrulev2 = center,$gearyscratchpad
bind=SUPER,X,exec,pypr zoom bind=SUPER,code:21,exec,pypr zoom
bind=SUPER,code:21,exec,hyprctl reload
bind=SUPERCTRL,right,workspace,+1 bind=SUPERCTRL,right,workspace,+1
bind=SUPERCTRL,left,workspace,-1 bind=SUPERCTRL,left,workspace,-1
@ -133,7 +139,8 @@
hyprpicker hyprpicker
swayidle swayidle
swaylock swaylock
hyprpaper swaybg
#hyprpaper
#wofi #wofi
fuzzel fuzzel
wev wev