fixes
parent
eeda91a6ac
commit
2839b1a2a8
@ -1 +1 @@
|
||||
ssh://nixremote@seras.kyouma.net x86_64-linux,aarch64-linux - 40 2 nixos-test,benchmark,big-parallel,kvm
|
||||
ssh://nixremote@seras.kyouma.net x86_64-linux,aarch64-linux - 40 5 nixos-test,benchmark,big-parallel,kvm
|
||||
|
@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
color=$(grim -g "`slurp -b 20262C00 -p`" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- | tail -n1 | cut -d' ' -f4)
|
||||
image=/tmp/${color}.png
|
||||
|
||||
main() {
|
||||
if [[ "$color" ]]; then
|
||||
# copy color code to clipboard
|
||||
echo $color | tr -d "\n" | wl-copy
|
||||
# generate preview
|
||||
convert -size 48x48 xc:"$color" ${image}
|
||||
# notify about it
|
||||
notify-send -h string:x-canonical-private-synchronous:sys-notify-picker -u low -i ${image} "$color, copied to clipboard."
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
@ -1,78 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
iDIR="$HOME/.config/mako-icons"
|
||||
|
||||
time=`date +%Y-%m-%d-%H-%M-%S`
|
||||
dir="$HOME/Pictures/screenshots"
|
||||
file="${time}.png"
|
||||
|
||||
# notify and view screenshot
|
||||
notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:sys-notify-shot -u low -i ${iDIR}/picture.png"
|
||||
notify_view () {
|
||||
${notify_cmd_shot} "Copied to clipboard."
|
||||
paplay /usr/share/sounds/freedesktop/stereo/screen-capture.oga &>/dev/null &
|
||||
image-roll "${dir}/$file"
|
||||
if [[ -e "$dir/$file" ]]; then
|
||||
${notify_cmd_shot} "Screenshot Saved."
|
||||
else
|
||||
${notify_cmd_shot} "Screenshot Deleted."
|
||||
fi
|
||||
}
|
||||
|
||||
# countdown
|
||||
countdown () {
|
||||
for sec in `seq $1 -1 1`; do
|
||||
notify-send -h string:x-canonical-private-synchronous:sys-notify-count -t 1000 -i "$iDIR"/timer.png "Taking shot in : $sec"
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
# take shots
|
||||
shotnow () {
|
||||
cd ${dir} && sleep 0.5 && grim - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shot5 () {
|
||||
countdown '5'
|
||||
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shot10 () {
|
||||
countdown '10'
|
||||
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotwin () {
|
||||
w_pos=`hyprctl activewindow | grep 'at:' | cut -d':' -f2 | tr -d ' ' | tail -n1`
|
||||
w_size=`hyprctl activewindow | grep 'size:' | cut -d':' -f2 | tr -d ' ' | tail -n1 | sed s/,/x/g`
|
||||
cd ${dir} && grim -g "$w_pos $w_size" - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotarea () {
|
||||
cd ${dir} && grim -g "$(slurp -b 20262CCC -c B4A1DBff -s B4A1DB0D -w 2 && sleep 0.3)" - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
if [[ "$1" == "--now" ]]; then
|
||||
shotnow
|
||||
elif [[ "$1" == "--in5" ]]; then
|
||||
shot5
|
||||
elif [[ "$1" == "--in10" ]]; then
|
||||
shot10
|
||||
elif [[ "$1" == "--win" ]]; then
|
||||
shotwin
|
||||
elif [[ "$1" == "--area" ]]; then
|
||||
shotarea
|
||||
else
|
||||
echo -e "Available Options : --now --in5 --in10 --win --area"
|
||||
fi
|
||||
|
||||
exit 0
|
@ -0,0 +1,87 @@
|
||||
{ pkgs, inputs, ... }: {
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
home-manager.users.emily.home.file.".local/bin/hypr/colorpicker.sh" = {
|
||||
enable = true;
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/${pkgs.bash}/bin/bash
|
||||
color=$(${pkgs.grim}/bin/grim -g "`${pkgs.slurp}/bin/slurp -b 20262C00 -p`" -t ppm - | \
|
||||
${pkgs.imagemagick_light}/bin/convert - -format '%[pixel:p{0,0}]' txt:- | \
|
||||
${pkgs.coreutils}/bin/tail -n1 | ${pkgs.coreutils}/bin/cut -d' ' -f4)
|
||||
image=/tmp/''${color}.png
|
||||
main() {
|
||||
if [[ "$color" ]]; then
|
||||
${pkgs.coreutils}/bin/echo $color | ${pkgs.coreutils}/bin/tr -d "\n" | ${pkgs.wl-clipboard}/bin/wl-copy
|
||||
${pkgs.imagemagick_light}/bin/convert -size 48x48 xc:"$color" ''${image}
|
||||
${pkgs.libnotify}/bin/notify-send -h string:x-canonical-private-synchronous:sys-notify-picker -u low -i ''${image} "$color, copied to clipboard."
|
||||
fi
|
||||
}
|
||||
main
|
||||
'';
|
||||
};
|
||||
home-manager.users.emily.home.file.".local/bin/hypr/screenshot.sh" = let
|
||||
cu = "${pkgs.coreutils}/bin";
|
||||
grim = "${pkgs.grim}/bin/grim";
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
paplay = "${pkgs.pulseaudio}/bin/paplay";
|
||||
slurp = "${pkgs.slurp}/bin/slurp";
|
||||
image-roll = "${pkgs.image-roll}/bin/image-roll";
|
||||
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
||||
in {
|
||||
enable = true;
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/${pkgs.bash}/bin/bash
|
||||
iDIR="$HOME/.config/mako-icons"
|
||||
time=`${cu}/date +%Y-%m-%d-%H-%M-%S`
|
||||
dir="$HOME/Pictures/screenshots"
|
||||
file="''${time}.png"
|
||||
|
||||
notify_cmd_shot="${notify-send} -h string:x-canonical-private-synchronous:sys-notify-shot -u low -i ''${iDIR}/picture.png"
|
||||
notify_view () {
|
||||
''${notify_cmd_shot} "Copied to clipboard."
|
||||
${paplay} /usr/share/sounds/freedesktop/stereo/screen-capture.oga &>/dev/null &
|
||||
${image-roll} "''${dir}/$file"
|
||||
if [[ -e "$dir/$file" ]]; then
|
||||
''${notify_cmd_shot} "Screenshot Saved."
|
||||
else
|
||||
''${notify_cmd_shot} "Screenshot Deleted."
|
||||
fi
|
||||
}
|
||||
countdown () {
|
||||
for sec in `${cu}/seq $1 -1 1`; do
|
||||
${notify-send} -h string:x-canonical-private-synchronous:sys-notify-count -t 1000 -i "$iDIR"/timer.png "Taking shot in : $sec"
|
||||
${cu}/sleep 1
|
||||
done
|
||||
}
|
||||
shotnow () {
|
||||
cd ''${dir} && ${cu}/sleep 0.5 && ${grim} - | ${cu}/tee "$file" | ${wl-copy}
|
||||
notify_view
|
||||
}
|
||||
shotarea () {
|
||||
cd ''${dir} && ${grim} -g "$(${slurp} -b 20262CCC -c B4A1DBff -s B4A1DB0D -w 2 && ${cu}/sleep 0.3)" - | ${cu}/tee "$file" | ${wl-copy}
|
||||
notify_view
|
||||
}
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
${cu}/mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
if [[ "$1" == "--now" ]]; then
|
||||
shotnow
|
||||
elif [[ "$1" == "--in5" ]]; then
|
||||
countdown '5'
|
||||
shotnow
|
||||
elif [[ "$1" == "--in10" ]]; then
|
||||
countdown '10'
|
||||
shotnow
|
||||
elif [[ "$1" == "--area" ]]; then
|
||||
shotarea
|
||||
else
|
||||
echo -e "Available Options : --now --in5 --in10 --area"
|
||||
fi
|
||||
exit 0
|
||||
'';
|
||||
};
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
{ config, lib, ... }: with lib; {
|
||||
kyouma.machine-type.headless = true;
|
||||
documentation.man.generateCaches = false;
|
||||
services.openssh.enable = mkDefault true;
|
||||
services.vnstat.enable = mkDefault true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue