1

Compare commits

..

23 Commits

Author SHA1 Message Date
150959a8f1 Lib: Add color functions 2024-10-14 17:13:53 +02:00
cde73d530e Lib: Add library template 2024-10-14 17:13:53 +02:00
80ed6dfdc2 Waybar: Highlight current workspace 2024-10-14 17:13:53 +02:00
d02e5b9fe5 Home: Fix remaining name qualifications after module update 2024-10-14 17:13:53 +02:00
5a5cb72f42 Rofi: Update colorscheme 2024-10-14 17:13:53 +02:00
7da63bf09a Color: Move schemes to own folder 2024-10-14 17:13:53 +02:00
242bd67562 Home: Update HM module template + apply changes to modules 2024-10-14 17:13:53 +02:00
6ef826b03a Hyprland: Move rofi keybindings into rofi module + update rofi styling 2024-10-14 17:13:53 +02:00
b2cd460c11 Neovim: Update colorscheme 2024-10-14 17:13:53 +02:00
962fc533ea Waybar: Update colorscheme 2024-10-14 17:13:53 +02:00
ab12bed918 Rofi: Update colorscheme + menus 2024-10-14 17:13:53 +02:00
18ebac0059 Waybar: Update styling 2024-10-14 17:13:53 +02:00
cc193972c2 Hyprland: Add keybind to lock session 2024-10-14 17:13:53 +02:00
52a80ad815 Neovim: Byte-compile init.lua 2024-10-14 17:13:53 +02:00
b7f1538560 Hyprland: Update hyprpicker shortcuts 2024-10-14 17:13:53 +02:00
bfd54c89e6 Hyprland: Update groupbar colorscheme 2024-10-14 17:13:53 +02:00
7bddc6a15f Neovim: Update lualine colorscheme 2024-10-14 17:13:53 +02:00
a007ffe542 Hyprland: Update dunst normal notification frame 2024-10-14 17:13:53 +02:00
3c69eb5124 Kitty: Update colorscheme to match neovim's lualine 2024-10-14 17:13:53 +02:00
dd21ce0e0b Ags: Switch back to waybar for now
Until I figure out how to theme this thing
2024-10-14 17:13:53 +02:00
782d2dacac Ags: Add starter config 2024-10-14 17:13:53 +02:00
f5919a8389 Neovim: Add typescript LSP support 2024-10-14 17:13:53 +02:00
646889a4a2 System: Cleanup default.nix 2024-10-14 17:13:53 +02:00
4 changed files with 155 additions and 17 deletions

View File

@ -101,17 +101,19 @@ 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};}
#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};}
#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};}
/*Square Widgets*/
#custom-launcher,
@ -119,7 +121,6 @@ in {
#tray {
padding: 0px 10px 0px 10px;
border-radius: 6px;
color: #${color.light.base};
}
/*Rectangle Widgets*/
@ -146,17 +147,12 @@ 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;
}

View File

@ -0,0 +1,8 @@
{
inputs,
pkgs,
lib,
...
}: rec {
templateLibFunction = args: "${args}";
}

133
lib/color.nix Normal file
View File

@ -0,0 +1,133 @@
{
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;
}

View File

@ -12,4 +12,5 @@
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;};
}