Clean home env

This commit is contained in:
soraefir
2026-06-14 10:39:32 +02:00
parent 577fd364fd
commit abce77a6a6
16 changed files with 125 additions and 123 deletions

View File

@@ -1,11 +1,9 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
sudo
ripgrep
unzip
socat
ripgrep
appimage-run

View File

@@ -1,7 +1,6 @@
{ config, lib, pkgs, ... }: {
home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship";
home.packages = with pkgs; [ starship ];
programs.starship = {
enable = true;
enableFishIntegration = false;

View File

@@ -1,26 +1,26 @@
{ lib, config, pkgs, ... }: {
config = lib.mkIf (config.syscfg.make.gui) {
home.packages = with pkgs; [
custom.vosk.base
jq
(python3.withPackages (ps: with ps; [ translatepy ]))
];
xdg.configFile."script/transcript-translate.py".text = ''
#!/bin/python
import sys;
from translatepy.translators.google import GoogleTranslate;
{ lib, config, pkgs, ... }:
let
translateScript = pkgs.writeTextFile {
name = "transcript-translate";
executable = true;
destination = "/bin/transcript-translate";
text = ''
#!${pkgs.python3.withPackages (ps: [ ps.translatepy ])}/bin/python3
import sys
from translatepy.translators.google import GoogleTranslate
if len(sys.argv) != 2:
print("No language provided.")
exit
exit(1)
translator = GoogleTranslate()
while True:
for line in sys.stdin:
sys.stdout.write(translator.translate(line,sys.argv[1]).result+"\n")
'';
};
in {
config = lib.mkIf (config.syscfg.make.gui) {
home.packages = [ pkgs.custom.vosk.base ];
xdg.configFile."script/transcript.sh".text = ''
#!/bin/sh
@@ -37,22 +37,22 @@
MODEL_OPTS+="$pair\n"
done
MODEL_OPT=$(echo -e "$MODEL_OPTS" | wofi --dmenu -p "Choose model:")
MODEL_OPT=$(echo -e "$MODEL_OPTS" | ${pkgs.wofi}/bin/wofi --dmenu -p "Choose model:")
MODEL=$(echo "$MODEL_OPT" | awk -F ':' '{print $2}')
TRANSS="None\nNone-prog\nEnglish\nGerman\nRussian\nJapanese"
TRANS=$(echo -e "$TRANSS" | wofi --dmenu -p "Choose translation:")
TRANS=$(echo -e "$TRANSS" | ${pkgs.wofi}/bin/wofi --dmenu -p "Choose translation:")
export VOSK_MODEL=$MODEL
case $TRANS in
"None")
${pkgs.custom.vosk.cli}/bin/voskcli 2>/dev/null | jq --unbuffered -r '.alternatives[0].text // empty | select(length > 0)' 2>/dev/null
${pkgs.custom.vosk.cli}/bin/voskcli 2>/dev/null | ${pkgs.jq}/bin/jq --unbuffered -r '.alternatives[0].text // empty | select(length > 0)' 2>/dev/null
;;
"None-prog")
${pkgs.custom.vosk.cli}/bin/voskcli 2>/dev/null | jq --unbuffered -r '.alternatives[0].text // empty, .partial // empty | select(length > 0)' 2>/dev/null
${pkgs.custom.vosk.cli}/bin/voskcli 2>/dev/null | ${pkgs.jq}/bin/jq --unbuffered -r '.alternatives[0].text // empty, .partial // empty | select(length > 0)' 2>/dev/null
;;
*)
${pkgs.custom.vosk.cli}/bin/voskcli 2>/dev/null | jq --unbuffered -r '.alternatives[0].text // empty | select(length > 0)' | python ~/.config/script/transcript-translate.py $TRANS
${pkgs.custom.vosk.cli}/bin/voskcli 2>/dev/null | ${pkgs.jq}/bin/jq --unbuffered -r '.alternatives[0].text // empty | select(length > 0)' | ${translateScript}/bin/transcript-translate "$TRANS"
;;
esac
'';

View File

@@ -31,8 +31,6 @@ in {
platformTheme.name = "gtk";
};
home.packages = [ wallpaperGen pkgs.awww ];
xdg.configFile."script/wallpaper.sh".text = ''
#!/bin/sh
@@ -50,7 +48,7 @@ in {
IMG=$WPDIR/$(echo "$RES" | wofi --dmenu --allow-images show-icons true -theme-str '#window { width: 50%; }' -p "Choose wallpaper:")
IMG=$(echo "$IMG" | awk -F ':' '{print $2}')
awww img $IMG
${pkgs.awww}/bin/awww img $IMG
'';
};
}

View File

@@ -54,7 +54,7 @@
sticky_history = "yes";
history_length = "20";
dmenu = "wofi --show dmenu -p dunst:";
dmenu = "${pkgs.wofi}/bin/wofi --show dmenu -p dunst:";
browser = "/usr/bin/xdg-open";
always_run_script = "true";
title = "Dunst";

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
eww close popup 2>/dev/null
hyprpicker -a

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
eww close popup 2>/dev/null
swaylock

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env bash
DIR="$HOME/Pictures/Screenshots"
mkdir -p "$DIR"
FILE="$DIR/$(date +%Y-%m-%d_%H-%M-%S).png"
grim -g "$(slurp)" "$FILE" && wl-copy < "$FILE"
eww close popup 2>/dev/null
sleep 0.15
hyprshot -m region --raw | satty --filename - --early-exit --action-on-enter save-to-clipboard --copy-command wl-copy

View File

@@ -89,8 +89,8 @@
(quick-btn :icon "󰌵" :label "Night Light" :onclick "eww update night-light=$(scripts/nightlight)" :active {night-light}))
(box :orientation "h" :space-evenly true
(quick-btn :icon "󰹑" :label "Screenshot" :onclick "scripts/screenshot" :active false)
(quick-btn :icon "󰌾" :label "Lock" :onclick "swaylock" :active false)
(quick-btn :icon "󱉨" :label "Color Pick" :onclick "hyprpicker -a" :active false)))))
(quick-btn :icon "󰌾" :label "Lock" :onclick "scripts/lock" :active false)
(quick-btn :icon "󱉨" :label "Color Pick" :onclick "scripts/color-pick" :active false)))))
; --- Brightness ---

