[flameshot] feat: flameshot > grimblast hacky script

This commit is contained in:
Simon Cornet 2024-06-20 16:34:13 +02:00
parent 021a05bf0e
commit 0b26225806
8 changed files with 30 additions and 63 deletions

View File

@ -1,61 +0,0 @@
#!/usr/bin/env bash
# commands
wofi_command="wofi -l 5"
grimblast="grimblast --notify"
satty="satty --filename - --fullscreen --output-filename /home/simon/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png"
# buttons
area="🖥️ Capture area"
area_5="🖥️ Capture area in 5 seconds"
screen="🖥️ Capture whole screen"
screen_5="🖥️ Capture whole screen in 10 seconds"
window="🖥️ Capture active window"
# take shots
screenshot_area() {
$grimblast save area - | $satty
}
screenshot_area_5() {
sleep 5
$grimblast save area - | $satty
}
screenshot_full() {
$grimblast save screen - | $satty
}
screenshot_full_5() {
sleep 5
$grimblast save screen - | $satty
}
screenshot_window() {
$grimblast save active - | $satty
}
# start wofi
options="$area\n$area_5\n$screen\n$screen_5\n$window"
chosen="$(echo -e "$options" | $wofi_command -p 'Say cheese ...' -dmenu --no-action --width=400 --height=302 -selected-row 0 --style=/home/simon/.dotfiles/apps/wofi/style.css)"
sleep 1
case $chosen in
$area)
screenshot_area
;;
$area_5)
screenshot_area_5
;;
$screen)
screenshot_full
;;
$screen_5)
screenshot_full_5
;;
$window)
screenshot_window
;;
esac

View File

@ -5,6 +5,7 @@
imports = [ imports = [
./alacritty ./alacritty
./clipse ./clipse
./flameshot
./git ./git
./hyprland ./hyprland
./mako ./mako

View File

@ -0,0 +1 @@
{ ... }: { imports = [ ./flameshot.nix ]; }

View File

@ -0,0 +1,19 @@
{ config, ... }:
{
# include flameshot configs
home.file.".config/flameshot/flameshot.ini".text = ''
[General]
contrastOpacity=188
contrastUiColor=#528bff
checkForUpdates=false
drawFontSize=8
drawThickness=3
uiColor=#043a8b
savePath=/home/simon/Pictures/Screenshots/
showHelp=false
showStartupLaunchMessage=false
'';
}

View File

@ -27,8 +27,7 @@
"$mainMod, N, exec, alacritty --class nmtui --command ~/.dotfiles/apps/hyprland/nmtui.sh" "$mainMod, N, exec, alacritty --class nmtui --command ~/.dotfiles/apps/hyprland/nmtui.sh"
"$mainMod, P, exec, ~/.dotfiles/apps/hyprland/hypridle.sh toggle" "$mainMod, P, exec, ~/.dotfiles/apps/hyprland/hypridle.sh toggle"
"$mainMod, Q, killactive" "$mainMod, Q, killactive"
"$mainMod, S, exec, ~/.dotfiles/apps/screenshot/screenshot.sh area" "$mainMod, S, exec, XDG_CURRENT_DESKTOP=sway flameshot gui -c -p /home/simon/Pictures/Screenshots"
"ALT SHIFT, S, exec, ~/.dotfiles/apps/screenshot/screenshot.sh screen"
"$mainMod, T, exec, alacritty --class nostt --command nostt" "$mainMod, T, exec, alacritty --class nostt --command nostt"
"$mainMod, V, togglefloating" "$mainMod, V, togglefloating"

View File

@ -52,6 +52,9 @@
# nextcloud desktop # nextcloud desktop
"~/.dotfiles/apps/hyprland/startup/nextcloud_desktop.sh" "~/.dotfiles/apps/hyprland/startup/nextcloud_desktop.sh"
# flameshot
"XDG_CURRENT_DESKTOP=sway flameshot"
# start default apps # start default apps
"[workspace 1 silent] bitwarden" "[workspace 1 silent] bitwarden"
"[workspace 2 silent] firefox" "[workspace 2 silent] firefox"

View File

@ -37,6 +37,10 @@
"size 1000 800, class:(clipse)" "size 1000 800, class:(clipse)"
"move center, class:(clipse)" "move center, class:(clipse)"
# flameshot
"float, class:^(flameshot)$"
"noanim, class:^(flameshot)$"
# save as # save as
"float, title:(Save As)" "float, title:(Save As)"
"size 1000 800, title:(Save As)" "size 1000 800, title:(Save As)"

View File

@ -22,6 +22,7 @@
# hyprland # hyprland
adwaita-qt adwaita-qt
brightnessctl brightnessctl
flameshot
grim grim
grimblast grimblast
hyprlock hyprlock