Compare commits
20 Commits
150959a8f1
...
ceef76d991
| Author | SHA1 | Date | |
|---|---|---|---|
| ceef76d991 | |||
| 06d474928f | |||
| 0f13646636 | |||
| 6e2922589a | |||
| 380d692ea3 | |||
| 5a6a8eb149 | |||
| ab65bbe308 | |||
| 51913fd4c4 | |||
| fcdf59d9d0 | |||
| f3c25baada | |||
| 7d188cc507 | |||
| 60ed556d07 | |||
| 892bcdb070 | |||
| 8fc71a6f15 | |||
| 5995a22a1d | |||
| 559d6712ad | |||
| ff04d048ee | |||
| 41f6770688 | |||
| 7894259bfe | |||
| f1661eb6e0 |
@ -101,19 +101,17 @@ in {
|
||||
}
|
||||
|
||||
/*Colors*/
|
||||
#custom-launcher {background-color: #${color.dark.lavender};}
|
||||
#user {background-color: #${color.dark.pink};}
|
||||
#window {background-color: #${color.dark.mauve};}
|
||||
#workspaces button {background-color: #${color.dark.lavender};}
|
||||
#workspaces button.active {background-color: #${color.dark.sapphire};}
|
||||
#pulseaudio {background-color: #${color.dark.maroon};}
|
||||
#network {background-color: #${color.dark.peach};}
|
||||
#cpu {background-color: #${color.dark.yellow};}
|
||||
#memory {background-color: #${color.dark.green};}
|
||||
#temperature {background-color: #${color.dark.teal};}
|
||||
#clock {background-color: #${color.dark.sky};}
|
||||
#tray {background-color: #${color.dark.lavender};}
|
||||
|
||||
#custom-launcher {background-color: #${color.dark.lavender};}
|
||||
#user {background-color: #${color.dark.pink};}
|
||||
#window {background-color: #${color.dark.mauve};}
|
||||
#workspaces button {background-color: #${color.dark.lavender};}
|
||||
#pulseaudio {background-color: #${color.dark.maroon};}
|
||||
#network {background-color: #${color.dark.peach};}
|
||||
#cpu {background-color: #${color.dark.yellow};}
|
||||
#memory {background-color: #${color.dark.green};}
|
||||
#temperature {background-color: #${color.dark.teal};}
|
||||
#clock {background-color: #${color.dark.sky};}
|
||||
#tray {background-color: #${color.dark.lavender};}
|
||||
|
||||
/*Square Widgets*/
|
||||
#custom-launcher,
|
||||
@ -121,6 +119,7 @@ in {
|
||||
#tray {
|
||||
padding: 0px 10px 0px 10px;
|
||||
border-radius: 6px;
|
||||
color: #${color.light.base};
|
||||
}
|
||||
|
||||
/*Rectangle Widgets*/
|
||||
@ -147,12 +146,17 @@ in {
|
||||
font-size: 26px;
|
||||
padding-right: 10px;
|
||||
margin: 0px 5px 0px 0px;
|
||||
color: #${color.light.text};
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
margin: 0px 5px 0px 5px;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
color: #${color.light.pink};
|
||||
}
|
||||
|
||||
#tray {
|
||||
margin: 0px 0px 0px 5px;
|
||||
}
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: rec {
|
||||
templateLibFunction = args: "${args}";
|
||||
}
|
||||
133
lib/color.nix
133
lib/color.nix
@ -1,133 +0,0 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
# This code was blatantly stolen from here:
|
||||
# https://github.com/Misterio77/nix-colors/blob/b92df8f5eb1fa20d8e09810c03c9dc0d94ef2820/lib/core/conversions.nix#L87
|
||||
hexToDecMap = {
|
||||
"0" = 0;
|
||||
"1" = 1;
|
||||
"2" = 2;
|
||||
"3" = 3;
|
||||
"4" = 4;
|
||||
"5" = 5;
|
||||
"6" = 6;
|
||||
"7" = 7;
|
||||
"8" = 8;
|
||||
"9" = 9;
|
||||
"a" = 10;
|
||||
"b" = 11;
|
||||
"c" = 12;
|
||||
"d" = 13;
|
||||
"e" = 14;
|
||||
"f" = 15;
|
||||
};
|
||||
|
||||
pow = base: exponent: let
|
||||
inherit (nixpkgs-lib) mod;
|
||||
in
|
||||
if exponent > 1
|
||||
then let
|
||||
x = pow base (exponent / 2);
|
||||
odd_exp = mod exponent 2 == 1;
|
||||
in
|
||||
x
|
||||
* x
|
||||
* (
|
||||
if odd_exp
|
||||
then base
|
||||
else 1
|
||||
)
|
||||
else if exponent == 1
|
||||
then base
|
||||
else if exponent == 0 && base == 0
|
||||
then throw "undefined"
|
||||
else if exponent == 0
|
||||
then 1
|
||||
else throw "undefined";
|
||||
|
||||
base16To10 = exponent: scalar: scalar * (pow 16 exponent);
|
||||
|
||||
hexCharToDec = hex: let
|
||||
inherit (nixpkgs-lib) toLower;
|
||||
lowerHex = toLower hex;
|
||||
in
|
||||
if builtins.stringLength hex != 1
|
||||
then throw "Function only accepts a single character."
|
||||
else if hexToDecMap ? ${lowerHex}
|
||||
then hexToDecMap."${lowerHex}"
|
||||
else throw "Character ${hex} is not a hexadecimal value.";
|
||||
in rec {
|
||||
/*
|
||||
Converts from hexadecimal to decimal.
|
||||
|
||||
Type: hexToDec :: string -> int
|
||||
|
||||
Args:
|
||||
hex: A hexadecimal string.
|
||||
|
||||
Example:
|
||||
hexadecimal "12"
|
||||
=> 18
|
||||
hexadecimal "FF"
|
||||
=> 255
|
||||
hexadecimal "abcdef"
|
||||
=> 11259375
|
||||
*/
|
||||
hexToDec = hex: let
|
||||
inherit (lib) stringToCharacters reverseList imap0 foldl;
|
||||
decimals = builtins.map hexCharToDec (stringToCharacters hex);
|
||||
decimalsAscending = reverseList decimals;
|
||||
decimalsPowered = imap0 base16To10 decimalsAscending;
|
||||
in
|
||||
foldl builtins.add 0 decimalsPowered;
|
||||
|
||||
/*
|
||||
Converts a 6 character hexadecimal string to RGB values.
|
||||
|
||||
Type: hexToRGB :: string => [int]
|
||||
|
||||
Args:
|
||||
hex: A hexadecimal string of length 6.
|
||||
|
||||
Example:
|
||||
hexToRGB "012345"
|
||||
=> [ 1 35 69 ]
|
||||
hexToRGB "abcdef"
|
||||
=> [171 205 239 ]
|
||||
hexToRGB "000FFF"
|
||||
=> [ 0 15 255 ]
|
||||
*/
|
||||
hexToRGB = hex: let
|
||||
rgbStartIndex = [0 2 4];
|
||||
hexList = builtins.map (x: builtins.substring x 2 hex) rgbStartIndex;
|
||||
hexLength = builtins.stringLength hex;
|
||||
in
|
||||
if hexLength != 6
|
||||
then
|
||||
throw ''
|
||||
Unsupported hex string length of ${builtins.toString hexLength}.
|
||||
Length must be exactly 6.
|
||||
''
|
||||
else builtins.map hexToDec hexList;
|
||||
|
||||
/*
|
||||
Converts a 6 character hexadecimal string to an RGB string seperated by a
|
||||
delimiter.
|
||||
|
||||
Type: hexToRGBString :: string -> string
|
||||
|
||||
Args:
|
||||
sep: The delimiter or seperator.
|
||||
hex: A hexadecimal string of length 6.
|
||||
*/
|
||||
hexToRGBString = sep: hex: let
|
||||
inherit (builtins) map toString;
|
||||
inherit (nixpkgs-lib) concatStringsSep;
|
||||
hexInRGB = hexToRGB hex;
|
||||
hexInRGBString = map toString hexInRGB;
|
||||
in
|
||||
concatStringsSep sep hexInRGBString;
|
||||
}
|
||||
@ -12,5 +12,4 @@
|
||||
networking = import ./networking.nix {inherit inputs pkgs lib;};
|
||||
rofi = import ./rofi.nix {inherit inputs pkgs lib;};
|
||||
generators = import ./generators.nix {inherit inputs pkgs lib;};
|
||||
color = import ./color.nix {inherit inputs pkgs lib;};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user