aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2024-02-14 05:22:34 +0900
committerGitHub <noreply@github.com>2024-02-14 05:22:34 +0900
commita160ceeab550d8fdefc0b19f6b3a0dd6c2784db8 (patch)
treebf2ebecab995012b984c931e2ec22d947897b4b3 /config/hypr/scripts
parent610a46e8fe3c5c0d0b292977b6015d9f858e5e98 (diff)
parente34165295e0856f9f14fffb4e323fb1f2e2220c9 (diff)
Merge pull request #158 from JaKooLit/development
Development to Main
Diffstat (limited to 'config/hypr/scripts')
-rwxr-xr-xconfig/hypr/scripts/PywalSwww.sh34
-rwxr-xr-xconfig/hypr/scripts/ScreenShot.sh16
-rwxr-xr-xconfig/hypr/scripts/Volume.sh2
-rwxr-xr-xconfig/hypr/scripts/WaybarCava.sh2
4 files changed, 34 insertions, 20 deletions
diff --git a/config/hypr/scripts/PywalSwww.sh b/config/hypr/scripts/PywalSwww.sh
index 0cbadaf4..4ed7448f 100755
--- a/config/hypr/scripts/PywalSwww.sh
+++ b/config/hypr/scripts/PywalSwww.sh
@@ -11,30 +11,28 @@ monitor_outputs=($(ls "$cache_dir"))
# Initialize a flag to determine if the ln command was executed
ln_success=false
-# Loop through monitor outputs
-for output in "${monitor_outputs[@]}"; do
- # Construct the full path to the cache file
- cache_file="$cache_dir$output"
-
- # Check if the cache file exists for the current monitor output
- if [ -f "$cache_file" ]; then
- # Get the wallpaper path from the cache file
- wallpaper_path=$(cat "$cache_file")
-
- # Copy the wallpaper to the location Rofi can access
- if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then
- ln_success=true # Set the flag to true upon successful execution
- fi
-
- break # Exit the loop after processing the first found monitor output
+# Get first valid monitor
+current_monitor=$(hyprctl -j monitors | jq -r '.[0].name')
+echo $current_monitor
+# Construct the full path to the cache file
+cache_file="$cache_dir$current_monitor"
+echo $cache_file
+# Check if the cache file exists for the current monitor output
+if [ -f "$cache_file" ]; then
+ # Get the wallpaper path from the cache file
+ wallpaper_path=$(cat "$cache_file")
+ echo $wallpaper_path
+ # Copy the wallpaper to the location Rofi can access
+ if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then
+ ln_success=true # Set the flag to true upon successful execution
fi
-done
+fi
# Check the flag before executing further commands
if [ "$ln_success" = true ]; then
# execute pywal
# wal -i "$wallpaper_path"
-
+ echo 'about to execute wal'
# execute pywal skipping tty and terminal changes
wal -i "$wallpaper_path" -s -t &
fi
diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh
index ddf4398b..fa1b40ad 100755
--- a/config/hypr/scripts/ScreenShot.sh
+++ b/config/hypr/scripts/ScreenShot.sh
@@ -3,6 +3,7 @@
# Screenshots scripts
iDIR="$HOME/.config/swaync/icons"
+sDIR="$HOME/.config/hypr/UserScripts"
notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png"
time=$(date "+%d-%b_%H-%M-%S")
@@ -18,13 +19,17 @@ notify_view() {
if [[ "$1" == "active" ]]; then
if [[ -e "${active_window_path}" ]]; then
${notify_cmd_shot} "Screenshot of '${active_window_class}' Saved."
+ "${sDIR}/Sounds.sh" --screenshot
else
${notify_cmd_shot} "Screenshot of '${active_window_class}' not Saved"
fi
+ elif [[ "$1" == "swappy" ]]; then
+ ${notify_cmd_shot} "Screenshot Captured."
else
local check_file="$dir/$file"
if [[ -e "$check_file" ]]; then
${notify_cmd_shot} "Screenshot Saved."
+ "${sDIR}/Sounds.sh" --screenshot
else
${notify_cmd_shot} "Screenshot NOT Saved."
fi
@@ -84,6 +89,13 @@ shotactive() {
notify_view "active"
}
+shotswappy() {
+ tmpfile=$(mktemp)
+ grim -g "$(slurp)" - >"$tmpfile" && "${sDIR}/Sounds.sh" --screenshot && notify_view "swappy"
+ swappy -f - <"$tmpfile"
+ rm "$tmpfile"
+}
+
if [[ ! -d "$dir" ]]; then
mkdir -p "$dir"
@@ -101,8 +113,10 @@ elif [[ "$1" == "--area" ]]; then
shotarea
elif [[ "$1" == "--active" ]]; then
shotactive
+elif [[ "$1" == "--swappy" ]]; then
+ shotswappy
else
- echo -e "Available Options : --now --in5 --in10 --win --area --active"
+ echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy"
fi
exit 0
diff --git a/config/hypr/scripts/Volume.sh b/config/hypr/scripts/Volume.sh
index 1c18211f..8c5af5de 100755
--- a/config/hypr/scripts/Volume.sh
+++ b/config/hypr/scripts/Volume.sh
@@ -3,6 +3,7 @@
# Scripts for volume controls for audio and mic
iDIR="$HOME/.config/swaync/icons"
+sDIR="$HOME/.config/hypr/UserScripts"
# Get Volume
get_volume() {
@@ -34,6 +35,7 @@ notify_user() {
notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: Muted"
else
notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: $(get_volume)"
+ "$sDIR/Sounds.sh" --volume
fi
}
diff --git a/config/hypr/scripts/WaybarCava.sh b/config/hypr/scripts/WaybarCava.sh
index 62e3558e..bf9e7435 100755
--- a/config/hypr/scripts/WaybarCava.sh
+++ b/config/hypr/scripts/WaybarCava.sh
@@ -1,4 +1,4 @@
-# #! /bin/bash
+#!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Not my own work. This was added through Github PR. Credit to original author
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage