Compare commits

..

3 commits

5 changed files with 68 additions and 7 deletions

View file

@ -14,7 +14,7 @@ in
./hypridle.nix
./hyprland.nix
./hyprlock.nix
./hyprshot.nix
# ./hyprshot.nix
# hyprpaper seems to be broken with out of memory and failure to swap wallpapers correctly.
# Use swww for now until the application is stable.
# ./hyprpaper.nix
@ -22,6 +22,7 @@ in
./rofi.nix
./waybar.nix
./wlogout.nix
./grimblast.nix
# ./swappy.nix
./alacritty.nix
./swayosd.nix
@ -40,7 +41,7 @@ in
pasystray
graphicsmagick
pkgs.swayosd
swayosd
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]
}
prometheus.exporter.self "alloy" {}
prometheus.scrape "alloy" {
targets = prometheus.exporter.self.alloy.targets
forward_to = [prometheus.remote_write.mimir.receiver]
}
prometheus.scrape "caddy" {
targets = [{
__address__ = "localhost:2019",

View file

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

View file

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