View File

@@ -12,56 +12,90 @@ let
exec ${lib.getExe pkgs.eww} open "$window" "$@"
'';
# Wraps a static script file with a bash launcher that prepends Nix store
# bin dirs to PATH — keeps the source files unchanged.
mkScript = name: src: inputs: pkgs.writeShellScriptBin name ''
export PATH="${lib.makeBinPath inputs}:$PATH"
${builtins.readFile src}
'';
scripts = {
"scripts/brightness" = mkScript "brightness" ./bar/scripts/brightness [ pkgs.brightnessctl ];
"scripts/nightlight" = mkScript "nightlight" ./bar/scripts/nightlight [ pkgs.wlsunset ];
"scripts/panel-toggle" = mkScript "panel-toggle" ./bar/scripts/panel-toggle [ pkgs.eww pkgs.jq ];
"scripts/power-save" = mkScript "power-save" ./bar/scripts/power-save [ pkgs.eww ];
"scripts/radio" = mkScript "radio" ./bar/scripts/radio [ pkgs.eww pkgs.jq pkgs.curl pkgs.mpv pkgs.playerctl ];
"scripts/color-pick" = mkScript "color-pick" ./bar/scripts/color-pick [ pkgs.eww pkgs.hyprpicker ];
"scripts/lock" = mkScript "lock" ./bar/scripts/lock [ pkgs.eww pkgs.swaylock-effects ];
"scripts/screenshot" = mkScript "screenshot" ./bar/scripts/screenshot [ pkgs.eww pkgs.hyprshot pkgs.satty pkgs.wl-clipboard ];
"scripts/sys/gpu" = mkScript "gpu" ./bar/scripts/sys/gpu [ pkgs.custom.amdgpu_top pkgs.jq ];
"scripts/sys/memory" = mkScript "memory" ./bar/scripts/sys/memory [ pkgs.ripgrep ];
"scripts/volume" = mkScript "volume" ./bar/scripts/volume [ pkgs.ripgrep ];
"scripts/weather" = mkScript "weather" ./bar/scripts/weather [ pkgs.jq pkgs.curl ];
"scripts/workspaces" = mkScript "workspaces" ./bar/scripts/workspaces [ pkgs.jaq pkgs.socat pkgs.ripgrep ];
};
in {
config = lib.mkIf (config.usercfg.wm == "Wayland") {
home.packages = with pkgs; [ eww jq jaq custom.amdgpu_top openOnCurrentScreen ];
home.packages = [ pkgs.eww openOnCurrentScreen ];
xdg.configFile."eww" = {
source = lib.cleanSourceWith {
filter = name: _type:
let baseName = baseNameOf (toString name);
in !(lib.hasSuffix ".nix" baseName) && (baseName != "_colors.scss");
src = lib.cleanSource ./bar/.;
};
xdg.configFile = lib.mkMerge [
{
"eww" = {
source = lib.cleanSourceWith {
filter = name: _type:
let
baseName = baseNameOf (toString name);
relPath = lib.removePrefix (toString ./bar + "/") (toString name);
in !(lib.hasSuffix ".nix" baseName)
&& (baseName != "_colors.scss")
&& !(builtins.elem relPath (builtins.attrNames scripts));
src = lib.cleanSource ./bar/.;
};
recursive = true;
};
recursive = true;
};
# colors file
xdg.configFile."eww/css/_colors.scss".text = ''
$base00: #${config.colorScheme.palette.base00};
$base01: #${config.colorScheme.palette.base01};
$base02: #${config.colorScheme.palette.base02};
$base03: #${config.colorScheme.palette.base03};
$base04: #${config.colorScheme.palette.base04};
$base05: #${config.colorScheme.palette.base05};
$base06: #${config.colorScheme.palette.base06};
$base07: #${config.colorScheme.palette.base07};
$base08: #${config.colorScheme.palette.base08};
$base09: #${config.colorScheme.palette.base09};
$base0A: #${config.colorScheme.palette.base0A};
$base0B: #${config.colorScheme.palette.base0B};
$base0C: #${config.colorScheme.palette.base0C};
$base0D: #${config.colorScheme.palette.base0D};
$base0E: #${config.colorScheme.palette.base0E};
$base0F: #${config.colorScheme.palette.base0F};
"eww/css/_colors.scss".text = ''
$base00: #${config.colorScheme.palette.base00};
$base01: #${config.colorScheme.palette.base01};
$base02: #${config.colorScheme.palette.base02};
$base03: #${config.colorScheme.palette.base03};
$base04: #${config.colorScheme.palette.base04};
$base05: #${config.colorScheme.palette.base05};
$base06: #${config.colorScheme.palette.base06};
$base07: #${config.colorScheme.palette.base07};
$base08: #${config.colorScheme.palette.base08};
$base09: #${config.colorScheme.palette.base09};
$base0A: #${config.colorScheme.palette.base0A};
$base0B: #${config.colorScheme.palette.base0B};
$base0C: #${config.colorScheme.palette.base0C};
$base0D: #${config.colorScheme.palette.base0D};
$base0E: #${config.colorScheme.palette.base0E};
$base0F: #${config.colorScheme.palette.base0F};
$fg: $base07;
$bg0: $base00;
$bg1: $base01;
$fg: $base07;
$bg0: $base00;
$bg1: $base01;
$border-color: $base03;
$border-color-focus: $base04;
$border-radius: ${config.colorScheme.palette.border-radius}px;
$border-width: ${config.colorScheme.palette.border-width}px;
$border-color: $base03;
$border-color-focus: $base04;
$border-radius: ${config.colorScheme.palette.border-radius}px;
$border-width: ${config.colorScheme.palette.border-width}px;
$gaps-screen: ${config.colorScheme.palette.gaps-screen}px;
$gaps-window: ${config.colorScheme.palette.gaps-window}px;
$gaps-screen: ${config.colorScheme.palette.gaps-screen}px;
$gaps-window: ${config.colorScheme.palette.gaps-window}px;
$panel-font-size: 10pt;
$popup-scale: 1.25;
'';
$panel-font-size: 10pt;
$popup-scale: 1.25;
'';
}
(lib.mapAttrs' (rel: drv: {
name = "eww/${rel}";
value.source = "${drv}/bin/${drv.name}";
}) scripts)
];
};
}

