This commit is contained in:
xunuwu 2024-09-27 21:07:44 +02:00
parent 448372de7a
commit ffa3121602
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI
11 changed files with 243 additions and 38 deletions

View file

@ -0,0 +1,71 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.xun.desktop;
dark = {
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
gtk = {
theme = {
package = pkgs.gnome-themes-extra;
name = "Adwaita-dark";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita-dark";
};
gtk2.extraConfig = "gtk-application-prefer-dark-theme=1";
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
};
qt = {
platformTheme.name = "gtk3";
style = {
name = "Adwaita-dark";
package = pkgs.adwaita-qt;
};
};
};
light = {
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-light";
gtk = {
theme = {
package = pkgs.gnome-themes-extra;
name = "Adwaita";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
};
gtk2.extraConfig = "gtk-application-prefer-dark-theme=false";
gtk3.extraConfig.gtk-application-prefer-dark-theme = 0;
gtk4.extraConfig.gtk-application-prefer-dark-theme = 0;
};
qt = {
style = {
name = "adwaita";
package = pkgs.adwaita-qt;
};
};
};
in {
options.xun.desktop.colorscheme = lib.mkOption {
default = null;
type = lib.types.enum [null "dark" "light"]; # might add more in the future
};
config = lib.mkIf (cfg.colorscheme != null) (lib.mkMerge [
(lib.mkIf (cfg.colorscheme == "dark") dark)
(lib.mkIf (cfg.colorscheme == "light") light)
]);
# config = lib.mkIf (cfg.colorscheme != null) (let
# switch = {
# dark = {};
# light = {};
# };
# in
# switch."${toString cfg.colorscheme}");
}

View file

@ -6,11 +6,27 @@
}: let
cfg = config.xun.desktop;
in {
imports = [
./colorscheme
];
options.xun.desktop = {
xdg.enable = lib.mkEnableOption "xdg env vars";
# colorscheme = lib.mkOption {
# default = null;
# type = lib.types.enum ["dark" "light"];
# };
};
config = lib.mkMerge [
# (let
# switch = {
# "dark" = {};
# "light" = {};
# };
# in
# switch."${toString cfg.colorscheme}")
(lib.mkIf cfg.xdg.enable {
xdg = let
home = config.home.homeDirectory;

View file

@ -70,12 +70,15 @@
small-nvim = {
enable = true;
colorscheme = {
name = "carbonfox";
name = "dayfox";
package = "EdenEast/nightfox.nvim";
};
wakatime = enabled;
};
desktop.xdg = enabled;
desktop = {
xdg = enabled;
colorscheme = "light";
};
programs.terminal = {
shell.zsh = enabled;
direnv = enabled;

View file

@ -31,7 +31,7 @@
profiles.xun = {
extensions = with config.nur.repos.rycee.firefox-addons; [
ublock-origin
darkreader
(lib.mkIf (config.xun.desktop.colorscheme == "dark") darkreader)
sponsorblock
tridactyl
translate-web-pages
@ -49,7 +49,28 @@
})
];
userChrome = builtins.readFile ./userChrome.css;
# extraConfig = let
# inherit (config.xun.desktop) colorscheme;
# in
# lib.mkIf (colorscheme != null)
# "browser.management.setEnabled(\"${
# if colorscheme == "dark"
# then "{30756de5-da3b-43c4-8b35-1db7bb01680a}"
# else if colorscheme == "light"
# then "firefox-compact-light@mozilla.org"
# else null
# }\", true);";
settings = {
"extensions.activeThemeID" = let
inherit (config.xun.desktop) colorscheme;
in
lib.mkIf (colorscheme != null) (
if colorscheme == "dark"
then "{30756de5-da3b-43c4-8b35-1db7bb01680a}"
else if colorscheme == "light"
then "firefox-compact-light@mozilla.org"
else null
);
"browser.display.use_system_colors" = true; # about:blank colour match colourscheme
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # enable userChrome
"browser.tabs.inTitleBar" = "0"; # use system title bar

View file

@ -5,7 +5,8 @@
/* Hide tab bar */
#TabsToolbar {
display: none;
/* display: none; */
visibility: collapse;
}
/* urlbar same color as background */
@ -17,3 +18,8 @@
#navigator-toolbox {
border-bottom: none !important;
}
/* Hide shield thing since i never ever change those settings */
#tracking-protection-icon-container {
visibility: collapse;
}

View file

@ -1,8 +1,30 @@
{
lib,
pkgs,
config,
...
}: {
}: let
colors = {
dark = {
background = "#181818ff";
text = "#a4c6d9ff";
match = "#ae61b5ff";
border = "#feafffff";
selection = "#242424ff";
selection-text = "#ffffffff";
selection-match = "#fac1ffff";
};
light = {
background = "#ffffffff";
text = "#000000ff";
match = "#a60000ff";
border = "#000000ff";
selection = "#bfbfbfff";
selection-text = "#000000ff";
selection-match = "#2544bbff";
};
};
in {
programs.fuzzel = {
enable = true;
settings = {
@ -10,15 +32,7 @@
terminal = "${lib.getExe pkgs.foot}";
layer = "overlay";
};
colors = {
background = "#181818ff";
text = "#a4c6d9ff";
match = "#ae61b5ff";
border = "#feafffff";
selection = "#242424ff";
selection-text = "#ffffffff";
selection-match = "#fac1ffff";
};
colors = colors."${config.xun.desktop.colorscheme}";
};
};
}

View file

@ -9,6 +9,7 @@
../common/fuzzel.nix
../common/wob.nix
../common/wl-clipboard.nix
./waybar.nix
];
services.cliphist = {
@ -58,12 +59,7 @@
input = {
"*".xkb_layout = osConfig.services.xserver.xkb.layout;
};
bars = [
{
workspaceNumbers = false;
statusCommand = "${lib.getExe pkgs.i3status}";
}
];
bars = []; # i use waybar instead
window = {
titlebar = false;
};

View file

@ -0,0 +1,16 @@
diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp
index 8f273300..faed503c 100644
--- a/src/modules/sway/workspaces.cpp
+++ b/src/modules/sway/workspaces.cpp
@@ -343,9 +343,9 @@ auto Workspaces::update() -> void {
fmt::arg("output", (*it)["output"].asString()));
}
if (!config_["disable-markup"].asBool()) {
- static_cast<Gtk::Label *>(button.get_children()[0])->set_markup(output);
+ static_cast<Gtk::Label *>(button.get_children()[0])->set_markup(trimWorkspaceName(output));
} else {
- button.set_label(output);
+ button.set_label(trimWorkspaceName(output));
}
onButtonReady(*it, button);
}

