From 928303bc10e721aa9bcf89ff2143ac4af2f4bbea Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Mon, 1 Jan 2024 20:27:57 +0545 Subject: [PATCH] removing somethings --- config/hypr/configs/Keybinds.conf | 6 +- config/hypr/configs/Startup_Apps.conf | 6 +- config/hypr/scripts/AirplaneMode.sh | 1 + config/hypr/scripts/BatteryNotify.sh | 45 ++++---- config/hypr/scripts/Brightness.sh | 3 +- config/hypr/scripts/BrightnessKbd.sh | 1 + config/hypr/scripts/ChangeBlur.sh | 1 + config/hypr/scripts/ChangeLayout.sh | 1 + config/hypr/scripts/ClipManager.sh | 4 +- config/hypr/scripts/KeyHints.sh | 57 ---------- config/hypr/scripts/MediaCtrl.sh | 1 + config/hypr/scripts/Polkit.sh | 1 + config/hypr/scripts/QuickEdit.sh | 1 + config/hypr/scripts/Refresh.sh | 1 + config/hypr/scripts/RofiEmoji.sh | 2 + config/hypr/scripts/RofiNotes.sh | 109 -------------------- config/hypr/scripts/RofiPower.sh | 1 + config/hypr/scripts/RofiTmux.sh | 2 + config/hypr/scripts/RofiTodo.sh | 7 -- config/hypr/scripts/ScreenShot.sh | 6 +- config/hypr/scripts/Sunset.sh | 6 +- config/hypr/scripts/SwitchKeyboardLayout.sh | 2 + config/hypr/scripts/TodoList.sh | 47 --------- config/hypr/scripts/TouchPad.sh | 2 + config/hypr/scripts/Volume.sh | 2 + config/hypr/scripts/Wallpaper.sh | 35 ------- config/hypr/scripts/WallpaperAutoChange.sh | 35 +++++++ config/hypr/scripts/WallpaperRandom.sh | 38 +++---- config/hypr/scripts/WallpaperSelect.sh | 1 + config/hypr/scripts/WaybarLayout.sh | 2 + 30 files changed, 113 insertions(+), 313 deletions(-) delete mode 100755 config/hypr/scripts/KeyHints.sh delete mode 100755 config/hypr/scripts/RofiNotes.sh delete mode 100755 config/hypr/scripts/RofiTodo.sh delete mode 100755 config/hypr/scripts/TodoList.sh delete mode 100755 config/hypr/scripts/Wallpaper.sh create mode 100755 config/hypr/scripts/WallpaperAutoChange.sh diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index ca191d59..cd454b59 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -27,11 +27,9 @@ bind = $mainMod_SHIFT, Slash, exec, code # FEATURES / EXTRAS bind = $mainMod ALT, R, exec, $scriptsDir/Refresh.sh # Refresh waybar, swaync, rofi bind = $mainMod, X, exec, $scriptsDir/RofiPower.sh # Powermenu -bind = $mainMod, N, exec, $scriptsDir/RofiNotes.sh # Notes bind = $mainMod, T, exec, $scriptsDir/RofiTmux.sh # Tmux bind = $mainMod_SHIFT, A, exec, $scriptsDir/ToggleAnimation.sh -t # Animation ON/OFF bind = ALT, slash, exec, $scriptsDir/RofiEmoji.sh # Emoji -bind = SHIFT_ALT, T, exec, $scriptsDir/RofiTodo.sh # Todo List bind = ALT, F1, exec, $scriptsDir/SwitchKeyboardLayout.sh # Switch Keyboard Layout bind = $mainMod_SHIFT, Q, exec, $scriptsDir/ChangeBlur.sh # Toggle blur settings bind = $mainMod, R, exec, $scriptsDir/RofiRecord.sh # Screen Recorder @@ -40,8 +38,8 @@ bind = $mainMod, space, exec, $scriptsDir/ChangeLayout.sh # Toggle Master or bind = SHIFT_ALT, C, exec, $scriptsDir/ClipManager.sh # Clipboard Manager bind = $mainMod_SHIFT, N, exec, swaync-client -t -sw # swayNC panel bind = ALT, E, exec, $scriptsDir/QuickEdit.sh # Quick Edit Hyprland Settings -bind = $mainMod_SHIFT, W, exec, $scriptsDir/WallpaperSelect.sh # Select Wallpaper to apply -bind = SHIFT_ALT, W, exec, $scriptsDir/Wallpaper.sh # Random Wallpapers +bind = $mainMod, W, exec, $scriptsDir/WallpaperSelect.sh # Select Wallpaper to apply +bind = SHIFT_ALT,W, exec, $scriptsDir/WallpaperRandom.sh # Random Wallpapers bind = $mainMod, F1, exec, $scriptsDir/KeyBinds.sh # Keybinds # Online Music related keybinds diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf index 885c92fe..da8350b4 100644 --- a/config/hypr/configs/Startup_Apps.conf +++ b/config/hypr/configs/Startup_Apps.conf @@ -2,8 +2,8 @@ $scriptsDir = $HOME/.config/hypr/scripts $lock = swaylock -$SwwwRandom = $UserScriptsDir/WallpaperRandom.sh -$WallpaperPath = $HOME/Pictures/wallpapers +$SwwwRandom = $scriptsDir/WallpaperAutoChange.sh +$wallDIR=$HOME/Pictures/wallpaperss # Initial boot script enable to apply initial wallpapers, theming, new settings etc. @@ -11,7 +11,7 @@ exec-once = $HOME/.config/hypr/initial-boot.sh # wallpaper stuff / More wallpaper options below exec-once = swww query || swww init -exec-once = $SwwwRandom $WallpaperPath # random wallpaper switcher every 30 minutes +exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minute # Startup exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP diff --git a/config/hypr/scripts/AirplaneMode.sh b/config/hypr/scripts/AirplaneMode.sh index f3a50629..886e8c3a 100755 --- a/config/hypr/scripts/AirplaneMode.sh +++ b/config/hypr/scripts/AirplaneMode.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Airplane Mode. Turning on or off all wifi using rfkill. notif="$HOME/.config/swaync/images/bell.png" diff --git a/config/hypr/scripts/BatteryNotify.sh b/config/hypr/scripts/BatteryNotify.sh index 63a85210..3ea7326f 100755 --- a/config/hypr/scripts/BatteryNotify.sh +++ b/config/hypr/scripts/BatteryNotify.sh @@ -1,8 +1,11 @@ #!/bin/bash + +# Prasanthrangan Work + trap resume_processes SIGINT in_range() { local num=$1 local min=$2 local max=$3 ; [[ $num =~ ^[0-9]+$ ]] && (( num >= min && num <= max )); } mnc=5 mxc=80 mnl=20 mxl=50 mnu=80 mxu=100 mnt=60 mxt=1000 mnf=80 mxf=100 mnn=1 mxn=60 mni=1 mxi=10 verbose=false undock=false #Defaults Ranges -while (( "$#" )); do # Parse command-line arguments and defaults +while (( "$#" )); do # Parse command-line arguments and defaults case "$1" in "--full"|"-f") if in_range "$2" $mnf $mxf; then battery_full_threshold=$2 ; shift 2 ; else echo "$1 Error: Full Threshold must be $mnf - $mxf." >&2 ; exit 1 ; fi;; "--critical"|"-c") if in_range "$2" $mnc $mxc; then battery_critical_threshold=$2 ; shift 2 ; else echo "$1 ERROR: Critical Threshold must be $mnc - $mxc." >&2 ; exit 1 ; fi;; @@ -42,11 +45,11 @@ is_laptop() { # Check if the system is a laptop fi } fn_verbose () { -if $verbose; then +if $verbose; then cat << VERBOSE ============================================= - Battery Status: $battery_status - Battery Percentage: $battery_percentage + Battery Status: $battery_status + Battery Percentage: $battery_percentage ============================================= @@ -57,7 +60,7 @@ fn_notify () { # Send notification notify-send -a "Power" $1 -u $2 "$3" "$4" -p # Call the notify-send command with the provided arguments \$1 is the flags \$2 is the urgency \$3 is the title \$4 is the message } -fn_percentage () { +fn_percentage () { if [[ "$battery_percentage" -ge "$unplug_charger_threshold" ]] && [[ "$battery_status" != "Discharging" ]] && [[ "$battery_status" != "Full" ]] && (( (battery_percentage - last_notified_percentage) >= $interval )); then if $verbose; then echo "Prompt:UNPLUG: $battery_unplug_threshold $battery_status $battery_percentage" ; fi fn_notify "-t 5000 " "CRITICAL" "Battery Charged" "Battery is at $battery_percentage%. You can unplug the charger!" last_notified_percentage=$battery_percentage @@ -68,7 +71,7 @@ fn_percentage () { if [[ $battery_status != "Discharging" ]] ; then break ; fi fn_notify "-t 5000 -r 69 " "CRITICAL" "Battery Critically Low" "$battery_percentage% is critically low. Device will execute $execute in $((count/60)):$((count%60)) ." count=$((count-1)) - sleep 1 + sleep 1 done [ $count -eq 0 ] && fn_action elif [[ "$battery_percentage" -le "$battery_low_threshold" ]] && [[ "$battery_status" == "Discharging" ]] && (( (last_notified_percentage - battery_percentage) >= $interval )); then if $verbose; then echo "Prompt:LOW: $battery_low_threshold $battery_status $battery_percentage" ; fi @@ -86,18 +89,18 @@ if [[ $battery_percentage -ge $battery_full_threshold ]] && [ "$battery_status" battery_status="Full" ;fi case "$battery_status" in # Handle the power supply status "Discharging") if $verbose; then echo "Case:$battery_status Level: $battery_percentage" ;fi - if [[ "$prev_status" != "Discharging" ]] || [[ "$prev_status" == "Full" ]] ; then + if [[ "$prev_status" != "Discharging" ]] || [[ "$prev_status" == "Full" ]] ; then prev_status=$battery_status urgency=$([[ $battery_percentage -le "$battery_low_threshold" ]] && echo "CRITICAL" || echo "NORMAL") fn_notify "-t 5000 -r 54321 " "$urgency" "Charger Plug OUT" "Battery is at $battery_percentage%." fi - fn_percentage + fn_percentage ;; "Not"*|"Charging") if $verbose; then echo "Case:$battery_status Level: $battery_percentage" ;fi # Due to modifications of some devices Not Charging after reaching 99 or limits - #if [[ ! -f "/tmp/hyprdots.batterynotify.status.$battery_status-$$" ]] && [[ "$battery_status" == "Not"* ]] ; then + #if [[ ! -f "/tmp/hyprdots.batterynotify.status.$battery_status-$$" ]] && [[ "$battery_status" == "Not"* ]] ; then #touch "/tmp/hyprdots.batterynotify.status.$battery_status-$$" - #count=$(( timer > $mnt ? timer : $mnt )) # reset count + #count=$(( timer > $mnt ? timer : $mnt )) # reset count #echo "Status: '==>> "$battery_status" <<==' Device Reports Not Charging!,This may be device Specific errors." #fn_notify "-t 5000 " "CRITICAL" "Charger Plug In" "Battery is at $battery_percentage%." #fi @@ -107,24 +110,24 @@ case "$battery_status" in # Handle the power supply status urgency=$([[ "$battery_percentage" -ge $unplug_charger_threshold ]] && echo "CRITICAL" || echo "NORMAL") fn_notify "-t 5000 -r 54321 " "$urgency" "Charger Plug In" "Battery is at $battery_percentage%." fi - fn_percentage + fn_percentage ;; "Full") if $verbose; then echo "Case:$battery_status Level: $battery_percentage" ;fi if [[ $battery_status != "Discharging" ]]; then - now=$(date +%s) + now=$(date +%s) if [[ "$prev_status" == *"harging"* ]] || ((now - lt >= $((notify*60)) )); then fn_notify "-t 5000 -r 54321" "CRITICAL" "Battery Full" "Please unplug your Charger" prev_status=$battery_status lt=$now fi fi - ;; + ;; *) - if [[ ! -f "/tmp/hyprdots.batterynotify.status.fallback.$battery_status-$$" ]]; then + if [[ ! -f "/tmp/hyprdots.batterynotify.status.fallback.$battery_status-$$" ]]; then echo "Status: '==>> "$battery_status" <<==' Script on Fallback mode,Unknown power supply status.Please copy this line and raise an issue to the Github Repo.Also run 'ls /tmp/hyprdots.batterynotify' to see the list of lock files.*" touch "/tmp/hyprdots.batterynotify.status.fallback.$battery_status-$$" - fi - fn_percentage + fi + fn_percentage ;; esac } @@ -142,8 +145,8 @@ resume_processes() { for pid in $pids ; do if [ $pid -ne $current_pid ] ; then main() { # Main function if is_laptop; then rm -fr /tmp/hyprdots.batterynotify* # Cleaning the lock file -battery_full_threshold=${battery_full_threshold:-100} -battery_critical_threshold=${battery_critical_threshold:-10} +battery_full_threshold=${battery_full_threshold:-100} +battery_critical_threshold=${battery_critical_threshold:-10} unplug_charger_threshold=${unplug_charger_threshold:-80} battery_low_threshold=${battery_low_threshold:-20} timer=${timer:-120} @@ -152,11 +155,11 @@ interval=${interval:-5} execute=${execute:-"systemctl suspend"} cat << EOF -Script is running... -Check $0 --help for options. +Script is running... +Check $0 --help for options. STATUS THRESHOLD INTERVAL - Full $battery_full_threshold $notify Minutes + Full $battery_full_threshold $notify Minutes Critical $battery_critical_threshold $timer Seconds then "$execute" Low $battery_low_threshold $interval Percent Unplug $unplug_charger_threshold $interval Percent diff --git a/config/hypr/scripts/Brightness.sh b/config/hypr/scripts/Brightness.sh index 14c03da5..36345aa9 100755 --- a/config/hypr/scripts/Brightness.sh +++ b/config/hypr/scripts/Brightness.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Script for Monitor backlights (if supported) using brightnessctl iDIR="$HOME/.config/swaync/icons" notification_timeout=1000 @@ -48,4 +49,4 @@ case "$1" in *) get_backlight ;; -esac \ No newline at end of file +esac diff --git a/config/hypr/scripts/BrightnessKbd.sh b/config/hypr/scripts/BrightnessKbd.sh index 3bdcebcb..43caa5cb 100755 --- a/config/hypr/scripts/BrightnessKbd.sh +++ b/config/hypr/scripts/BrightnessKbd.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Script for keyboard backlights (if supported) using b iDIR="$HOME/.config/swaync/icons" diff --git a/config/hypr/scripts/ChangeBlur.sh b/config/hypr/scripts/ChangeBlur.sh index 95789f5c..13f657bd 100755 --- a/config/hypr/scripts/ChangeBlur.sh +++ b/config/hypr/scripts/ChangeBlur.sh @@ -1,4 +1,5 @@ #!/bin/bash +## Script for changing blurs on the fly notif="$HOME/.config/swaync/images/bell.png" diff --git a/config/hypr/scripts/ChangeLayout.sh b/config/hypr/scripts/ChangeLayout.sh index 93bc2fe9..eaa94db0 100755 --- a/config/hypr/scripts/ChangeLayout.sh +++ b/config/hypr/scripts/ChangeLayout.sh @@ -1,4 +1,5 @@ #!/bin/bash +# for changing Hyprland Layouts (Master or Dwindle) on the fly notif="$HOME/.config/swaync/images/bell.png" diff --git a/config/hypr/scripts/ClipManager.sh b/config/hypr/scripts/ClipManager.sh index 19d4e903..a349190e 100755 --- a/config/hypr/scripts/ClipManager.sh +++ b/config/hypr/scripts/ClipManager.sh @@ -1,6 +1,6 @@ #!/bin/bash -# -# Clipboard Manager + +# Clipboard Manager. This needed cliphist & wl-copy and of course rofi if [[ ! $(pidof rofi) ]]; then cliphist list | rofi -dmenu -config ~/.config/rofi/config-clipboard.rasi | cliphist decode | wl-copy diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh deleted file mode 100755 index ac4b70d9..00000000 --- a/config/hypr/scripts/KeyHints.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - - - yad --width=850 --height=950 \ - --center \ - --title="Keybindings" \ - --no-buttons \ - --list \ - --column=Key: \ - --column=Description: \ - --column=Command: \ -"ESC" "close this app" "" "=" "SUPER KEY" "(SUPER KEY)" \ -" ENTER" "Terminal" "(kitty)" \ -"ALT ENTeR" "FullScreen Terminal" "(all_kitty)" \ -"ALT SHIFT enter" "Float Terminal" "(kitty_float)" \ -" D" "App Launcher" "(rofi)" \ -" " "App Launcher" "(rofi)" \ -" E" "Open File Manager" "(Thunar)" \ -" C" "close focused app" "(kill)" \ -" SHIFT W" "Wallpaper Select" "(swww)" \ -"ALT SHIFT W" "Random Wallpaper" "(swww)" \ -"CTRL E" "RofiEmoji" "" \ -" N" "ROfiNotes" "" \ -" T" "RofiTmux" "" \ -"ALT M" "RofiMusic" "" \ -" SHIFT T" "RofiTodo" ""\ -"ALT S" "Stop" "(ROfi Music)" \ -"ALT N" "Next track" "(ROfi Music)" \ -"ALT P" "Previous Track" "(ROfi Music)" \ -"ALT R" "Resume" "(ROfi Music)" \ -"ALT W" "Choose waybar layout" "(waybar layout)" \ -"PRINT" "screenshot now" "(grim)" \ -" Z" "screenshot area" "(grim + slurp)" \ -"CTRL PRINT" "screenshot win" "(grim)" \ -" X" "power-menu" "(rofi)" \ -"CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \ -" SHIFT SPACE" "Fullscreen" "(Toggles to full screen)" \ -" A" "Toggle Dwindle | Master Layout" "(Hyprland Layout)" \ -" P" "Toggle Dwindle" "(Pseudo)" \ -" F" "Toggle float" "(single window)" \ -" SHIFT F" "Toggle all windows to float" "(all windows)" \ -"CTRL 1" "cava" "(fly_is_kitty)" \ -"CTRL 2" "donut" "(donut_is_kitty)" \ -"CTRL 3" "tty-clock" "(clock_is_kitty)" \ -" SHIFT A" "All animations off" "" \ -" Shift Q" "Toggle Blur" "normal or less blur" \ -" R" "Record Screen" "(wf-recorder)" \ -" SHIFT R" "Stop Recording" "" \ -" SHIFT O" "Opaque" "" \ -" G" "Toggle Group" "" \ -" U" "Toggle Special Workspace" "" \ -" SHIFT U" "Move Toward Special" "" \ -" F1" "Launch this app" "" \ -"ALT E" "View or EDIT Keybinds, Settings, Monitor" "" \ -"" "" "" \ -"" "For other you can find in ~/.config/hypr/configs/keybind.conf" ""\ - diff --git a/config/hypr/scripts/MediaCtrl.sh b/config/hypr/scripts/MediaCtrl.sh index 9d970443..4cc6e7a9 100755 --- a/config/hypr/scripts/MediaCtrl.sh +++ b/config/hypr/scripts/MediaCtrl.sh @@ -1,4 +1,5 @@ #!/bin/bash +#playerctl music_icon="$HOME/.config/swaync/icons/music.png" diff --git a/config/hypr/scripts/Polkit.sh b/config/hypr/scripts/Polkit.sh index d4e8342e..64b5ff12 100755 --- a/config/hypr/scripts/Polkit.sh +++ b/config/hypr/scripts/Polkit.sh @@ -1,4 +1,5 @@ #!/bin/bash +# This is for polkits, it will start from top and will stop if the top is executed # Polkit possible paths files to check polkit=( diff --git a/config/hypr/scripts/QuickEdit.sh b/config/hypr/scripts/QuickEdit.sh index 79e21d8b..904d9511 100755 --- a/config/hypr/scripts/QuickEdit.sh +++ b/config/hypr/scripts/QuickEdit.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Rofi menu for Quick Edit / View of Settings (ALT E) userDir="$HOME/.config/hypr/configs" diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 93d3c4d6..e5d4c75d 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# Scripts for refreshing waybar, rofi, swaync SCRIPTSDIR=$HOME/.config/hypr/scripts UserSCRIPTSDIR=$HOME/.config/hypr/UserScripts diff --git a/config/hypr/scripts/RofiEmoji.sh b/config/hypr/scripts/RofiEmoji.sh index 324a738b..eee56d01 100755 --- a/config/hypr/scripts/RofiEmoji.sh +++ b/config/hypr/scripts/RofiEmoji.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Rofi Emoticons. Not my own. Cant remember the source + sed '1,/^### DATA ###$/d' $0 | rofi -dmenu -config ~/.config/rofi/config-emoji.rasi | cut -d ' ' -f 1 | tr -d '\n' | wl-copy diff --git a/config/hypr/scripts/RofiNotes.sh b/config/hypr/scripts/RofiNotes.sh deleted file mode 100755 index eea09247..00000000 --- a/config/hypr/scripts/RofiNotes.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash - -# https://github.com/christianholman/rofi_notes - -# default values -AUTHOR=$(whoami) -NOTES_FOLDER="$HOME/Documents/.notes" -NOTES_EDITOR='mousepad' - -theme=~/.config/rofi/config-notes.rasi - -if [[ ! -d "${NOTES_FOLDER}" ]]; then - mkdir -p "$NOTES_FOLDER" -fi - -get_notes() { - ls "${NOTES_FOLDER}" -} - -edit_note() { - note_location=$1 - $NOTES_EDITOR "$note_location" -} - -delete_note() { - local note=$1 - local action=$(echo -e "Yes\nNo" | rofi -theme $theme -dmenu -p "Are you sure you want to delete $note? ") - - case $action in - "Yes") - rm "$NOTES_FOLDER/$note" - main - ;; - "No") - main - esac -} - -note_context() { - local note=$1 - local note_location="$NOTES_FOLDER/$note" - local action=$(echo -e "Edit\nDelete" | rofi -theme $theme -dmenu -p "$note > ") - case $action in - "Edit") - edit_note "$note_location" - exit 0;; - "Delete") - delete_note "$note" - exit 0;; - esac - - exit 1 -} - -new_note() { - local title=$(echo -e "Cancel" | rofi -theme $theme -dmenu -p "Input title: ") - - case "$title" in - "Cancel") - main - ;; - *) - local file=$(echo "$title" | sed 's/ /_/g;s/\(.*\)/\L\1/g') - local template=$(cat <<- END ---- -title: $title -date: $(date --rfc-3339=seconds) -author: $AUTHOR ---- - -# $title -END - ) - - note_location="$NOTES_FOLDER/$file.md" - if [ "$title" != "" ]; then - echo "$template" > "$note_location" | edit_note "$note_location" - exit 0 - fi - ;; - esac -} - -main() -{ - local all_notes="$(get_notes)" - local first_menu="New" - - if [ "$all_notes" ];then - first_menu="New\n${all_notes}" - fi - - local note=$(echo -e "$first_menu" | rofi -theme $theme -dmenu -p "󰚸 Notes") - - case $note in - "New") - new_note - ;; - "") - exit 1;; - *) - note_context "$note" && exit 0 # handle esc key in note_context - esac - - exit 1 -} - - -main diff --git a/config/hypr/scripts/RofiPower.sh b/config/hypr/scripts/RofiPower.sh index 2ee61e3b..1d48a3a3 100755 --- a/config/hypr/scripts/RofiPower.sh +++ b/config/hypr/scripts/RofiPower.sh @@ -1,5 +1,6 @@ #!/bin/bash +# Powermenu using rofi (Power, Screen Lock, Suspend, etc) # CMDs uptime_info=$(uptime -p | sed -e 's/up //g') diff --git a/config/hypr/scripts/RofiTmux.sh b/config/hypr/scripts/RofiTmux.sh index 5304aded..b39894b5 100755 --- a/config/hypr/scripts/RofiTmux.sh +++ b/config/hypr/scripts/RofiTmux.sh @@ -1,5 +1,7 @@ #! /usr/bin/env bash +# Control Tmux Session using rofi + TERMINAL="kitty" function tmux_sessions() { diff --git a/config/hypr/scripts/RofiTodo.sh b/config/hypr/scripts/RofiTodo.sh deleted file mode 100755 index 69949d70..00000000 --- a/config/hypr/scripts/RofiTodo.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# -theme=~/.config/rofi/config-todo.rasi - -rofi -modi TODO:$HOME/.config/hypr/scripts/TodoList.sh -show TODO -theme $theme - -exit 0 diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index 1d5eeacf..5c7dd703 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Screenshots scripts + iDIR="$HOME/.config/swaync/icons" notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png" @@ -51,7 +53,7 @@ shot5() { sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy sleep 1 notify_view - + } shot10() { @@ -79,7 +81,7 @@ shotactive() { hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "${active_window_path}" sleep 1 - notify_view "active" + notify_view "active" } diff --git a/config/hypr/scripts/Sunset.sh b/config/hypr/scripts/Sunset.sh index 96c27c5b..40891105 100755 --- a/config/hypr/scripts/Sunset.sh +++ b/config/hypr/scripts/Sunset.sh @@ -1,2 +1,6 @@ #!/bin/bash -wlsunset -t 4000 -T 6500 -d 900 -S 07:00 -s 19:00 \ No newline at end of file + +# wlsunset project page +# https://sr.ht/~kennylevinsen/wlsunset/ + +wlsunset -t 4000 -T 6500 -d 900 -S 07:00 -s 19:00 diff --git a/config/hypr/scripts/SwitchKeyboardLayout.sh b/config/hypr/scripts/SwitchKeyboardLayout.sh index 1ec71e24..ef62c9db 100755 --- a/config/hypr/scripts/SwitchKeyboardLayout.sh +++ b/config/hypr/scripts/SwitchKeyboardLayout.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# This is for changing kb_layouts. Set kb_layouts in $settings_file + layout_f="$HOME/.cache/kb_layout" settings_file="$HOME/.config/hypr/configs/Settings.conf" notif="$HOME/.config/swaync/images/bell.png" diff --git a/config/hypr/scripts/TodoList.sh b/config/hypr/scripts/TodoList.sh deleted file mode 100755 index eebaf68a..00000000 --- a/config/hypr/scripts/TodoList.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# https://github.com/claudiodangelis/rofi-todo -# -# this script manages a simple to-do list stored locally -# it allows adding and removing to-do entries -# -# dependencies: rofi - -TODO_FILE="${TODO_FILE:-$HOME/Documents/.rofi-todo}" - -if [[ ! -a "${TODO_FILE}" ]]; then - touch "${TODO_FILE}" -fi - -function add_todo() { - echo -e "`date +"%b %d %H:%M"` | $*" >> "${TODO_FILE}" -} - -function remove_todo() { - if [[ ! -z "$DONE_FILE" ]]; then - echo "${*}" >> "${DONE_FILE}" - fi - sed -i "/^${*}$/d" "${TODO_FILE}" -} - -function get_todos() { - echo "Refresh List" - echo "$(cat "${TODO_FILE}")" -} - -if [ -z "$@" ]; then - get_todos -else - LINE=$(echo "${@}" | sed "s/\([^a-zA-Z0-9]\)/\\\\\\1/g") - LINE_UNESCAPED=${@} - if [[ $LINE_UNESCAPED == +* ]]; then - LINE_UNESCAPED=$(echo $LINE_UNESCAPED | sed s/^+//g |sed s/^\s+//g ) - add_todo ${LINE_UNESCAPED} - else - MATCHING=$(grep "^${LINE_UNESCAPED}$" "${TODO_FILE}") - if [[ -n "${MATCHING}" ]]; then - remove_todo ${LINE_UNESCAPED} - fi - fi - get_todos -fi diff --git a/config/hypr/scripts/TouchPad.sh b/config/hypr/scripts/TouchPad.sh index 9ae96a93..dbb31a5a 100755 --- a/config/hypr/scripts/TouchPad.sh +++ b/config/hypr/scripts/TouchPad.sh @@ -1,5 +1,7 @@ #!/bin/bash +# For disabling touchpad. + notif="$HOME/.config/swaync/images/bell.png" # NOTE: find the right device using hyprctl devices diff --git a/config/hypr/scripts/Volume.sh b/config/hypr/scripts/Volume.sh index f68491cf..a2457771 100755 --- a/config/hypr/scripts/Volume.sh +++ b/config/hypr/scripts/Volume.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Scripts for volume controls for audio and mic + iDIR="$HOME/.config/swaync/icons" # Get Volume diff --git a/config/hypr/scripts/Wallpaper.sh b/config/hypr/scripts/Wallpaper.sh deleted file mode 100755 index 06daf86c..00000000 --- a/config/hypr/scripts/Wallpaper.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Wallpaper directory -DIR="$HOME/Pictures/wallpapers" - -# Find wallpapers -PICS=($(find "${DIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) - -# Check if there are wallpapers in the specified directory -if [ ${#PICS[@]} -eq 0 ]; then - echo "No wallpapers found in ${DIR}. Exiting." - exit 1 -fi - -# Randomly select a wallpaper -RANDOMPICS=${PICS[$RANDOM % ${#PICS[@]}]} - -# Transition config -FPS=60 -TYPE="random" -DURATION=1 -BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" - -# Check if swww is initialized, and initialize if not -swww query || swww init - -# Set the wallpaper with transition parameters -swww img "${RANDOMPICS}" $SWWW_PARAMS - -# Notify that the wallpaper has changed -notify-send "Wallpaper Changed" -i "${RANDOMPICS}" - -# Create a symbolic link to the current wallpaper -ln -sf "${RANDOMPICS}" "$HOME/.config/hypr/.current_wallpaper" diff --git a/config/hypr/scripts/WallpaperAutoChange.sh b/config/hypr/scripts/WallpaperAutoChange.sh new file mode 100755 index 00000000..9bbca717 --- /dev/null +++ b/config/hypr/scripts/WallpaperAutoChange.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# source https://wiki.archlinux.org/title/Hyprland#Using_a_script_to_change_wallpaper_every_X_minutes + +# This script will randomly go through the files of a directory, setting it +# up as the wallpaper at regular intervals +# +# NOTE: this script uses bash (not POSIX shell) for the RANDOM variable + + +if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then + echo "Usage: + $0 " + exit 1 +fi + +# Edit below to control the images transition +export SWWW_TRANSITION_FPS=60 +export SWWW_TRANSITION_TYPE=simple + +# This controls (in seconds) when to switch to the next image +INTERVAL=1800 + +while true; do + find "$1" \ + | while read -r img; do + echo "$((RANDOM % 1000)):$img" + done \ + | sort -n | cut -d':' -f2- \ + | while read -r img; do + swww img "$img" + sleep $INTERVAL + + done +done diff --git a/config/hypr/scripts/WallpaperRandom.sh b/config/hypr/scripts/WallpaperRandom.sh index 63d272a5..ddb7dbbd 100755 --- a/config/hypr/scripts/WallpaperRandom.sh +++ b/config/hypr/scripts/WallpaperRandom.sh @@ -1,32 +1,22 @@ #!/bin/bash -DIR="$HOME/Pictures/wallpapers/" -PICS=($(find "${DIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) +# Script for Random Wallpaper ( CTRL ALT W) -# Check if there are wallpapers in the specified directory -if [ ${#PICS[@]} -eq 0 ]; then - echo "No wallpapers found in ${DIR}. Exiting." - exit 1 -fi +wallDIR="$HOME/Pictures/wallpapers" +scriptsDir="$HOME/.config/hypr/scripts" -# Check if swww is initialized, and initialize if not -swww query || swww init +PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) +RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} -# Set the transition type to random -export SWWW_TRANSITION_TYPE=random -# This controls (in seconds) when to switch to the next image -INTERVAL=1800 +# Transition config +FPS=60 +TYPE="random" +DURATION=1 +BEZIER=".43,1.19,1,.4" +SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" -while true; do - # Select a random wallpaper - RANDOMPICS=${PICS[$RANDOM % ${#PICS[@]}]} - # Create symbolic link to the selected wallpaper - ln -sf "${RANDOMPICS}" "$HOME/.config/hypr/.current_wallpaper" - - # Set the new wallpaper - swww img "$HOME/.config/hypr/.current_wallpaper" - - sleep $INTERVAL -done +swww query || swww init && swww img ${RANDOMPICS} $SWWW_PARAMS +# Create symbolic link to the selected wallpaper +ln -sf "${RANDOMPICS}" "$HOME/.config/hypr/.current_wallpaper" diff --git a/config/hypr/scripts/WallpaperSelect.sh b/config/hypr/scripts/WallpaperSelect.sh index 4b9db9e5..b026f954 100755 --- a/config/hypr/scripts/WallpaperSelect.sh +++ b/config/hypr/scripts/WallpaperSelect.sh @@ -1,4 +1,5 @@ #!/bin/bash +# This script for selecting wallpapers (SUPER W) SCRIPTSDIR="$HOME/.config/hypr/scripts" diff --git a/config/hypr/scripts/WaybarLayout.sh b/config/hypr/scripts/WaybarLayout.sh index dbe0ee7f..88cced34 100755 --- a/config/hypr/scripts/WaybarLayout.sh +++ b/config/hypr/scripts/WaybarLayout.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Script for waybar layout or configs + set -euo pipefail IFS=$'\n\t'