formated whole config with alejandra

This commit is contained in:
Tomas Rivera
2026-03-08 19:02:23 +01:00
parent 0564b1d418
commit 5be7198efe
52 changed files with 3724 additions and 3623 deletions
+63 -60
View File
@@ -1,79 +1,82 @@
# useless
# used to come from my old dotfiles which were copied from fedora-hyprdots
# just use hyprpicker | tee >(wl-copy) | cliphist store
# because hyprpicker and cliphist are inside my configuration.nix
# no need to verify their existence
{ writeShellApplication, hyprpicker, libnotify, toybox, wl-clipboard, ... }:
{
writeShellApplication,
hyprpicker,
libnotify,
toybox,
wl-clipboard,
...
}:
writeShellApplication {
name = "custom-colorpicker-useless";
runtimeInputs = [
hyprpicker
libnotify
toybox
wl-clipboard
];
text = ''
check() {
command -v "$1" 1>/dev/null
}
name = "custom-colorpicker-useless";
runtimeInputs = [
hyprpicker
libnotify
toybox
wl-clipboard
];
text = ''
check() {
command -v "$1" 1>/dev/null
}
notify() {
check notify-send && {
notify-send -a "Color Picker" "$@"
return
}
echo "$@"
}
notify() {
check notify-send && {
notify-send -a "Color Picker" "$@"
return
}
echo "$@"
}
loc="$HOME/.cache/colorpicker"
[ -d "$loc" ] || mkdir -p "$loc"
[ -f "$loc/colors" ] || touch "$loc/colors"
loc="$HOME/.cache/colorpicker"
[ -d "$loc" ] || mkdir -p "$loc"
[ -f "$loc/colors" ] || touch "$loc/colors"
limit=10
limit=10
[[ $# -eq 1 && $1 = "-l" ]] && {
cat "$loc/colors"
exit
}
[[ $# -eq 1 && $1 = "-l" ]] && {
cat "$loc/colors"
exit
}
[[ $# -eq 1 && $1 = "-j" ]] && {
text="$(head -n 1 "$loc/colors")"
[[ $# -eq 1 && $1 = "-j" ]] && {
text="$(head -n 1 "$loc/colors")"
mapfile -t allcolors < <(tail -n +2 "$loc/colors")
# allcolors=($(tail -n +2 "$loc/colors"))
tooltip="<b> COLORS</b>\n\n"
mapfile -t allcolors < <(tail -n +2 "$loc/colors")
# allcolors=($(tail -n +2 "$loc/colors"))
tooltip="<b> COLORS</b>\n\n"
tooltip+="-> <b>$text</b> <span color='$text'>󰸌</span> \n"
for i in "''${allcolors[@]}"; do
tooltip+=" <b>$i</b> <span color='$i'>󰸌</span> \n"
done
tooltip+="-> <b>$text</b> <span color='$text'>󰸌</span> \n"
for i in "''${allcolors[@]}"; do
tooltip+=" <b>$i</b> <span color='$i'>󰸌</span> \n"
done
cat <<EOF
{ "text":"<span color='$text'>󰸌</span>", "tooltip":"$tooltip"}
EOF
cat <<EOF
{ "text":"<span color='$text'>󰸌</span>", "tooltip":"$tooltip"}
EOF
exit
}
exit
}
check hyprpicker || {
notify "hyprpicker is not installed"
exit
}
killall -q hyprpicker
color=$(hyprpicker)
check hyprpicker || {
notify "hyprpicker is not installed"
exit
}
killall -q hyprpicker
color=$(hyprpicker)
check wl-copy && {
echo "$color" | sed -z 's/\n//g' | wl-copy
}
check wl-copy && {
echo "$color" | sed -z 's/\n//g' | wl-copy
}
prevColors=$(head -n $((limit - 1)) "$loc/colors")
echo "$color" >"$loc/colors"
echo "$prevColors" >>"$loc/colors"
sed -i '/^$/d' "$loc/colors"
pkill -RTMIN+1 waybar
'';
prevColors=$(head -n $((limit - 1)) "$loc/colors")
echo "$color" >"$loc/colors"
echo "$prevColors" >>"$loc/colors"
sed -i '/^$/d' "$loc/colors"
pkill -RTMIN+1 waybar
'';
}