View File

@@ -19,8 +19,6 @@ let
in {
config = lib.mkIf (config.usercfg.wm == "Wayland") {
home.packages = [ pkgs.custom.amdgpu_top pkgs.jq ];
programs.waybar = {
enable = true;
package = pkgs.waybar;
@@ -203,8 +201,7 @@ in {
"custom/gpu" = {
"exec" = jsonOutput "gpu" {
tooltip = "...";
percentage = ''
$(amdgpu_top -J -n 1 | jq -r '.devices[0].GRBM2."Command Processor - Graphics".value')'';
percentage = ''$(${lib.getExe pkgs.custom.amdgpu_top} -J -n 1 | ${pkgs.jq}/bin/jq -r '.devices[0].GRBM2."Command Processor - Graphics".value')'';
};
"return-type" = "json";
"interval" = 5;

View File

@@ -1,8 +1,6 @@
{ lib, pkgs, config, ... }: {
config = lib.mkIf (config.usercfg.wm == "Wayland") {
home.packages = with pkgs; [ swayidle swaylock-effects ];
xdg.configFile."swaylock/config".text = ''
screenshots
grace-no-mouse

View File

@@ -1,7 +1,6 @@
{ lib, config, pkgs, ... }: {
config = lib.mkIf (config.usercfg.wm == "Wayland") {
home.packages = with pkgs; [ wofi ];
xdg.configFile."wofi/config".text = ''
width=280
lines=10

View File

@@ -1,41 +1,17 @@
{ lib, config, pkgs, ... }:
let
dbus-hyprland-environment = pkgs.writeTextFile {
name = "dbus-hyprland-environment";
destination = "/bin/dbus-hyprland-environment";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=hyprland
systemctl --user stop pipewire wireplumber xdg-desktop-portal-hyprland xdg-desktop-portal-gtk
systemctl --user start pipewire wireplumber xdg-desktop-portal-hyprland xdg-desktop-portal-gtk
'';
};
in {
{ lib, config, pkgs, ... }: {
config = lib.mkIf (config.usercfg.wm == "Wayland") {
home.packages = with pkgs; [
dbus-hyprland-environment
wayland
hyprpicker
hyprshot
slurp
satty
swappy
cliphist
wl-clipboard
wlr-randr
wdisplays
kanshi
glib
brightnessctl
awww
playerctl
];
xdg.mimeApps = {

View File

@@ -24,8 +24,8 @@
startupScript = pkgs.writeShellScriptBin "hyprland-start" ''
eww open bar &
awww-daemon &
${pkgs.eww}/bin/eww open bar &
${pkgs.awww}/bin/awww-daemon &
sleep 2
keepassxc &
@@ -52,9 +52,9 @@ in {
function()
hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP")
hl.exec_cmd("${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1")
hl.exec_cmd("wl-paste --type text --watch cliphist store")
hl.exec_cmd("wl-paste --type image --watch cliphist store")
hl.exec_cmd("swayidle -w timeout 600 'swaylock' before-sleep 'swaylock'")
hl.exec_cmd("${pkgs.wl-clipboard}/bin/wl-paste --type text --watch ${lib.getExe pkgs.cliphist} store")
hl.exec_cmd("${pkgs.wl-clipboard}/bin/wl-paste --type image --watch ${lib.getExe pkgs.cliphist} store")
hl.exec_cmd("${lib.getExe pkgs.swayidle} -w timeout 600 '${pkgs.swaylock-effects}/bin/swaylock' before-sleep '${pkgs.swaylock-effects}/bin/swaylock'")
hl.exec_cmd("${lib.getExe startupScript}")
hl.exec_cmd("[workspace special:magic silent] kitty --title flying_kitty")
end'')
@@ -293,11 +293,11 @@ in {
(bind "SUPER + F" dsp.fullscreen)
(bind "SUPER + P" dsp.pseudo)
(bind "SUPER + J" (dsp.layout "togglesplit"))
(bind "SUPER + D" (dsp.exec "wofi -modi --show drun"))
(bind "SUPER + D" (dsp.exec "${lib.getExe pkgs.wofi} -modi --show drun"))
(bind "SUPER + SHIFT + D" (dsp.exec "~/.config/hypr/themes/apatheia/eww/launch_bar"))
(bind "SUPER + V" (dsp.exec "cliphist list | wofi -dmenu | cliphist decode | wl-copy"))
(bind "PRINT" (dsp.exec "hyprshot -m region --raw | satty --filename - --early-exit --action-on-enter save-to-clipboard --copy-command 'wl-copy'"))
(bind "SUPER + L" (dsp.exec "swaylock"))
(bind "SUPER + V" (dsp.exec "${lib.getExe pkgs.cliphist} list | ${lib.getExe pkgs.wofi} -dmenu | ${lib.getExe pkgs.cliphist} decode | ${pkgs.wl-clipboard}/bin/wl-copy"))
(bind "PRINT" (dsp.exec "${lib.getExe pkgs.hyprshot} -m region --raw | ${lib.getExe pkgs.satty} --filename - --early-exit --action-on-enter save-to-clipboard --copy-command '${pkgs.wl-clipboard}/bin/wl-copy'"))
(bind "SUPER + L" (dsp.exec "${pkgs.swaylock-effects}/bin/swaylock"))
(bind "SUPER + left" (dsp.focus "left"))
(bind "SUPER + right" (dsp.focus "right"))
(bind "SUPER + up" (dsp.focus "up"))
@@ -325,14 +325,14 @@ in {
(bind "SUPER + SHIFT + 9" (dsp.moveToWorkspace 9))
(bind "SUPER + 0" (dsp.focusWorkspace 0))
(bind "SUPER + SHIFT + 0" (dsp.moveToWorkspace 0))
(bind "XF86AudioPlay" (dsp.exec "playerctl play-pause"))
(bind "XF86AudioPrev" (dsp.exec "playerctl previous"))
(bind "XF86AudioNext" (dsp.exec "playerctl next"))
(bind "XF86AudioPlay" (dsp.exec "${lib.getExe pkgs.playerctl} play-pause"))
(bind "XF86AudioPrev" (dsp.exec "${lib.getExe pkgs.playerctl} previous"))
(bind "XF86AudioNext" (dsp.exec "${lib.getExe pkgs.playerctl} next"))
(bindOpts "XF86AudioRaiseVolume" (dsp.exec "amixer -q sset 'Master' 5%+") { locked = true; repeating = true; })
(bindOpts "XF86AudioLowerVolume" (dsp.exec "amixer -q sset 'Master' 5%-") { locked = true; repeating = true; })
(bindOpts "XF86AudioMute" (dsp.exec "amixer -q sset 'Master' toggle") { locked = true; })
(bindOpts "XF86MonBrightnessUp" (dsp.exec "brightnessctl s 5%+") { locked = true; repeating = true; })
(bindOpts "XF86MonBrightnessDown" (dsp.exec "brightnessctl s 5%-") { locked = true; repeating = true; })
(bindOpts "XF86MonBrightnessUp" (dsp.exec "${lib.getExe pkgs.brightnessctl} s 5%+") { locked = true; repeating = true; })
(bindOpts "XF86MonBrightnessDown" (dsp.exec "${lib.getExe pkgs.brightnessctl} s 5%-") { locked = true; repeating = true; })
(bindOpts "SUPER + mouse:272" dsp.drag { mouse = true; })
(bindOpts "SUPER + mouse:273" dsp.resize { mouse = true; })
];

View File

@@ -1,7 +1,5 @@
{ config, pkgs, ... }: {
home.packages = with pkgs; [ xdg-user-dirs ];
xdg.enable = true;
xdg.userDirs.enable = true;
xdg.userDirs.desktop = "${config.home.homeDirectory}/desktop";