View file

@ -0,0 +1,62 @@
{pkgs, ...}: {
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (final: prev: {
patches = prev.patches ++ [./waybar-workspace.patch];
});
settings = [
{
height = 24;
spacing = 4;
position = "top";
modules-left = [
"sway/workspaces"
];
modules-center = [
"sway/window"
];
modules-right = [
"tray"
"clock"
];
"sway/workspaces" = {
format = "{icon}";
};
clock = {
format = "{:%a %H:%M}";
tooltip-format = "<big>{:%a %Y-%m-%d %H:%M}</big>\n<small>{calendar}</small>";
};
}
];
style = ''
* {
font-size: 13px;
}
button {
border: none;
border-radius: 0;
}
#workspaces button {
padding: 0 5px;
}
#workspaces button.visible {
box-shadow: inset 0 -3px black;
}
#workspaces button.urgent {
box-shadow: inset 0 -3px blue;
}
#clock {
padding: 0 10px;
}
'';
systemd = {
enable = true;
target = "sway-session.target";
};
};
}

View file

@ -8,33 +8,33 @@
};
# Also sets org.freedesktop.appearance color-scheme
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
# dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
gtk = {
enable = true;
theme = {
package = pkgs.gnome-themes-extra;
name = "Adwaita-dark";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita-dark";
};
# theme = {
# package = pkgs.gnome-themes-extra;
# name = "Adwaita-dark";
# };
# iconTheme = {
# package = pkgs.adwaita-icon-theme;
# name = "Adwaita-dark";
# };
font = {
name = "Sans";
size = 11;
};
gtk2.extraConfig = "gtk-application-prefer-dark-theme=1";
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
# gtk2.extraConfig = "gtk-application-prefer-dark-theme=1";
# gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
# gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
};
qt = {
enable = true;
platformTheme.name = "gtk3";
style = {
name = "Adwaita-dark";
package = pkgs.adwaita-qt;
};
# platformTheme.name = "gtk3";
# style = {
# name = "Adwaita-dark";
# package = pkgs.adwaita-qt;
# };
};
}

View file

@ -3,7 +3,7 @@
enable = true;
settings = {
main = {
include = "${pkgs.foot.themes}/share/foot/themes/moonfly";
include = "${pkgs.foot.themes}/share/foot/themes/modus-operandi";
font = "monospace:size=9";
};
mouse.hide-when-typing = true;