change theme engine, some fixes

This commit is contained in:
Dmitriy Kholkin 2020-08-10 01:17:22 +04:00
parent f18b5ac912
commit b5b6f3bdd5
34 changed files with 592 additions and 408 deletions

View File

@ -5,6 +5,7 @@ rec {
imports = [ imports = [
(./hardware-configuration + "/${name}.nix") (./hardware-configuration + "/${name}.nix")
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
(import inputs.base16.hmModule)
(import ./modules device) (import ./modules device)
]; ];

48
flake.lock generated
View File

@ -1,5 +1,23 @@
{ {
"nodes": { "nodes": {
"base16": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1597006283,
"narHash": "sha256-O7vu1L1TxSx7IS2BQL90RCR6S/9rGLs2NL+Porppp4I=",
"owner": "alukardbf",
"repo": "base16-nix",
"rev": "ee0b1e4c6aaf2e9ea959eb649bc409bd10eeb7dc",
"type": "github"
},
"original": {
"owner": "alukardbf",
"repo": "base16-nix",
"type": "github"
}
},
"base16-horizon-scheme": { "base16-horizon-scheme": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -18,7 +36,7 @@
}, },
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1591751635, "lastModified": 1591751635,
@ -69,7 +87,7 @@
}, },
"nix": { "nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1596554686, "lastModified": 1596554686,
@ -86,15 +104,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1591748508, "lastModified": 1593360652,
"narHash": "sha256-GdYYaYsSBgYUhbDT1JJQ7vEgo8FWeW/AW7/qqJuCvRA=", "narHash": "sha256-8dXbDWhLzgZfiQ+XZ2rtSnUAafFizeeXJa5fuF/9n4w=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1d8c4410687390f9b8f92dbe6ff39fd8fc2b17c6", "rev": "c5299e9d5bb18f1ebd817e0a4767103b9935f0ee",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "release-20.03",
"type": "indirect" "type": "indirect"
} }
}, },
@ -115,6 +134,20 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1591748508,
"narHash": "sha256-GdYYaYsSBgYUhbDT1JJQ7vEgo8FWeW/AW7/qqJuCvRA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1d8c4410687390f9b8f92dbe6ff39fd8fc2b17c6",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1591633336, "lastModified": 1591633336,
"narHash": "sha256-oVXv4xAnDJB03LvZGbC72vSVlIbbJr8tpjEW5o/Fdek=", "narHash": "sha256-oVXv4xAnDJB03LvZGbC72vSVlIbbJr8tpjEW5o/Fdek=",
@ -129,7 +162,7 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1596265691, "lastModified": 1596265691,
"narHash": "sha256-9ofCzFqttTsGrvTaS4RrDSTNQO9PFOz5uyn8V+2eA5M=", "narHash": "sha256-9ofCzFqttTsGrvTaS4RrDSTNQO9PFOz5uyn8V+2eA5M=",
@ -147,12 +180,13 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"base16": "base16",
"base16-horizon-scheme": "base16-horizon-scheme", "base16-horizon-scheme": "base16-horizon-scheme",
"home-manager": "home-manager", "home-manager": "home-manager",
"i3lock-fancy-rapid": "i3lock-fancy-rapid", "i3lock-fancy-rapid": "i3lock-fancy-rapid",
"materia-theme": "materia-theme", "materia-theme": "materia-theme",
"nix": "nix", "nix": "nix",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"nixpkgs-mozilla": "nixpkgs-mozilla", "nixpkgs-mozilla": "nixpkgs-mozilla",
"spotify-tui": "spotify-tui", "spotify-tui": "spotify-tui",
"zsh-autosuggestions": "zsh-autosuggestions", "zsh-autosuggestions": "zsh-autosuggestions",

View File

