authorgravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-10-30 19:17:25-07:00
committergravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-10-30 19:17:25-07:00
loga4898824baec822428b5b531ddd26a479146a2be
treef96d8447a4e94e839d558d1dfd25c57fae4272b1
parent5a4dc3b0c38ce3a1e14ec94a6988fa085297feb4
signature Commit is signed but in an unrecognized format.

feat (natalie): add screenshot util, and with it a method for converting a folder of shell scripts into nix programs.


6 files changed, 68 insertions(+), 6 deletions(-)

users/natalie/home/default.nix+1
......@@ -7,5 +7,6 @@
77 ./swaync.nix
88 ./gtk.nix
99 ./waybar
10 ./scripts
1011 ];
1112}
users/natalie/home/hyprland/binds.nix+2-2
......@@ -1,4 +1,4 @@
1{ ... }:
1{ pkgs, ... }:
22{
33 wayland.windowManager.hyprland.settings = {
44 binds = {
......@@ -10,7 +10,7 @@
1010 "$mainMod, F1, exec, show-keybinds"
1111
1212 # keybindings
13 "$mainMod, Return, exec, ghostty --gtk-single-instance=true"
13 "$mainMod, Return, exec, ${pkgs.ghostty}/bin/ghostty --gtk-single-instance=true"
1414 "$mainMod, P, pseudo,"
1515 "$mainMod, C, killactive,"
1616 "$mainMod, M, exit, "
users/natalie/home/hyprland/hyprland.nix+1-1
......@@ -12,11 +12,11 @@
1212 wf-recorder
1313 glib
1414 wayland
15 direnv
1615 playerctl
1716 waybar
1817 networkmanagerapplet
1918 hyprpolkitagent
19 swappy
2020 ];
2121 # systemd.user.targets.hyprland-session.Unit.Wants = [
2222 # "xdg-desktop-autostart.target"
users/natalie/home/scripts/default.nix created+26
......@@ -0,0 +1,26 @@
1{ pkgs, ... }:
2let
3 scriptDir = ./scripts;
4
5 mkScript = name: {
6 inherit name;
7 value = pkgs.writeScriptBin (builtins.replaceStrings [ ".sh" ] [ "" ] name) (
8 builtins.readFile (scriptDir + "/${name}")
9 );
10 };
11
12 scriptsSet = builtins.listToAttrs (
13 map mkScript (
14 builtins.attrNames (
15 pkgs.lib.filterAttrs (n: v: v == "regular" && (pkgs.lib.hasSuffix ".sh" n)) (
16 builtins.readDir ./scripts
17 )
18 )
19 )
20 );
21 scripts = builtins.attrValues scriptsSet;
22
23in
24{
25 home.packages = scripts;
26}
users/natalie/home/scripts/scripts/screenshot.sh created+34
......@@ -0,0 +1,34 @@
1#!/usr/bin/env bash
2
3dir="$HOME/Pictures/Screenshots"
4time=$(date +'%Y_%m_%d_at_%Hh%Mm%Ss')
5file="${dir}/Screenshot_${time}.png"
6
7copy() {
8 GRIMBLAST_HIDE_CURSOR=0 grimblast --notify --freeze copy area
9}
10
11save() {
12 GRIMBLAST_HIDE_CURSOR=0 grimblast --notify --freeze save area "$file"
13}
14
15swappy_() {
16 GRIMBLAST_HIDE_CURSOR=0 grimblast --notify --freeze save area "$file"
17 swappy -f "$file"
18}
19
20if [[ ! -d "$dir" ]]; then
21 mkdir -p "$dir"
22fi
23
24if [[ "$1" == "--copy" ]]; then
25 copy
26elif [[ "$1" == "--save" ]]; then
27 save
28elif [[ "$1" == "--swappy" ]]; then
29 swappy_
30else
31 echo -e "Available Options: --copy --save --swappy"
32fi
33
34exit 0
users/natalie/home/waybar/settings.nix+4-3
......@@ -45,6 +45,7 @@ in
4545 "hyprland/language"
4646 "tray"
4747 "custom/notification"
48 "custom/power-menu"
4849 ];
4950 clock = {
5051 calendar = {
......@@ -77,19 +78,19 @@ in
7778 format = "<span foreground='${green}'> </span> {usage}%";
7879 format-alt = "<span foreground='${green}'> </span> {avg_frequency} GHz";
7980 interval = 2;
80 on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --override font_size=14 --title float_ghostty btop'";
81 on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --font-size=14 -e btop'";
8182 };
8283 memory = {
8384 format = "<span foreground='${cyan}'>󰟜 </span>{}%";
8485 format-alt = "<span foreground='${cyan}'>󰟜 </span>{used} GiB"; # 
8586 interval = 2;
86 on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --override font_size=14 --title float_ghostty btop'";
87 on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --font-size=14 -e btop'";
8788 };
8889 disk = {
8990 # path = "/";
9091 format = "<span foreground='${orange}'>󰋊 </span>{percentage_used}%";
9192 interval = 60;
92 on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --override font_size=14 --title float_ghostty btop'";
93 on-click-right = "${pkgs.hyprland}/bin/hyprctl dispatch exec '[float; center; size 950 650] ${pkgs.ghostty}/bin/ghostty --font-size=14 -e btop'";
9394 };
9495 network = {
9596 format-wifi = "<span foreground='${magenta}'> </span> {signalStrength}%";