Compare commits

...

3 commits

5 changed files with 68 additions and 7 deletions

View file

@ -14,7 +14,7 @@ in
./hypridle.nix ./hypridle.nix
./hyprland.nix ./hyprland.nix
./hyprlock.nix ./hyprlock.nix
./hyprshot.nix # ./hyprshot.nix
# hyprpaper seems to be broken with out of memory and failure to swap wallpapers correctly. # hyprpaper seems to be broken with out of memory and failure to swap wallpapers correctly.
# Use swww for now until the application is stable. # Use swww for now until the application is stable.
# ./hyprpaper.nix # ./hyprpaper.nix
@ -22,6 +22,7 @@ in
./rofi.nix ./rofi.nix
./waybar.nix ./waybar.nix
./wlogout.nix ./wlogout.nix
./grimblast.nix
# ./swappy.nix # ./swappy.nix
./alacritty.nix ./alacritty.nix
./swayosd.nix ./swayosd.nix
@ -40,7 +41,7 @@ in
pasystray pasystray
graphicsmagick graphicsmagick
pkgs.swayosd swayosd
image-roll # image viewer image-roll # image viewer
]; ];

View file

@ -0,0 +1,53 @@
{
config,
lib,
pkgs,
inputs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.meta) getExe;
cfg = config.profile.hyprland;
saveDir = "${config.home.homeDirectory}/Pictures/screenshots";
grimblast = inputs.hyprland-contrib.packages.${pkgs.system}.grimblast;
script =
mode:
pkgs.writeShellScriptBin "grimblast-${mode}.sh" ''
mkdir -p "${saveDir}/original" "${saveDir}/edit"
file=$(date +%Y-%m-%d_%H%M%S).png
filename=${saveDir}/original/$file
${grimblast}/bin/grimblast save ${mode} "$filename"
action=$(notify-send --icon="$filename" --app-name="grimblast" --action="copy=Copy" --action="edit=Edit" --action="delete=Delete" "Grimblast" "Screenshot saved to $filename")
case $action in
"copy")
wl-copy < "$filename"
notify-send --icon="$filename" --app-name="grimblast" "Grimblast" "Screenshot copied to clipboard"
;;
"edit")
satty --save-after-copy --filename "$filename" --fullscreen --output-filename "${saveDir}/edit/$(date +%Y-%m-%d_%H%M%S).png"
;;
"delete")
rm "$filename"
notify-send --app-name="grimblast" "Grimblast" "Screenshot $filename deleted"
;;
esac
'';
saveAreaScript = script "area";
saveOutputScript = script "output";
in
{
config = mkIf cfg.enable {
home.packages = [
grimblast
pkgs.satty
pkgs.libnotify
];
wayland.windowManager.hyprland.settings.bind = [
", PRINT, exec, ${getExe saveAreaScript}"
"$mod, PRINT, exec, ${getExe saveOutputScript}"
];
};
}

View file

@ -175,6 +175,13 @@ in
forward_to = [prometheus.remote_write.mimir.receiver] forward_to = [prometheus.remote_write.mimir.receiver]
} }
prometheus.exporter.self "alloy" {}
prometheus.scrape "alloy" {
targets = prometheus.exporter.self.alloy.targets
forward_to = [prometheus.remote_write.mimir.receiver]
}
prometheus.scrape "caddy" { prometheus.scrape "caddy" {
targets = [{ targets = [{
__address__ = "localhost:2019", __address__ = "localhost:2019",

View file

@ -101,15 +101,15 @@ in
[ ] [ ]
++ (optional config.services.tempo.enable { ++ (optional config.services.tempo.enable {
datasourceUid = "tempo"; datasourceUid = "tempo";
matcherRegex = ''traceID=(\\w+)''; matcherRegex = ''trace_?[Ii][Dd]=(\w+)'';
name = "TraceID"; name = "Log Trace";
url = "$\${__value.raw}"; url = "$\${__value.raw}";
urlDisplayLabel = "Trace"; urlDisplayLabel = "Trace";
}) })
++ (optional config.services.tempo.enable { ++ (optional config.services.tempo.enable {
datasourceUid = "tempo"; datasourceUid = "tempo";
matcherRegex = ''"trace_id":"(\\w+)"''; matcherRegex = ''"trace_?[Ii][Dd]":"(\w+)"'';
name = "TraceID"; name = "Trace";
url = "$\${__value.raw}"; url = "$\${__value.raw}";
urlDisplayLabel = "Trace"; urlDisplayLabel = "Trace";
}); });

View file

@ -28,7 +28,7 @@ in
multitenancy_enabled = false; multitenancy_enabled = false;
server = { server = {
http_listen_address = "0.0.0.0"; http_listen_address = "0.0.0.0";
http_listen_port = 4400; http_listen_port = 9009;
grpc_listen_port = 4401; grpc_listen_port = 4401;
}; };