introduce stylix

This commit is contained in:
Ingolf Wagner 2023-06-30 17:28:17 +02:00
commit 5675dc8b64
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
7 changed files with 204 additions and 322 deletions
nixos/components/gui/home-manager

View file

@ -7,7 +7,6 @@
enable = true;
settings = {
global = {
font = "JetBrains Mono";
# Allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
@ -136,32 +135,15 @@
# Horizontal padding.
horizontal_padding = 1;
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = "frame";
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = true;
# dmenu path.
#dmenu = "${pkgs.dmenu}/bin/dmenu -p dunst:";
# Browser for opening urls in context menu.
# browser = /usr/bin/firefox -new-tab
# Align icons left/right/off
icon_position = "off";
max_icon_size = 80;
frame_width = 2;
frame_color = "#8EC07C";
};
shortcuts = {
@ -184,83 +166,7 @@
# Context menu.
context = "mod4+u";
};
urgency_low = {
frame_color = "#268bd2";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
urgency_normal = {
frame_color = "#b58900";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
urgency_critical = {
frame_color = "#dc322f";
foreground = "#002b36";
background = "#fdf6e3";
#timeout = 1;
};
};
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg
};
};
};

View file

@ -2,14 +2,6 @@
let
cfg = config.home-manager.users.mainUser.xsession.windowManager.i3;
colorTheme =
let
theme = (import ../../../library/colorThemes.nix).solarized.light.hex;
in
theme // {
foreground = theme.base3;
background = theme.base03;
};
backgroundCommand = pkgs.writers.writeDash "background" ''
${pkgs.xorg.xrandr}/bin/xrandr | grep " connected" | grep "primary" | \
@ -33,13 +25,10 @@ in
{
config = lib.mkIf config.components.gui.enable {
home-manager.users.mainUser = {
programs.i3status-rust = {
enable = true;
bars = {
my = {
icons = "awesome5";
theme = "solarized-light";
# https://github.com/greshake/i3status-rust/blob/v0.22.0/doc/blocks.md
blocks = [
{
@ -66,7 +55,7 @@ in
{
block = "taskwarrior";
interval = 60;
format = " $icon $count.eng(w:1) tasks ";
format = " $icon $count.eng(w:3) tasks ";
format_singular = " $icon 1 task ";
format_everything_done = "";
warning_threshold = 10;
@ -91,50 +80,12 @@ in
];
};
};
};
programs.kitty = {
enable = true;
# kitty +kitten themes
theme = "Gruvbox Light Hard";
settings = {
font_family = "JetBrains Mono";
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
font_size = 11;
};
};
programs.alacritty = {
enable = true;
settings = {
import =
let
themes = pkgs.fetchFromGitHub {
owner = "alacritty";
repo = "alacritty-theme";
rev = "024c5c0dfb65197d5796e29e307b321af9a5e198";
sha256 = "sha256-zXyGXZSmmTup5o7Dx6he+57vSFpygR+GSD+3PTxDbVk=";
};
in
[ "${themes}/themes/gruvbox_light.yaml" ];
font = {
normal = {
family = "JetBrains Mono";
style = "Regular";
};
bold = {
family = "JetBrains Mono";
style = "Bold";
};
italic = {
family = "JetBrains Mono";
style = "Italic";
};
size = 6.0;
};
font.size = lib.mkForce 7.0;
};
};
@ -170,105 +121,26 @@ in
'');
always = true;
}
# { command = "${pkgs.wireplumber}/bin/wireplumber"; always = true; }
# { command = "systemctl --user restart polybar"; always = true; notification = false; }
# todo : still needed?
# home.file.".xprofile".text = ''
# # todo : only allow the browsers and rambox access
#
# ${pkgs.flameshot}/bin/flameshot &
# # cleanup xmonad
# rm -f ~/.xmonad/xmonad.state
# '';
];
fonts = {
names = [ "JetBrains Mono" ];
size = 11.0;
};
bars =
with colorTheme;
let
selected = blue;
in
[{
bars = [
({
#mode = "hide";
hiddenState = "hide";
position = "top";
workspaceButtons = true;
workspaceNumbers = true;
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${config.users.users.mainUser.home}/.config/i3status-rust/config-my.toml";
fonts = {
names = [ "JetBrains Mono" ];
size = 11.0;
};
#fonts = {
# names = [ "JetBrains Mono" ];
# size = 11.0;
#};
trayOutput = "primary";
colors = {
background = background;
statusline = background;
separator = background;
focusedWorkspace = {
border = selected;
background = base02;
text = foreground;
};
activeWorkspace = {
border = background;
background = base02;
text = foreground;
};
inactiveWorkspace = {
border = background;
background = base02;
text = foreground;
};
urgentWorkspace = {
border = red;
background = base02;
text = foreground;
};
bindingMode = {
border = red;
background = red;
text = background;
};
};
}];
colors = with colorTheme; {
background = background;
focused = {
background = blue;
border = blue;
childBorder = blue;
indicator = blue;
text = foreground;
};
focusedInactive = {
background = base01;
border = base01;
childBorder = base02;
indicator = base02;
text = foreground;
};
unfocused = {
background = base02;
border = base02;
childBorder = base02;
indicator = base02;
text = foreground;
};
urgent = {
background = orange;
border = orange;
childBorder = background;
indicator = background;
text = foreground;
};
};
} // config.home-manager.users.mainUser.lib.stylix.i3.bar)
];
keybindings = {
"Print" = "exec ${pkgs.flameshot}/bin/flameshot gui -c -p /share/";