@ -2,9 +2,10 @@
description = "System configuration"; description = "System configuration";
inputs = { inputs = {
# nixpkgs = github:nixos/nixpkgs-channels/840c782d507d60aaa49aa9e3f6d0b0e780912742;
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable; nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
home-manager.url = github:rycee/home-manager/bqv-flakes; home-manager.url = github:rycee/home-manager/bqv-flakes;
base16.url = github:alukardbf/base16-nix;
# base16.url = "/shared/nixos/base16-nix";
base16-horizon-scheme = { base16-horizon-scheme = {
url = github:AlukardBF/base16-horizon-scheme; url = github:AlukardBF/base16-horizon-scheme;
flake = false; flake = false;

View File

@ -7,8 +7,8 @@ with import ../support.nix { inherit lib config; }; {
config = rec { config = rec {
defaultApplications = { defaultApplications = {
term = { term = {
cmd = "${pkgs.rxvt_unicode}/bin/urxvt"; cmd = "${pkgs.alacritty}/bin/alacritty";
desktop = "urxvt"; desktop = "alacritty";
}; };
dmenu = { dmenu = {
cmd = "${pkgs.rofi}/bin/rofi -show run"; cmd = "${pkgs.rofi}/bin/rofi -show run";

View File

@ -0,0 +1,94 @@
{ pkgs, lib, config, ... }:
let
thm = config.lib.base16.theme;
in
{
home-manager.users.alukard = {
programs.alacritty = {
enable = true;
settings = {
font = {
# normal.family = "Roboto Mono for Powerline";
# bold = { style = "Bold"; };
normal = {
family = "${thm.powerlineFont}";
style = "Regular";
};
bold = {
family = "${thm.powerlineFont}";
style = "Bold";
};
italic = {
family = "${thm.powerlineFont}";
style = "Italic";
};
bold_italic = {
family = "${thm.powerlineFont}";
style = "Bold Italic";
};
size = 11;
};
window.padding = {
x = 2;
y = 2;
};
shell.program = "${pkgs.zsh}/bin/zsh";
cursor.style = "Beam";
colors = {
primary = {
background = "0x${thm.base00-hex}";
foreground = "0x${thm.base05-hex}";
};
cursor = {
text = "0x${thm.base00-hex}";
cursor = "0x${thm.base05-hex}";
};
normal = {
black = "0x${thm.base00-hex}";
red = "0x${thm.base08-hex}";
green = "0x${thm.base0B-hex}";
yellow = "0x${thm.base0A-hex}";
blue = "0x${thm.base0D-hex}";
magenta = "0x${thm.base0E-hex}";
cyan = "0x${thm.base0C-hex}";
white = "0x${thm.base05-hex}";
};
bright = {
black = "0x${thm.base03-hex}";
red = "0x${thm.base09-hex}";
green = "0x${thm.base01-hex}";
yellow = "0x${thm.base02-hex}";
blue = "0x${thm.base04-hex}";
magenta = "0x${thm.base06-hex}";
cyan = "0x${thm.base0F-hex}";
white = "0x${thm.base07-hex}";
};
draw_bold_text_with_bright_colors = "false";
# bright = {
# black = "0x${thm.base03-hex}";
# red = "0x${thm.base08-hex}";
# green = "0x${thm.base0B-hex}";
# yellow = "0x${thm.base0A-hex}";
# blue = "0x${thm.base0D-hex}";
# magenta = "0x${thm.base0E-hex}";
# cyan = "0x${thm.base0C-hex}";
# white = "0x${thm.base07-hex}";
# };
# indexed_colors = {
# - { index: 16, color: '0xff8700' }
# - { index: 17, color: '0xd65d0e' }
# - { index: 18, color: '0x3a3a3a' }
# - { index: 19, color: '0x4e4e4e' }
# - { index: 20, color: '0x949494' }
# - { index: 21, color: '0xd5c4a1' }
# };
};
};
};
};
}

View File

@ -40,7 +40,6 @@ in {
vdpauinfo vdpauinfo
libva-utils libva-utils
lm_sensors lm_sensors
libnotify
gparted gparted
neofetch neofetch
bashmount bashmount
@ -64,13 +63,13 @@ in {
# cli # cli
ranger ranger
youtube-dl youtube-dl
wpgtk # wpgtk
# pywal # pywal
# python27Packages.pygtk # pywal GTK2 reload # python27Packages.pygtk # pywal GTK2 reload
# python2 # pywal GTK2 reload # python2 # pywal GTK2 reload
# ncmpcpp # ncmpcpp
(youtube-to-mpv.override { isLaptop = isLaptop; }) youtube-to-mpv
wg-conf wg-conf
(vivaldi.override { proprietaryCodecs = true; }) (vivaldi.override { proprietaryCodecs = true; })

View File

@ -0,0 +1,15 @@
{ pkgs, config, lib, ... }:
let
thm = config.lib.base16.theme;
themeFile = config.lib.base16.templateFile { name = "rofi"; };
in
{
home-manager.users.alukard = {
programs.rofi = {
enable = true;
font = "${thm.fontMono} ${thm.headerSize}";
terminal = config.defaultApplications.term.cmd;
theme = "${themeFile}";
};
};
}

View File

@ -0,0 +1,26 @@
{ pkgs, lib, config, ... }:
let
thm = config.lib.base16.theme;
in
{
# Support Wal color theme
home-manager.users.alukard.home.file.".cache/wal/colors".text = ''
#${thm.base00-hex}
#${thm.base01-hex}
#${thm.base02-hex}
#${thm.base03-hex}
#${thm.base04-hex}
#${thm.base05-hex}
#${thm.base06-hex}
#${thm.base07-hex}
#${thm.base08-hex}
#${thm.base09-hex}
#${thm.base0A-hex}
#${thm.base0B-hex}
#${thm.base0C-hex}
#${thm.base0D-hex}
#${thm.base0E-hex}
#${thm.base0F-hex}
'';
}

View File

@ -1,39 +0,0 @@
{ stdenv, pkgs, isLaptop ? false }:
# TODO: отвязать от urxvt
let
# myScript = if isLaptop then
# pkgs.writeShellScriptBin "yt-mpv" ''
# if [[ "$1" != "--no-video" ]]; then
# BATTERY="`${pkgs.acpi}/bin/acpi -b | grep --invert-match unavailable | head -1`"
# STATUS=`awk -F'[,:] ' '{print $2}' <<< "$BATTERY"`
# ${pkgs.libnotify}/bin/notify-send -t 3000 --icon=video-television "Playing Video" "$(xclip -o)"
# if [[ "$STATUS" == "Discharging" ]]; then
# ${pkgs.mpv}/bin/mpv --fs --ytdl-format="bestvideo[height<=?1080][fps<=?30][vcodec!=?vp9]+bestaudio/best" "$(xclip -o)"
# else
# ${pkgs.mpv}/bin/mpv --fs "$(xclip -o)"
# fi
# else
# ${pkgs.libnotify}/bin/notify-send -t 3000 --icon=video-television "Playing Audio" "$(xclip -o)"
# ${pkgs.rxvt_unicode}/bin/urxvt -e ${pkgs.mpv}/bin/mpv --no-video "$(xclip -o)"
# fi
# ''
# else
myScript = pkgs.writeShellScriptBin "yt-mpv" ''
if [[ "$1" != "--no-video" ]]; then
${pkgs.libnotify}/bin/notify-send -t 3000 --icon=video-television "Playing Video" "$(xclip -o)"
${pkgs.mpv}/bin/mpv --fs "$(xclip -o)"
else
${pkgs.libnotify}/bin/notify-send -t 3000 --icon=video-television "Playing Audio" "$(xclip -o)"
${pkgs.rxvt_unicode}/bin/urxvt -e ${pkgs.mpv}/bin/mpv --no-video "$(xclip -o)"
fi
'';
in
stdenv.mkDerivation rec {
name = "youtube-to-mpv";
src = myScript;
installPhase = ''
mkdir -p $out/bin
mv ./bin/yt-mpv $out/bin/yt-mpv
'';
}

View File

@ -1,7 +1,10 @@
device: device:
{ config, lib, ... }: { { config, lib, ... }: {
imports = [ imports = [
./applications/alacritty.nix
./applications/packages.nix ./applications/packages.nix
./applications/rofi.nix
./applications/vscode.nix
# ./workspace/barrier.nix # ./workspace/barrier.nix
./workspace/dunst.nix ./workspace/dunst.nix
@ -16,7 +19,6 @@ device:
./workspace/mpv.nix ./workspace/mpv.nix
./workspace/pulseeffects ./workspace/pulseeffects
./workspace/qbittorrent ./workspace/qbittorrent
./workspace/rofi.nix
# ./workspace/spotifyd.nix # ./workspace/spotifyd.nix
./workspace/ssh.nix ./workspace/ssh.nix
./workspace/xresources.nix ./workspace/xresources.nix

View File

@ -10,19 +10,21 @@
rec { rec {
inherit inputs; inherit inputs;
youtube-to-mpv = pkgs.callPackage ./applications/youtube-to-mpv.nix { }; youtube-to-mpv = pkgs.callPackage ./packages/youtube-to-mpv.nix { };
wg-conf = pkgs.callPackage ./applications/wg-conf.nix { }; wg-conf = pkgs.callPackage ./packages/wg-conf.nix { };
i3lock-fancy-rapid = pkgs.callPackage ./applications/i3lock-fancy-rapid.nix { }; i3lock-fancy-rapid = pkgs.callPackage ./packages/i3lock-fancy-rapid.nix { };
xonar-fp = pkgs.callPackage ./applications/xonar-fp.nix { }; xonar-fp = pkgs.callPackage ./packages/xonar-fp.nix { };
advance-touch = pkgs.callPackage ./applications/advance-touch.nix { }; advance-touch = pkgs.callPackage ./packages/advance-touch.nix { };
nomino = pkgs.callPackage ./applications/nomino.nix { }; nomino = pkgs.callPackage ./packages/nomino.nix { };
bpytop = pkgs.callPackage ./applications/bpytop.nix { }; bpytop = pkgs.callPackage ./packages/bpytop.nix { };
ibm-plex-powerline = pkgs.callPackage ./packages/ibm-plex-powerline.nix { };
# micro = super.micro.overrideAttrs (old: rec { # micro = super.micro.overrideAttrs (old: rec {
# version = "2.0.6"; # version = "2.0.6";

View File

@ -0,0 +1,38 @@
{ python3Packages, python2, fetchFromGitHub, fetchzip }:
let
fontpatcher = python3Packages.buildPythonApplication rec {
name = "fontpatcher";
src = fetchFromGitHub {
owner = "powerline";
repo = "fontpatcher";
rev = "c3488091611757cb02014ed7ed2f11be0208da83";
sha256 = "1261h8233spflbbwbjz9w9bxcmznjldxwff08xn2cly6r9f49a0s";
};
propagatedBuildInputs = [
python2
python3Packages.fontforge
];
doCheck = false;
preFixup = ''
mkdir -p $out/fonts
cp fonts/* $out/fonts
'';
};
version = "5.1.0";
in fetchzip {
name = "ibm-plex-powerline-${version}";
url = "https://github.com/IBM/plex/releases/download/v${version}/OpenType.zip";
postFetch = ''
mkdir -p $out/share/fonts/opentype
unzip -j $downloadedFile "OpenType/*/IBMPlexMono*.otf" -d $out/share/fonts/opentype
cd $out/share/fonts/opentype
${fontpatcher}/bin/powerline-fontpatcher $out/share/fonts/opentype/*
rm -f $out/share/fonts/opentype/IBMPlex*
'';
sha256 = "sha256-DaNXraX1gXhoS3Pnttw4VVHRvGrQRR2wuplNJn+c6cg=";
}

View File

@ -0,0 +1,22 @@
{ stdenv, pkgs, config }:
# TODO: config.defaultApplications doesn't work
let
yt-mpv = pkgs.writeShellScriptBin "yt-mpv" ''
if [[ "$1" != "--no-video" ]]; then
${pkgs.libnotify}/bin/notify-send -t 3000 --icon=video-television "Playing Video" "$(xclip -o)"
${pkgs.mpv}/bin/mpv --fs "$(xclip -o)"
else
${pkgs.libnotify}/bin/notify-send -t 3000 --icon=video-television "Playing Audio" "$(xclip -o)"
${pkgs.alacritty}/bin/alacritty -e ${pkgs.mpv}/bin/mpv --no-video "$(xclip -o)"
fi
'';
in
stdenv.mkDerivation rec {
name = "youtube-to-mpv";
src = yt-mpv;
installPhase = ''
mkdir -p $out/bin
mv ./bin/yt-mpv $out/bin/yt-mpv
'';
}

View File

@ -1,79 +1,52 @@
{ config, lib, pkgs, inputs, ... }: { config, lib, pkgs, inputs, ... }:
with lib; with lib;
let # let
colorType = types.str; # fromBase16 = base16scheme:
color = (name: # builtins.mapAttrs (_: v: "#" + v) {
(mkOption { # bg = base00-hex;
description = "${name} color of palette"; # # fg = base07-hex;
type = colorType; # fg = base05-hex;
})); # };
fromBase16 = { base00, base01, base02, base03, base04, base05, base06, base07 # in
, base08, base09, base0A, base0B, base0C, base0D, base0E, base0F, ... }: {
builtins.mapAttrs (_: v: "#" + v) { # options = {
bg = base00; # themes = {
fg = base07; # colors = mkOption {
# description =
# "Set of colors from which the themes for various applications will be generated";
# type = with types;
# submodule {
gray = base03; # options = let
alt = base02; # colors = (builtins.genList (x: (toString x) ) 15);
dark = base01; # in {
# bg = types.str;
red = base08; # fg = types.str;
orange = base09; # } // builtins.listToAttrs (builtins.map (x: {
yellow = base0A; # name = "base${x}";
green = base0B; # value = types.str;
cyan = base0C; # }) colors);
blue = base0D; # };
purple = base0E;
};
fromYAML = yaml:
builtins.fromJSON (builtins.readFile (pkgs.stdenv.mkDerivation {
name = "fromYAML";
phases = [ "buildPhase" ];
buildPhase = "echo '${yaml}' | ${pkgs.yaml2json}/bin/yaml2json > $out";
}));
in {
options = {
themes = {
colors = mkOption {
description =
"Set of colors from which the themes for various applications will be generated";
type = with types;
submodule {
options = {
bg = color "background";
fg = color "foreground";
gray = color "gray";
alt = color "alternative";
dark = color "darker";
blue = color "blue";
green = color "green";
red = color "red";
orange = color "orange";
yellow = color "yellow";
cyan = color "cyan";
purple = color "purple";
};
};
};
};
};
# config = {
# themes.colors = (fromBase16 (fromYAML
# (builtins.readFile "${inputs.base16-unclaimed-schemes}/irblack.yaml")))
# // {
# alt = "#001d6c";
# red = "#da1e28";
# green = "#24a148";
# orange = "#ff832b";
# yellow = "#f1c21b";
# }; # };
# };
# }; # };
config = { config.themes.base16 = {
themes.colors = (fromBase16 (fromYAML enable = true;
(builtins.readFile "${inputs.base16-horizon-scheme}/horizon-dark.yaml"))); # scheme = "tomorrow";
# variant = "tomorrow-night";
scheme = "gruvbox";
variant = "gruvbox-dark-medium";
extraParams = {
font = "IBM Plex Sans";
fontMono = "IBM Plex Mono";
fontSerif = "IBM Plex Serif";
fallbackFont = "Roboto";
fallbackFontMono = "Roboto Mono";
fallbackFontSerif = "Roboto Slab";
fontSize = "12";
headerSize = "14";
iconFont = "Material Icons";
powerlineFont = "IBM Plex Mono for Powerline";
};
}; };
} }

View File

@ -1,5 +1,5 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
let thm = config.themes.colors; let thm = config.lib.base16.theme;
in { in {
home-manager.users.alukard = { home-manager.users.alukard = {
services.dunst = { services.dunst = {
@ -12,8 +12,9 @@ in {
global = { global = {
geometry = "500x5-30+50"; geometry = "500x5-30+50";
transparency = 10; transparency = 10;
frame_color = thm.blue; frame_color = "#${thm.base05-hex}";
font = "Roboto 13"; separator_color = "#${thm.base05-hex}";
font = "${thm.font} ${thm.fontSize}";
padding = 15; padding = 15;
horizontal_padding = 17; horizontal_padding = 17;
word_wrap = true; word_wrap = true;
@ -25,20 +26,20 @@ in {
}; };
urgency_low = { urgency_low = {
background = thm.bg; background = "#${thm.base01-hex}";
foreground = thm.fg; foreground = "#${thm.base03-hex}";
timeout = 5; timeout = 5;
}; };
urgency_normal = { urgency_normal = {
background = thm.alt; background = "#${thm.base02-hex}";
foreground = thm.fg; foreground = "#${thm.base05-hex}";
timeout = 10; timeout = 10;
}; };
urgency_critical = { urgency_critical = {
background = thm.fg; background = "#${thm.base08-hex}";
foreground = thm.bg; foreground = "#${thm.base06-hex}";
timeout = 15; timeout = 15;
}; };
}; };

View File

@ -1,26 +1,29 @@
{ pkgs, config, lib, ... }: { { pkgs, config, lib, ... }:
let
thm = config.lib.base16.theme;
in
{
fonts = { fonts = {
fonts = with pkgs; [ fonts = with pkgs; [
# terminus_font ibm-plex
# opensans-ttf ibm-plex-powerline
fira-code
material-design-icons
material-icons
roboto roboto
roboto-mono roboto-mono
roboto-slab roboto-slab
fira-code
# noto-fonts
# noto-fonts-emoji
powerline-fonts
material-icons
font-awesome_4 font-awesome_4
# powerline-fonts
]; ];
fontconfig = { fontconfig = {
enable = true; enable = true;
defaultFonts = { defaultFonts = {
monospace = ["Roboto Mono 13"]; monospace = [ "${thm.fontMono} 13" ];
sansSerif = ["Roboto 13"]; sansSerif = [ "${thm.font} 13" ];
serif = ["Roboto Slab 13"]; serif = [ "${thm.fontSerif} 13" ];
}; };
}; };
enableDefaultFonts = true; enableDefaultFonts = true;
}; };
} }

View File

@ -1,25 +1,24 @@
{ pkgs, config, lib, inputs, ... }: { pkgs, config, lib, inputs, ... }:
let let
thm = config.themes.colors; thm = config.lib.base16.theme;
thm' = builtins.mapAttrs (name: value: builtins.substring 1 7 value) thm;
materia_colors = pkgs.writeTextFile { materia_colors = pkgs.writeTextFile {
name = "gtk-generated-colors"; name = "gtk-generated-colors";
text = '' text = ''
BG=${thm'.bg} BG=${thm.base00-hex}
FG=${thm'.fg} FG=${thm.base05-hex}
BTN_BG=${thm'.bg} BTN_BG=${thm.base00-hex}
BTN_FG=${thm'.fg} BTN_FG=${thm.base05-hex}
MENU_BG=${thm'.bg} MENU_BG=${thm.base00-hex}
MENU_FG=${thm'.fg} MENU_FG=${thm.base05-hex}
ACCENT_BG=${thm'.blue} ACCENT_BG=${thm.base02-hex}
SEL_BG=${thm'.blue} SEL_BG=${thm.base0D-hex}
SEL_FG=${thm'.bg} SEL_FG=${thm.base00-hex}
TXT_BG=${thm'.bg} TXT_BG=${thm.base00-hex}
TXT_FG=${thm'.fg} TXT_FG=${thm.base05-hex}
HDR_BTN_BG=${thm'.bg} HDR_BTN_BG=${thm.base00-hex}
HDR_BTN_FG=${thm'.fg} HDR_BTN_FG=${thm.base05-hex}
WM_BORDER_FOCUS=${thm'.blue} WM_BORDER_FOCUS=${thm.base02-hex}
WM_BORDER_UNFOCUS=${thm'.alt} WM_BORDER_UNFOCUS=${thm.base01-hex}
MATERIA_STYLE_COMPACT=True MATERIA_STYLE_COMPACT=True
MATERIA_COLOR_VARIANT=dark MATERIA_COLOR_VARIANT=dark
UNITY_DEFAULT_LAUNCHER_STYLE=False UNITY_DEFAULT_LAUNCHER_STYLE=False
@ -59,7 +58,7 @@ in {
# package = pkgs.flatcolor-gtk-theme; # package = pkgs.flatcolor-gtk-theme;
}; };
font = { font = {
name = "Roboto 12"; name = "${thm.font} ${thm.fontSize}";
}; };
gtk3.extraConfig.gtk-cursor-theme-name = "bibata_oil"; gtk3.extraConfig.gtk-cursor-theme-name = "bibata_oil";
}; };

View File

@ -1,6 +1,6 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
let let
thm = config.themes.colors; thm = config.lib.base16.theme;
apps = config.defaultApplications; apps = config.defaultApplications;
# lock = pkgs.writeShellScript "lock" "sudo /run/current-system/sw/bin/lock"; # lock = pkgs.writeShellScript "lock" "sudo /run/current-system/sw/bin/lock";
in { in {
@ -21,60 +21,55 @@ in {
]; ];
"" = [{ class = "cantata"; }]; "" = [{ class = "cantata"; }];
}; };
fonts = [ "RobotoMono 9" ]; fonts = [ "${thm.fontMono} 9" ];
bars = [ ]; bars = [ ];
# colors = rec { colors = {
# background = thm.bg; focused = {
# unfocused = { border = "#${thm.base05-hex}";
# border = thm.dark; background = "#${thm.base00-hex}";
# background = thm.bg; text = "#${thm.base0D-hex}";
# text = thm.alt; indicator = "#${thm.base0D-hex}";
# indicator = thm.fg; childBorder = "#${thm.base0C-hex}";
# childBorder = thm.dark; };
# }; focusedInactive = {
# focusedInactive = unfocused; border = "#${thm.base01-hex}";
# urgent = unfocused // { background = "#${thm.base01-hex}";
# border = thm.orange; text = "#${thm.base05-hex}";
# text = thm.fg; indicator = "#${thm.base03-hex}";
# childBorder = thm.orange; childBorder = "#${thm.base01-hex}";
# }; };
# focused = unfocused // {
# border = thm.blue;
# background = thm.dark;
# text = thm.fg;
# childBorder = thm.blue;
# };
# };
colors = rec {
background = "\$bg";
unfocused = { unfocused = {
border = "\$dark"; border = "#${thm.base01-hex}";
background = "\$bg"; background = "#${thm.base00-hex}";
text = "\$alt"; text = "#${thm.base05-hex}";
indicator = "\$fg"; indicator = "#${thm.base01-hex}";
childBorder = "\$dark"; childBorder = "#${thm.base01-hex}";
}; };
focusedInactive = unfocused; urgent = {
urgent = unfocused // { border = "#${thm.base08-hex}";
border = "\$purple"; background = "#${thm.base08-hex}";
text = "\$fg"; text = "#${thm.base00-hex}";
childBorder = "\$purple"; indicator = "#${thm.base08-hex}";
childBorder = "#${thm.base08-hex}";
}; };
focused = unfocused // { placeholder = {
border = "\$blue"; border = "#${thm.base00-hex}";
background = "\$dark"; background = "#${thm.base00-hex}";
text = "\$fg"; text = "#${thm.base05-hex}";
childBorder = "\$blue"; indicator = "#${thm.base00-hex}";
childBorder = "#${thm.base00-hex}";
}; };
background = "#${thm.base07-hex}";
}; };
gaps = { gaps = {
inner = 6; inner = 6;
smartGaps = true; smartGaps = true;
smartBorders = "on"; smartBorders = "on";
}; };
focus.mouseWarping = true; focus.mouseWarping = false;
focus.followMouse = false; focus.followMouse = false;
modifier = "Mod4"; modifier = "Mod4";
window = { window = {
@ -89,7 +84,7 @@ in {
]; ];
}; };
startup = map (a: { notification = false; } // a) [ startup = map (a: { notification = false; } // a) [
# { command = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources"; } { command = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources"; }
{ command = "${pkgs.pywal}/bin/wal -R"; } { command = "${pkgs.pywal}/bin/wal -R"; }
{ command = "${pkgs.tdesktop}/bin/telegram-desktop"; } { command = "${pkgs.tdesktop}/bin/telegram-desktop"; }
{ {
@ -188,12 +183,23 @@ in {
default_border pixel 1 default_border pixel 1
hide_edge_borders smart hide_edge_borders smart
set_from_resource $bg i3wm.background "{background}" # Set colors
set_from_resource $fg i3wm.foreground "{foreground}" set $base00 #${thm.base00-hex}
set_from_resource $dark i3wm.color0 "{color0}" set $base01 #${thm.base01-hex}
set_from_resource $alt i3wm.color8 "{color8}" set $base02 #${thm.base02-hex}
set_from_resource $purple i3wm.color5 "{color5}" set $base03 #${thm.base03-hex}
set_from_resource $blue i3wm.color4 "{color4}" set $base04 #${thm.base04-hex}
set $base05 #${thm.base05-hex}
set $base06 #${thm.base06-hex}
set $base07 #${thm.base07-hex}
set $base08 #${thm.base08-hex}
set $base09 #${thm.base09-hex}
set $base0A #${thm.base0A-hex}
set $base0B #${thm.base0B-hex}
set $base0C #${thm.base0C-hex}
set $base0D #${thm.base0D-hex}
set $base0E #${thm.base0E-hex}
set $base0F #${thm.base0F-hex}
''; '';
}; };
} }

View File

@ -4,12 +4,14 @@ with rec {
}; };
with deviceSpecific; with deviceSpecific;
with import ../../../support.nix { inherit pkgs config lib; }; with import ../../../support.nix { inherit pkgs config lib; };
let scripts = import ./scripts pkgs config; let
scripts = import ./scripts pkgs config;
thm = config.lib.base16.theme;
in { in {
home-manager.users.alukard.xsession.windowManager.i3.extraConfig = '' home-manager.users.alukard.xsession.windowManager.i3.extraConfig = ''
bar { bar {
id top id top
font pango:Roboto Mono 11, FontAwesome 11 font pango:${thm.iconFont} 11, ${thm.fontMono} 11, ${thm.fallbackFontMono} 11
mode dock mode dock
hidden_state hide hidden_state hide
position top position top
@ -18,22 +20,36 @@ in {
strip_workspace_numbers no strip_workspace_numbers no
tray_output primary tray_output primary
colors { colors {
background $bg background #${thm.base00-hex}
statusline $fg separator #${thm.base01-hex}
separator $alt statusline #${thm.base04-hex}
focused_workspace $bg $bg $blue focused_workspace #${thm.base00-hex} #${thm.base00-hex} #${thm.base0D-hex}
active_workspace $bg $bg $green active_workspace #${thm.base00-hex} #${thm.base03-hex} #${thm.base00-hex}
inactive_workspace $bg $bg $fg inactive_workspace #${thm.base00-hex} #${thm.base01-hex} #${thm.base05-hex}
urgent_workspace $bg $bg $orange urgent_workspace #${thm.base00-hex} #${thm.base0A-hex} #${thm.base00-hex}
binding_mode $bg $bg $yellow binding_mode #${thm.base00-hex} #${thm.base0A-hex} #${thm.base00-hex}
} }
} }
''; '';
# TODO: rewrite concat
home-manager.users.alukard.xdg.configFile."i3status-rust/config.toml".text = lib.concatStrings ['' home-manager.users.alukard.xdg.configFile."i3status-rust/config.toml".text = lib.concatStrings [''
theme = "slick"
icons = "awesome" [theme]
name = "solarized-dark"
[theme.overrides]
idle_bg = "#${thm.base00-hex}"
idle_fg = "#${thm.base05-hex}"
info_bg = "#${thm.base0C-hex}"
info_fg = "#${thm.base00-hex}"
good_bg = "#${thm.base0B-hex}"
good_fg = "#${thm.base00-hex}"
warning_bg = "#${thm.base0A-hex}"
warning_fg = "#${thm.base00-hex}"
critical_bg = "#${thm.base08-hex}"
critical_fg = "#${thm.base00-hex}"
[icons]
name = "material"
[[block]] [[block]]
block = "net" block = "net"

View File

@ -1,4 +1,4 @@
{ bash, config, curl, ... }: '' { bash, config, curl, ... }: with config.lib.base16.theme; ''
#!/usr/bin/env bash #!/usr/bin/env bash
echo '<span font="Material Icons">folder</span>' `df -h / | tail -1 | awk '{print $4}'`iB echo '<span font="${iconFont}">folder</span>' `df -h / | tail -1 | awk '{print $4}'`iB
'' ''

View File

@ -41,90 +41,90 @@ with import ../../../support.nix { inherit lib config; }; {
}; };
home-manager.users.alukard.xdg.configFile."kdeglobals".text = genIni { home-manager.users.alukard.xdg.configFile."kdeglobals".text = genIni {
"Colors:Button" = { # "Colors:Button" = {
BackgroundAlternate = thmDec.dark; # BackgroundAlternate = thmDec.dark;
BackgroundNormal = thmDec.bg; # BackgroundNormal = thmDec.bg;
DecorationFocus = thmDec.alt; # DecorationFocus = thmDec.alt;
DecorationHover = thmDec.alt; # DecorationHover = thmDec.alt;
ForegroundActive = thmDec.alt; # ForegroundActive = thmDec.alt;
ForegroundInactive = thmDec.dark; # ForegroundInactive = thmDec.dark;
ForegroundLink = thmDec.blue; # ForegroundLink = thmDec.blue;
ForegroundNegative = thmDec.red; # ForegroundNegative = thmDec.red;
ForegroundNeutral = thmDec.orange; # ForegroundNeutral = thmDec.orange;
ForegroundNormal = thmDec.fg; # ForegroundNormal = thmDec.fg;
ForegroundPositive = thmDec.green; # ForegroundPositive = thmDec.green;
ForegroundVisited = thmDec.gray; # ForegroundVisited = thmDec.gray;
}; # };
"Colors:Complementary" = { # "Colors:Complementary" = {
BackgroundAlternate = thmDec.dark; # BackgroundAlternate = thmDec.dark;
BackgroundNormal = thmDec.bg; # BackgroundNormal = thmDec.bg;
DecorationFocus = thmDec.alt; # DecorationFocus = thmDec.alt;
DecorationHover = thmDec.alt; # DecorationHover = thmDec.alt;
ForegroundActive = thmDec.orange; # ForegroundActive = thmDec.orange;
ForegroundInactive = thmDec.dark; # ForegroundInactive = thmDec.dark;
ForegroundLink = thmDec.blue; # ForegroundLink = thmDec.blue;
ForegroundNegative = thmDec.red; # ForegroundNegative = thmDec.red;
ForegroundNeutral = thmDec.yellow; # ForegroundNeutral = thmDec.yellow;
ForegroundNormal = thmDec.fg; # ForegroundNormal = thmDec.fg;
ForegroundPositive = thmDec.green; # ForegroundPositive = thmDec.green;
ForegroundVisited = thmDec.alt; # ForegroundVisited = thmDec.alt;
}; # };
"Colors:Selection" = { # "Colors:Selection" = {
BackgroundAlternate = thmDec.alt; # BackgroundAlternate = thmDec.alt;
BackgroundNormal = thmDec.alt; # BackgroundNormal = thmDec.alt;
DecorationFocus = thmDec.alt; # DecorationFocus = thmDec.alt;
DecorationHover = thmDec.alt; # DecorationHover = thmDec.alt;
ForegroundActive = thmDec.fg; # ForegroundActive = thmDec.fg;
ForegroundInactive = thmDec.fg; # ForegroundInactive = thmDec.fg;
ForegroundLink = thmDec.blue; # ForegroundLink = thmDec.blue;
ForegroundNegative = thmDec.red; # ForegroundNegative = thmDec.red;
ForegroundNeutral = thmDec.orange; # ForegroundNeutral = thmDec.orange;
ForegroundNormal = thmDec.fg; # ForegroundNormal = thmDec.fg;
ForegroundPositive = thmDec.green; # ForegroundPositive = thmDec.green;
ForegroundVisited = thmDec.alt; # ForegroundVisited = thmDec.alt;
}; # };
"Colors:Tooltip" = { # "Colors:Tooltip" = {
BackgroundAlternate = thmDec.dark; # BackgroundAlternate = thmDec.dark;
BackgroundNormal = thmDec.bg; # BackgroundNormal = thmDec.bg;
DecorationFocus = thmDec.alt; # DecorationFocus = thmDec.alt;
DecorationHover = thmDec.alt; # DecorationHover = thmDec.alt;
ForegroundActive = thmDec.alt; # ForegroundActive = thmDec.alt;
ForegroundInactive = thmDec.dark; # ForegroundInactive = thmDec.dark;
ForegroundLink = thmDec.blue; # ForegroundLink = thmDec.blue;
ForegroundNegative = thmDec.red; # ForegroundNegative = thmDec.red;
ForegroundNeutral = thmDec.orange; # ForegroundNeutral = thmDec.orange;
ForegroundNormal = thmDec.fg; # ForegroundNormal = thmDec.fg;
ForegroundPositive = thmDec.green; # ForegroundPositive = thmDec.green;
ForegroundVisited = thmDec.gray; # ForegroundVisited = thmDec.gray;
}; # };
"Colors:View" = { # "Colors:View" = {
BackgroundAlternate = thmDec.dark; # BackgroundAlternate = thmDec.dark;
BackgroundNormal = thmDec.bg; # BackgroundNormal = thmDec.bg;
DecorationFocus = thmDec.alt; # DecorationFocus = thmDec.alt;
DecorationHover = thmDec.alt; # DecorationHover = thmDec.alt;
ForegroundActive = thmDec.alt; # ForegroundActive = thmDec.alt;
ForegroundInactive = thmDec.dark; # ForegroundInactive = thmDec.dark;
ForegroundLink = thmDec.blue; # ForegroundLink = thmDec.blue;
ForegroundNegative = thmDec.red; # ForegroundNegative = thmDec.red;
ForegroundNeutral = thmDec.orange; # ForegroundNeutral = thmDec.orange;
ForegroundNormal = thmDec.fg; # ForegroundNormal = thmDec.fg;
ForegroundPositive = thmDec.green; # ForegroundPositive = thmDec.green;
ForegroundVisited = thmDec.gray; # ForegroundVisited = thmDec.gray;
}; # };
"Colors:Window" = { # "Colors:Window" = {
BackgroundAlternate = thmDec.dark; # BackgroundAlternate = thmDec.dark;
BackgroundNormal = thmDec.bg; # BackgroundNormal = thmDec.bg;
DecorationFocus = thmDec.alt; # DecorationFocus = thmDec.alt;
DecorationHover = thmDec.alt; # DecorationHover = thmDec.alt;
ForegroundActive = thmDec.alt; # ForegroundActive = thmDec.alt;
ForegroundInactive = thmDec.dark; # ForegroundInactive = thmDec.dark;
ForegroundLink = thmDec.blue; # ForegroundLink = thmDec.blue;
ForegroundNegative = thmDec.red; # ForegroundNegative = thmDec.red;
ForegroundNeutral = thmDec.orange; # ForegroundNeutral = thmDec.orange;
ForegroundNormal = thmDec.fg; # ForegroundNormal = thmDec.fg;
ForegroundPositive = thmDec.green; # ForegroundPositive = thmDec.green;
ForegroundVisited = thmDec.gray; # ForegroundVisited = thmDec.gray;
}; # };
General = { General = {
ColorScheme = "Generated"; ColorScheme = "Generated";
Name = "Generated"; Name = "Generated";

View File

@ -1,8 +0,0 @@
{ pkgs, config, lib, ... }: {
home-manager.users.alukard.programs.rofi = {
enable = true;
font = "Roboto Mono 14";
terminal = config.defaultApplications.term.cmd;
theme = "~/.cache/wal/colors-rofi-dark.rasi";
};
}

View File

@ -2,30 +2,31 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
home-manager.users.alukard = { home-manager.users.alukard = {
xresources.properties = with config.themes.colors; { xresources.properties = with config.lib.base16.theme; {
"*background" = bg; "*background" = "#${base00-hex}";
"*foreground" = fg; "*foreground" = "#${base05-hex}";
"*color0" = dark; "*color0" = "#${base00-hex}";
"*color1" = red; "*color1" = "#${base08-hex}";
"*color2" = green; "*color2" = "#${base0B-hex}";
"*color3" = yellow; "*color3" = "#${base0A-hex}";
"*color4" = blue; "*color4" = "#${base0D-hex}";
"*color5" = purple; "*color5" = "#${base0E-hex}";
"*color6" = cyan; "*color6" = "#${base0C-hex}";
"*color7" = fg; "*color7" = "#${base05-hex}";
"*color8" = dark; "*color8" = "#${base03-hex}";
"*color9" = red; "*color9" = "#${base09-hex}";
"*color10" = green; "*color10" = "#${base01-hex}";
"*color11" = yellow; "*color11" = "#${base02-hex}";
"*color12" = blue; "*color12" = "#${base04-hex}";
"*color13" = purple; "*color13" = "#${base06-hex}";
"*color14" = cyan; "*color14" = "#${base0F-hex}";
"*color15" = fg; "*color15" = "#${base07-hex}";
"*cursorColor" = "#${base05-hex}";
"URxvt.font" = "xft:Roboto Mono for Powerline:style=Regular:size=11"; "URxvt.font" = "xft:${powerlineFont}:style=Regular:size=11";
"URxvt.boldFont" = "xft:Roboto Mono for Powerline:style=Bold:size=11"; "URxvt.boldFont" = "xft:${powerlineFont}:style=Bold:size=11";
"URxvt.italicFont" = "xft:Roboto Mono for Powerline:style=Italic:size=11"; "URxvt.italicFont" = "xft:${powerlineFont}:style=Italic:size=11";
"URxvt.boldItalicfont" = "xft:Roboto Mono for Powerline:style=Bold Italic:size=11"; "URxvt.boldItalicfont" = "xft:${powerlineFont}:style=Bold Italic:size=11";
"URxvt.letterSpace" = "0"; "URxvt.letterSpace" = "0";
"URxvt.lineSpace" = "0"; "URxvt.lineSpace" = "0";
@ -46,12 +47,6 @@
"URxvt.keysym.Control-Down" = "\\033[1;5B"; "URxvt.keysym.Control-Down" = "\\033[1;5B";
"URxvt.keysym.Control-Right" = "\\033[1;5C"; "URxvt.keysym.Control-Right" = "\\033[1;5C";
"URxvt.keysym.Control-Left" = "\\033[1;5D"; "URxvt.keysym.Control-Left" = "\\033[1;5D";
}; };
# home.activation.xrdb = {
# after = ["linkGeneration"];
# before = [];
# data = "DISPLAY=:0 ${pkgs.xorg.xrdb}/bin/xrdb -merge ${config.users.users.alukard.home}/.Xresources";
# };
}; };
} }

View File

@ -43,7 +43,7 @@
"grep" = "rg"; "grep" = "rg";
# "mkdir" = "ad"; # "mkdir" = "ad";
"man" = "pinfo"; "man" = "pinfo";
"l" = "exa -lahgGF@ --git --group-directories-first"; "l" = "exa -lahgF@ --git --group-directories-first";
"tree" = "exa -T"; "tree" = "exa -T";
"ltree" = "exa -lhgFT@ --git"; "ltree" = "exa -lhgFT@ --git";
"atree" = "exa -aT"; "atree" = "exa -aT";

View File

@ -1,8 +1,11 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
let
thm = config.lib.base16.theme;
in
with rec { with rec {
inherit (config) deviceSpecific themes; inherit (config) deviceSpecific;
}; };
with deviceSpecific; with themes; { with deviceSpecific; {
services.xserver = { services.xserver = {
enable = true; enable = true;
@ -37,18 +40,18 @@ with deviceSpecific; with themes; {
show-input-cursor = false show-input-cursor = false
password-alignment = right password-alignment = right
[greeter-theme] [greeter-theme]
font = "Roboto Mono" font = "#${thm.font} Mono"
font-size = 14pt font-size = 14pt
text-color = "${colors.green}" text-color = "#${thm.base0B-hex}"
error-color = "${colors.green}" error-color = "#${thm.base0B-hex}"
background-image = "" background-image = ""
background-color = "${colors.bg}" background-color = "#${thm.base00-hex}"
window-color = "${colors.dark}" window-color = "#${thm.base01-hex}"
border-color = "${colors.blue}" border-color = "#${thm.base0D-hex}"
border-width = 1px border-width = 1px
layout-space = 14 layout-space = 14
password-color = "${colors.green}" password-color = "#${thm.base0B-hex}"
password-background-color = "${colors.bg}" password-background-color = "#${thm.base00-hex}"
''; '';
}; };
}; };

View File

@ -10,41 +10,41 @@
builtins.toString value; builtins.toString value;
in "${key}=${mvalue}"; in "${key}=${mvalue}";
}; };
thm = config.themes.colors; # thm = config.themes.colors;
splitHex = hexStr: # splitHex = hexStr:
map (x: builtins.elemAt x 0) (builtins.filter (a: a != "" && a != [ ]) # map (x: builtins.elemAt x 0) (builtins.filter (a: a != "" && a != [ ])
(builtins.split "(.{2})" (builtins.substring 1 6 hexStr))); # (builtins.split "(.{2})" (builtins.substring 1 6 hexStr)));
hex2decDigits = rec { # hex2decDigits = rec {
"0" = 0; # "0" = 0;
"1" = 1; # "1" = 1;
"2" = 2; # "2" = 2;
"3" = 3; # "3" = 3;
"4" = 4; # "4" = 4;
"5" = 5; # "5" = 5;
"6" = 6; # "6" = 6;
"7" = 7; # "7" = 7;
"8" = 8; # "8" = 8;
"9" = 9; # "9" = 9;
"a" = 10; # "a" = 10;
"b" = 11; # "b" = 11;
"c" = 12; # "c" = 12;
"d" = 13; # "d" = 13;
"e" = 14; # "e" = 14;
"f" = 15; # "f" = 15;
A = a; # A = a;
B = b; # B = b;
C = c; # C = c;
D = d; # D = d;
E = e; # E = e;
F = f; # F = f;
}; # };
doubleDigitHexToDec = hex: # doubleDigitHexToDec = hex:
16 * hex2decDigits."${builtins.substring 0 1 hex}" # 16 * hex2decDigits."${builtins.substring 0 1 hex}"
+ hex2decDigits."${builtins.substring 1 2 hex}"; # + hex2decDigits."${builtins.substring 1 2 hex}";
thmDec = builtins.mapAttrs (name: color: colorHex2Dec color) thm; # thmDec = builtins.mapAttrs (name: color: colorHex2Dec color) thm;
colorHex2Dec = color: # colorHex2Dec = color:
builtins.concatStringsSep "," # builtins.concatStringsSep ","
(map (x: toString (doubleDigitHexToDec x)) (splitHex color)); # (map (x: toString (doubleDigitHexToDec x)) (splitHex color));
} }

11
todo.md
View File

@ -1,7 +1,8 @@
# TODO # TODO
* i3 хоткеи на русской раскладке * i3 hotkeys with ru keyboard layout
* Добавить словарь * Add some dictionary program
* Spotifyd + cli * spotifyd + cli
* [Make i3status-rust theme](https://github.com/greshake/i3status-rust/blob/master/themes.md) * generated gtk icons
* make overlay * overlay for my packages
* separators and icons in i3status-rust