inital commit

This commit is contained in:
2025-03-04 14:37:46 +01:00
commit 6711294f5e
33 changed files with 551 additions and 0 deletions

View File

@@ -0,0 +1,123 @@
#!/bin/bash
### DEPENDENCIES:
## libnotify
## feh
## grim
## slurp
## swappy
## wl-clipboard
dir_target="$HOME/Obrazy/zrzuty" # where your screenshots are stored
file_name="zrzut_$(date +'%H-%M-%S_%d-%m-%Y').png" # name of your screenshot
file_path="$dir_target/$file_name" # full path combined of the above
tmp_path="/tmp/$file_name" # path of temporary file
# flags
edit=false # edit after screenshotting
save=false # save to the disk
copy=false # copy to clipboard
# messages
error_message="No argument provided. Use -h or --help for help message."
help_message="\nUsage: screenShot [flags] [type-of-screen-shot / color (for color picker)\n\nFlags:\n\t-c | --copy \t Copies to clipboard\n\t-s | --save \t Saves to $dir_target\n\t-e | --edit \t Edit screenshot with swappy\n\nTypes:\n\tfullscreen\n\twindow\n\tregion\n"
# don't go crazy when directory doesn't exist
if [[ ! -d $dir_target ]]; then
echo "Target directory does not exist. Creating..."
notify-send "Screenshot" "Target directory does not exist. Creating..."
mkdir -p $dir_target
fi
# handle flags
while [[ $# -gt 0 ]]; do
case "$1" in
-c | --copy)
copy=true
;;
-s | --save)
save=true
;;
-e | --edit)
edit=true
;;
-h | --help)
echo -e "$help_message"
exit 0
;;
fullscreen | window | region | color)
type_of_screenshot="$1"
;;
*)
echo "$error_message"
exit 1
;;
esac
shift
done
# actually screenshot
case "$type_of_screenshot" in
fullscreen)
grim -o $(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name') "$tmp_path"
;;
window)
active_window_position="$(hyprctl clients -j | jq -r '.[] | select(.focusHistoryID == 0) | .at')"
active_window_size="$(hyprctl clients -j | jq -r '.[] | select(.focusHistoryID == 0) | .size')"
x=$(echo "$active_window_position" | jq '.[0]')
y=$(echo "$active_window_position" | jq '.[1]')
width=$(echo "$active_window_size" | jq '.[0]')
height=$(echo "$active_window_size" | jq '.[1]')
grim -g "${x},${y} ${width}x${height}" "$tmp_path"
;;
region)
grim -o $(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name') "$tmp_path" && feh --fullscreen "$tmp_path" &
sleep 0.5
feh_pid=$(pgrep feh)
grim -g "$(slurp)" "$tmp_path"
echo "Killing feh…"
kill -9 "$feh_pid"
;;
color)
grim -o $(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name') "$tmp_path" && feh --fullscreen "$tmp_path" &
sleep 0.5
feh_pid=$(pgrep feh)
position=$(slurp -p)
sleep 1.0
color_hex=$(grim -g "$position" -t ppm - | magick convert - -format '%[pixel:p{0,0}]' txt:- | sed -n '2p' | awk '{print $3}')
wl-copy $color_hex
notify-send "Color picker" "Copied $color_hex to clipboard"
kill -9 "$feh_pid"
exit 0
;;
esac
case "$copy-$save" in
"true-true")
cp "$tmp_path" "$file_path"
wl-copy <"$tmp_path"
notify-send -i "$tmp_path" "Screenshot" "Copied and saved to $file_path"
;;
"false-true")
cp "$tmp_path" "$file_path"
notify-send -i "$tmp_path" "Screenshot" "Saved screenshot to $file_path"
;;
"true-false")
wl-copy <"$tmp_path"
notify-send -i "$tmp_path" "Screenshot" "Copied screenshot"
;;
"false-false")
if [ "$edit" = "true" ]; then
swappy -f "$tmp_path"
fi
;;
esac
rm $tmp_path
exit 0

View File

@@ -0,0 +1,34 @@
#!/bin/bash
set -e
sudo pacman -Syu fish neovim uwsm python3 util-linux libnewt wofi kitty yazi playerctl tldr flatpak zen-browser-avx2-bin wl-clipboard hyprland hyprpaper hypridle hyprlock xdg-desktop-portal-hyprland xdg-desktop-portal-gtk scx-scheds pipewire wireplumber pavucontrol man-db fastfetch btop pipewire-audio pipewire-alsa pipewire-pulse mako libnotify feh slurp grim swappy cliphist file nerd-fonts ffmpeg 7zip jq poppler fd ripgrep fzf zoxide imagemagick bat eza npm bc vesktop mangohud goverlay steam gimp spotify-launcher obs-studio gamescope gamemode bluez bluez-utils blueman heroic-games-launcher chezmoi github-cli --needed --noconfirm
if ! groups "$USER" | grep -qw "gamemode"; then
sudo usermod -aG gamemode "$USER"
fi
if ! echo $PATH | grep -q "$HOME/.local/bin"; then
fish_add_path "$HOME/.local/bin"
fi
if ! echo $SHELL | grep -qw "/usr/bin/fish"; then
chsh -s "$(command -v fish)"
fi
if ! pacman -Q yay &>/dev/null; then
echo "Yay is not installed, installing..."
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git $HOME/yay
cd $HOME/yay
makepkg -si
cd ..
rm yay -rf
else
echo "Yay is installed..."
yay -S hyprsunset hyprpolkitagent eww --needed
fi
flatpak update --noninteractive
flatpak install --noninteractive net.rpcs3.RPCS3
systemctl --user enable hypridle hyprpolkitagent pipewire-pulse hypridle
sudo systemctl enable bluetooth

View File

@@ -0,0 +1,8 @@
#!/bin/sh
# Get the volume level and convert it to a percentage
volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
volume=$(echo "$volume" | awk '{print $2}')
volume=$(echo "( $volume * 100 ) / 1" | bc)
notify-send -t 1000 -a 'wp-vol' -h int:value:$volume "Volume: ${volume}%"