From 8e5dbe6711c0df1302000350cde44d4c8dbd7c74 Mon Sep 17 00:00:00 2001 From: elyth Date: Sun, 1 Sep 2024 15:34:24 +0200 Subject: [PATCH] :fire: (bin): remove useless --- modules/home/core/home.nix | 2 +- modules/home/core/nixpkgs.nix | 5 +- modules/home/opt/bin/default.nix | 21 --- modules/home/opt/bin/theme/material.nix | 135 ----------------- modules/home/opt/bin/theme/materialpy.nix | 151 ------------------- modules/home/opt/bin/zellij/zellij-start.nix | 12 -- modules/home/opt/utils/git/default.nix | 2 +- 7 files changed, 6 insertions(+), 322 deletions(-) delete mode 100644 modules/home/opt/bin/theme/material.nix delete mode 100644 modules/home/opt/bin/theme/materialpy.nix delete mode 100644 modules/home/opt/bin/zellij/zellij-start.nix diff --git a/modules/home/core/home.nix b/modules/home/core/home.nix index 80a5f695..a263c251 100644 --- a/modules/home/core/home.nix +++ b/modules/home/core/home.nix @@ -120,7 +120,7 @@ syncthing t-rec tailspin - teams-for-linux + # teams-for-linux telegram-desktop teleport tldr diff --git a/modules/home/core/nixpkgs.nix b/modules/home/core/nixpkgs.nix index d04ada4a..1c29b591 100644 --- a/modules/home/core/nixpkgs.nix +++ b/modules/home/core/nixpkgs.nix @@ -1,6 +1,9 @@ { nixpkgs.config = { - permittedInsecurePackages = [ "electron-25.9.0" ]; + permittedInsecurePackages = [ + "electron-25.9.0" + "electron-29.4.6" + ]; allowUnfree = true; allowBroken = true; allowUnfreePredicate = _: true; diff --git a/modules/home/opt/bin/default.nix b/modules/home/opt/bin/default.nix index bbc83bcb..4d45e540 100644 --- a/modules/home/opt/bin/default.nix +++ b/modules/home/opt/bin/default.nix @@ -10,23 +10,6 @@ executable = true; text = import ./eyecandy/nixfetch.nix { }; }; - ".local/bin/waylock" = lib.mkIf (config.default.de == "hyprland") { - executable = true; - text = '' - #!/bin/sh - playerctl pause - sleep 0.2 - swaylock -i ${config.wallpaper} --effect-blur 10x10 - ''; - }; - ".local/bin/material" = { - executable = true; - text = import ./theme/material.nix { }; - }; - ".local/bin/materialpy" = { - executable = true; - text = import ./theme/materialpy.nix { }; - }; ".local/bin/powermenu" = { executable = true; text = import ./rofiscripts/powermenu.nix { }; @@ -55,10 +38,6 @@ executable = true; text = import ./rofiscripts/screenshot.nix { }; }; - ".local/bin/zs" = { - executable = true; - text = import ./zellij/zellij-start.nix { }; - }; }; }; } diff --git a/modules/home/opt/bin/theme/material.nix b/modules/home/opt/bin/theme/material.nix deleted file mode 100644 index fdf52930..00000000 --- a/modules/home/opt/bin/theme/material.nix +++ /dev/null @@ -1,135 +0,0 @@ -_: '' - #!/usr/bin/env python - import sys - import os - import subprocess - import json - import os - - home = os.environ['HOME'] - themefile = sys.argv[1] - - def getExtension(file): - return file.split(".")[-1] - - def runCommand(cmd): - c = subprocess.run(cmd.split(" "), stdout=subprocess.PIPE) - return c.stdout.decode('utf-8') - - def darken_hex_color(hex_color, percentage): - hex_color = hex_color.lstrip("#") - rgb = tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) - darkened_rgb = tuple(int(value * (1 - percentage / 100)) for value in rgb) - darkened_hex = "#{:02x}{:02x}{:02x}".format(*darkened_rgb) - - return darkened_hex - - def lighten_hex_color(hex_color, percentage): - hex_color = hex_color.lstrip("#") - rgb = tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) - lightened_rgb = tuple(int(value + (255 - value) * (percentage / 100)) for value in rgb) - lightened_hex = "#{:02x}{:02x}{:02x}".format(*lightened_rgb) - - return lightened_hex - - if os.path.isfile(themefile): - if not os.path.exists(f"{home}/.cache/wallpapers/"): - os.makedirs(f"{home}/.cache/wallpapers/") - if os.path.isfile(f"{home}/.cache/wallpapers/material.jpg"): - os.remove(f"{home}/.cache/wallpapers/material.jpg") - newfile = f'{home}/.cache/wallpapers/material.jpg' - subprocess.run(["convert", themefile, newfile]) - - colors = json.loads(runCommand(f'matugen --dry-run image {newfile} --json hex' )) - colors = colors["colors"]["dark"] - colmap = { - "background": lighten_hex_color(colors["surface_container_lowest"], 2), - "darker": darken_hex_color(colors["surface_container_lowest"], 30), - "mbg": darken_hex_color(colors["surface_container"], 15), - "foreground": colors["inverse_surface"], - "red": colors["error"], - "comment":colors['outline'], - "darkred": darken_hex_color(colors["error"],10), - "orange": colors["on_error_container"], - "darkorange": darken_hex_color(colors["on_error_container"],10), - "cyan": colors["source_color"], - "darkcyan": darken_hex_color(colors["source_color"],10), - "green": colors["on_primary_container"], - "darkgreen": darken_hex_color(colors["on_primary_container"],10), - "magenta": colors["primary_fixed"], - "darkmagenta": darken_hex_color(colors["primary_fixed"],10), - "blue": lighten_hex_color(colors["primary"], 15), - "darkblue": lighten_hex_color(colors["primary"],12), - "accent": colors["primary"], - } - with open('/etc/nixos/home/shared/cols/material.nix', 'w') as file: - text=f"""{{}}: - rec {{ - foreground = "{colmap['foreground'][1:]}"; - background = "{colmap['background'][1:]}"; - darker = "{colmap['darker'][1:]}"; - accent = "{colmap['accent'][1:]}"; - mbg = "{colmap['mbg'][1:]}"; - - cursorColor = "{colmap['foreground'][1:]}"; - comment = "{colors['outline'][1:]}"; - - color0 = "{colors['surface_container'][1:]}"; - color8 = "{colors['surface_container'][1:]}"; - - color1 = "{colmap['darkred'][1:]}"; - color9 = "{colmap['red'][1:]}"; - - color2 = "{colmap['darkgreen'][1:]}"; - color10 = "{colmap['green'][1:]}"; - - color3 = "{colmap['darkorange'][1:]}"; - color11 = "{colmap['orange'][1:]}"; - - color4 = "{colmap['darkblue'][1:]}"; - color12 = "{colmap['blue'][1:]}"; - - color5 = "{colmap['darkmagenta'][1:]}"; - color13 = "{colmap['magenta'][1:]}"; - - color6 = "{colmap['darkcyan'][1:]}"; - color14 = "{colmap['cyan'][1:]}"; - - color7 = "{colors['secondary_fixed'][1:]}"; - color15 = "{colors['secondary_fixed'][1:]}"; - name = "material"; - }} - """ - file.write(text) - with open(f'{home}/.config/nvim/lua/core/materia.lua', 'w') as file: - text=f"""return {{ - comment = "{colmap['comment']}", - background = "{colmap['background']}", - darker = "{colmap['darker']}", - black = "{colmap['background']}", - foreground = "{colmap['foreground']}", - cursorline = "{colmap['mbg']}", - cursor = "{colmap['foreground']}", - color0 = "{colors['surface_container']}", - color1 = "{colmap['darkred']}", - color2 = "{colmap['darkgreen']}", - color3 = "{colmap['darkorange']}", - color4 = "{colmap['darkblue']}", - color5 = "{colmap['darkmagenta']}", - color6 = "{colmap['darkcyan']}", - color7 = "{colors['secondary_fixed']}", - color8 = "{colors['surface_container']}", - color9 = "{colmap['red']}", - color10 = "{colmap['green']}", - color11 = "{colmap['orange']}", - color12 = "{colmap['blue']}", - color13 = "{colmap['magenta']}", - color14 = "{colmap['cyan']}", - color15 = "{colors['secondary_fixed']}", - name = "material" - }} - """ - file.write(text) - print(colors) - print(colmap) -'' diff --git a/modules/home/opt/bin/theme/materialpy.nix b/modules/home/opt/bin/theme/materialpy.nix deleted file mode 100644 index 80c17eaf..00000000 --- a/modules/home/opt/bin/theme/materialpy.nix +++ /dev/null @@ -1,151 +0,0 @@ -_: '' - #!/usr/bin/env python - from material_color_utilities_python import * - import sys - import subprocess - import os - - home = os.environ['HOME'] - themefile = sys.argv[1] - - def getExtension(file): - return file.split(".")[-1] - - def darken(hex_color, percentage): - hex_color = hex_color.lstrip("#") - rgb = tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) - darkened_rgb = tuple(int(value * (1 - percentage / 100)) for value in rgb) - darkened_hex = "#{:02x}{:02x}{:02x}".format(*darkened_rgb) - - return darkened_hex - - def lighten(hex_color, percentage): - hex_color = hex_color.lstrip("#") - rgb = tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) - lightened_rgb = tuple(int(value + (255 - value) * (percentage / 100)) for value in rgb) - lightened_hex = "#{:02x}{:02x}{:02x}".format(*lightened_rgb) - - return lightened_hex - - if not os.path.isfile(themefile): - exit() - - if not os.path.exists(f"{home}/.cache/wallpapers/"): - os.makedirs(f"{home}/.cache/wallpapers/") - if os.path.isfile(f"{home}/.cache/wallpapers/material.jpg"): - os.remove(f"{home}/.cache/wallpapers/material.jpg") - newfile = f'{home}/.cache/wallpapers/material.jpg' - subprocess.run(["convert", themefile, newfile]) - - image = Image.open(newfile) - colors = themeFromSourceColor(sourceColorFromImage(image)) - colorscheme = colors.get('schemes').get('dark') - - colmap = { - "primary" : hexFromArgb(colorscheme.get_primary()), - "onPrimary" : hexFromArgb(colorscheme.get_onPrimary()), - "primaryContainer" : hexFromArgb(colorscheme.get_primaryContainer()), - "onPrimaryContainer" : hexFromArgb(colorscheme.get_onPrimaryContainer()), - "secondary" : hexFromArgb(colorscheme.get_secondary()), - "onSecondary" : hexFromArgb(colorscheme.get_onSecondary()), - "secondaryContainer" : hexFromArgb(colorscheme.get_secondaryContainer()), - "onSecondaryContainer" : hexFromArgb(colorscheme.get_onSecondaryContainer()), - "tertiary" : hexFromArgb(colorscheme.get_tertiary()), - "onTertiary" : hexFromArgb(colorscheme.get_onTertiary()), - "tertiaryContainer" : hexFromArgb(colorscheme.get_tertiaryContainer()), - "onTertiaryContainer" : hexFromArgb(colorscheme.get_onTertiaryContainer()), - "error" : hexFromArgb(colorscheme.get_error()), - "onError" : hexFromArgb(colorscheme.get_onError()), - "errorContainer" : hexFromArgb(colorscheme.get_errorContainer()), - "onErrorContainer" : hexFromArgb(colorscheme.get_onErrorContainer()), - "background" : darken(hexFromArgb(colorscheme.get_background()), 0.6), - "onBackground" : hexFromArgb(colorscheme.get_onBackground()), - "surface" : hexFromArgb(colorscheme.get_surface()), - "onSurface" : hexFromArgb(colorscheme.get_onSurface()), - "surfaceVariant" : hexFromArgb(colorscheme.get_surfaceVariant()), - "onSurfaceVariant" : hexFromArgb(colorscheme.get_onSurfaceVariant()), - "outline" : hexFromArgb(colorscheme.get_outline()), - "shadow" : hexFromArgb(colorscheme.get_shadow()), - "inverseSurface" : hexFromArgb(colorscheme.get_inverseSurface()), - "inverseOnSurface" : hexFromArgb(colorscheme.get_inverseOnSurface()), - "inversePrimary" : hexFromArgb(colorscheme.get_inversePrimary()), - } - - with open('/etc/nixos/home/shared/cols/material.nix', 'w') as file: - text=f"""{{}}: - rec {{ - foreground = "{colmap['onBackground'][1:]}"; - background = "{darken(colmap['background'], 10)[1:]}"; - darker = "{darken(colmap['background'], 20)[1:]}"; - accent = "{colmap['onPrimaryContainer'][1:]}"; - mbg = "{lighten(colmap['background'], 5)[1:]}"; - - cursorColor = "{colmap['onBackground'][1:]}"; - comment = "{colmap['surfaceVariant'][1:]}"; - - color0 = "{colmap['surface'][1:]}"; - color8 = "{colmap['inverseOnSurface'][1:]}"; - - color1 = "{colmap['error'][1:]}"; - color9 = "{darken(colmap['error'], 0.3)[1:]}"; - - color2 = "{lighten(colmap['inversePrimary'], 10)[1:]}"; - color10 = "{lighten(colmap['inversePrimary'], 10)[1:]}"; - - color3 = "{colmap['onErrorContainer'][1:]}"; - color11 = "{darken(colmap['onErrorContainer'], 0.2)[1:]}"; - - color4 = "{darken(colmap['onPrimaryContainer'], 16)[1:]}"; - color12 = "{darken(colmap['onPrimaryContainer'], 16)[1:]}"; - - color5 = "{colmap['tertiary'][1:]}"; - color13 = "{colmap['tertiary'][1:]}"; - - color6 = "{colmap['primary'][1:]}"; - color14 = "{colmap['primary'][1:]}"; - - color7 = "{colmap['inverseSurface'][1:]}"; - color15 = "{colmap['inverseSurface'][1:]}"; - name = "material"; - }} - """ - file.write(text) - with open(f'{home}/.config/nvim/lua/core/material.lua', 'w') as file: - text=f"""return {{ - foreground = "{colmap['onBackground']}", - background = "{colmap['background']}", - black = "{colmap['background']}", - darker = "{darken(colmap['background'], 20)}", - cusorline = "{lighten(colmap['background'], 5)}", - - cursor = "{colmap['onBackground']}", - comment = "{colmap['surfaceVariant']}", - - color0 = "{colmap['surface']}", - color8 = "{colmap['inverseOnSurface']}", - - color1 = "{colmap['error']}", - color9 = "{darken(colmap['error'], 0.3)}", - - color2 = "{lighten(colmap['inversePrimary'], 20)}", - color10 = "{lighten(colmap['inversePrimary'], 20)}", - - color3 = "{colmap['onErrorContainer']}", - color11 = "{darken(colmap['onErrorContainer'], 0.2)}", - - color4 = "{darken(colmap['onPrimaryContainer'], 16)}", - color12 = "{darken(colmap['onPrimaryContainer'], 16)}", - - color5 = "{colmap['tertiary']}", - color13 = "{colmap['tertiary']}", - - color6 = "{colmap['primary']}", - color14 = "{colmap['primary']}", - - color7 = "{colmap['inverseSurface']}", - color15 = "{colmap['inverseSurface']}", - name = "material" - }} - """ - file.write(text) -'' diff --git a/modules/home/opt/bin/zellij/zellij-start.nix b/modules/home/opt/bin/zellij/zellij-start.nix deleted file mode 100644 index 7995f506..00000000 --- a/modules/home/opt/bin/zellij/zellij-start.nix +++ /dev/null @@ -1,12 +0,0 @@ -_: '' - #!/usr/bin/env bash - ZJ_SESSIONS=$(zellij list-sessions -s -n) - NO_SESSIONS=$(echo "$ZJ_SESSIONS" | wc -l) - - if [ "$NO_SESSIONS" -ge 2 ]; then - zellij attach \ - "$(echo "$ZJ_SESSIONS" | sk)" - else - zellij attach -c - fi -'' diff --git a/modules/home/opt/utils/git/default.nix b/modules/home/opt/utils/git/default.nix index 28c0c037..20580014 100644 --- a/modules/home/opt/utils/git/default.nix +++ b/modules/home/opt/utils/git/default.nix @@ -8,7 +8,7 @@ signing = { signByDefault = true; - key = "34DA47B5677E214D"; + key = "9F4EED9AA75B3045"; }; ignores = [