diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index 92fbaf2c..7e895b97 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -40,6 +40,7 @@ bind = SHIFT_ALT, C, exec, $RunCMD clip bind = SHIFT_ALT, E, exec, $RunCMD edit bind = $mainMod, W, exec, $RunCMD select_wall bind = SHIFT_ALT,W, exec, $RunCMD random_wall +bind = $mainMod_SHIFT, W, exec, $RunCMD apply_wallpaper_effects bind = $mainMod, F1, exec, $RunCMD keybind bind = $mainMod_SHIFT, N, exec, swaync-client -C bind = $mainMod, COMMA, exec, pypr zoom diff --git a/config/hypr/initial-boot.sh b/config/hypr/initial-boot.sh index 83db8f2d..a47a3843 100644 --- a/config/hypr/initial-boot.sh +++ b/config/hypr/initial-boot.sh @@ -5,7 +5,7 @@ # THIS SCRIPT CAN BE DELETED ONCE SUCCESSFULLY BOOTED!! # Variables -wallpaper=$HOME/Pictures/wallpapers/wall-08.png +wallpaper=$HOME/Pictures/wallpapers/lord_krishn.jpg kvantum_theme="Darker" swww="swww img" diff --git a/config/hypr/scripts/System_cmd.sh b/config/hypr/scripts/System_cmd.sh index 36b30900..860d5fe8 100755 --- a/config/hypr/scripts/System_cmd.sh +++ b/config/hypr/scripts/System_cmd.sh @@ -200,6 +200,13 @@ if [ "$executed" == false ]; then fi } + +###################################### +# # +# Power Profile Daemon # +# # +###################################### + power_profile() { get_pwr() { PWR=$(powerprofilesctl get) @@ -235,3 +242,114 @@ power_profile() { notify-send -h string:x-canonical-private-synchronous:sys-notify -u low "Power Profile changed to $PWR" fi } + +###################################### +# # +# SymLink # +# # +###################################### + +symlink() { + # Define cache directory + cache_dir="$HOME/.cache/swww/" + + # Get a list of monitor outputs + monitor_outputs=($(ls "$cache_dir")) + + # Initialize variables + ln_success=false + current_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') + echo $current_monitor + cache_file="$cache_dir$current_monitor" + echo $cache_file + + if [ -f "$cache_file" ]; then + # Read wallpaper path from cache file + wallpaper_path=$(cat "$cache_file") + echo $wallpaper_path + + # Symlink wallpaper to the location accessible by Rofi + if ln -sf "$wallpaper_path" "$HOME/dotfiles/hypr/wallpaper_effects/.wallpaper_current"; then + ln_success=true # Set the flag to true upon successful execution + fi + + # Copy the wallpaper for wallpaper effects (optional) + # cp -r "$wallpaper_path" "$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" + fi + + # Check if symlink was successful + if [ "$ln_success" = true ]; then + echo 'Symlink successful' + fi +} + +###################################### +# # +# Wallpaper Effect # +# # +###################################### + + +apply_wallpaper_effects() { + current_wallpaper="$HOME/dotfiles/hypr/wallpaper_effects/.wallpaper_current" + wallpaper_output="$HOME/dotfiles/hypr/wallpaper_effects/.wallpaper_modified" + focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') + iDIR="$HOME/dotfiles/hypr/assets/" + SWWW_PARAMS="--transition-fps 60 --transition-type wipe --transition-duration 2" + + declare -A effects=( + ["Black & White"]="magick $current_wallpaper -colorspace gray -sigmoidal-contrast 10,40% $wallpaper_output" + ["Blurred"]="magick $current_wallpaper -blur 0x5 $wallpaper_output" + ["Solarize"]="magick $current_wallpaper -solarize 80% $wallpaper_output" + ["Sepia Tone"]="magick $current_wallpaper -sepia-tone 65% $wallpaper_output" + ["Negate"]="magick $current_wallpaper -negate $wallpaper_output" + ["Charcoal"]="magick $current_wallpaper -charcoal 0x5 $wallpaper_output" + ["Edge Detect"]="magick $current_wallpaper -edge 1 $wallpaper_output" + ["Emboss"]="magick $current_wallpaper -emboss 0x5 $wallpaper_output" + ["Sharpen"]="magick $current_wallpaper -sharpen 0x5 $wallpaper_output" + ["Oil Paint"]="magick $current_wallpaper -paint 4 $wallpaper_output" + ["Vignette"]="magick $current_wallpaper -vignette 0x5 $wallpaper_output" + ["Posterize"]="magick $current_wallpaper -posterize 4 $wallpaper_output" + ["Polaroid"]="magick $current_wallpaper -polaroid 0 $wallpaper_output" + ["No Effects"]="no-effects" + ) + + no_effects() { + swww img -o "$focused_monitor" "$current_wallpaper" $SWWW_PARAMS & + wait $! + notify-send -u low -i "$iDIR/bell.png" "No wallpaper effects" + cp $current_wallpaper $wallpaper_output + } + + main() { + options="No Effects" + for effect in "${!effects[@]}"; do + if [ "$effect" != "No Effects" ]; then + options+="\n$effect" + fi + done + + choice=$(echo -e "$options" | rofi -i -dmenu) + if [[ -n "$choice" && "${effects[$choice]+exists}" ]]; then + if [ "$choice" == "No Effects" ]; then + no_effects + else + notify-send -u normal -i "$iDIR/bell.png" "Applying $choice effects" + eval "${effects[$choice]}" + sleep 1 + swww img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS & + wait $! + notify-send -u low -i "$iDIR/bell.png" "$choice effects applied" + fi + else + echo "Effects not recognized." + fi + } + + if pidof rofi > /dev/null; then + pkill rofi + exit 0 + fi + + main +} diff --git a/config/hypr/scripts/Ui_cmd.sh b/config/hypr/scripts/Ui_cmd.sh index 3d375eab..43ee98c2 100755 --- a/config/hypr/scripts/Ui_cmd.sh +++ b/config/hypr/scripts/Ui_cmd.sh @@ -98,15 +98,13 @@ change_layout() { ###################################### random_wall() { - swww query || swww init - PICS=("${wallDIR}"/*.{jpg,jpeg,png,gif}) # Array of image files in wallDIR +focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') - if [[ ${#PICS[@]} -gt 0 ]]; then - RANDOMPICS=${PICS[RANDOM % ${#PICS[@]}]} # Select a random image - swww img "${RANDOMPICS}" ${SWWW_PARAMS} # Set the randomly selected wallpaper - else - echo "No images found in ${wallDIR}" - fi +PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) +RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} + +swww query || swww-daemon --format xrgb && swww img -o $focused_monitor ${RANDOMPICS} $SWWW_PARAMS +$RunCMD symlink } @@ -117,13 +115,15 @@ random_wall() { ###################################### auto_wall() { + focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') INTERVAL=1800 # This controls (in seconds) when to switch to the next image - while true; do + while true; do find "$wallDIR" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \) -print0 \ | shuf -z -n 1 \ - | xargs -0 -I {} swww img "{}" ${SWWW_PARAMS} && - sleep $INTERVAL - done + | xargs -0 -I {} swww img -o $focused_monitor "{}" ${SWWW_PARAMS} && + $RunCMD symlink + sleep $INTERVAL + done } ###################################### @@ -133,6 +133,7 @@ auto_wall() { ###################################### select_wall() { + focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') build_theme() { rows="$1" cols="$2" @@ -150,47 +151,14 @@ select_wall() { choice=$(find "$wallDIR" -type f -maxdepth 1 -printf "%f\n" | shuf -n1) fi wallpaper="$wallDIR/${choice#*icon\x1f}" - swww img $SWWW_PARAMS1 "$wallpaper" + swww img -o $focused_monitor $SWWW_PARAMS1 "$wallpaper" + $RunCMD symlink else echo "No wallpaper selected. Exiting." exit 0 fi } -###################################### -# # -# Waybar Layout # -# # -###################################### - -#waybar_layout() { -# menu() { -# find "$config_dir" -maxdepth 1 -type f -exec basename {} \; | sort -# } -# apply_config() { -# ln -sf "$config_dir/$1" "$waybar_config" -# restart_waybar_if_needed -# } -#restart_waybar_if_needed() { -# if pgrep -x "waybar" >/dev/null; then -# pkill waybar -# sleep 0.1 -# fi -# $RunCMD reload_waybar & -#} -# main() { -# choice=$(menu | rofi -dmenu -p "  Choose Waybar Layout") -# -# [[ -z "$choice" ]] && { echo "No option selected. Exiting."; exit 0; } -# -# case $choice in -# "no panel") pkill -x waybar || true ;; -# *) apply_config "$choice" ;; -# esac -# } -# pgrep -x rofi && { pkill rofi; exit 0; } -# main -#} ###################################### # # @@ -211,9 +179,9 @@ gamemode() { } ###################################### -# # -# Toggle Opaque # -# # +# # +# Toggle Opaque # +# # ###################################### enable_opaque() { @@ -226,8 +194,8 @@ disable_opaque() { } ###################################### -# Keyboard Layout Switcher # -# # +# Keyboard Layout Switcher # +# # ###################################### kb_changer() { @@ -247,3 +215,4 @@ kb_changer() { notify-send -u low -i "$notif" "Keyboard language changed to $new_layout" } + diff --git a/config/hypr/scripts/hyprshade.sh b/config/hypr/scripts/hyprshade.sh new file mode 100755 index 00000000..5356fc8f --- /dev/null +++ b/config/hypr/scripts/hyprshade.sh @@ -0,0 +1 @@ +hyprshade_filter="blue-light-filter" diff --git a/config/hypr/scripts/wal_effect.sh b/config/hypr/scripts/wal_effect.sh new file mode 100755 index 00000000..5ca07c92 --- /dev/null +++ b/config/hypr/scripts/wal_effect.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +# Wallpaper Effects using imagemagick +# Inspiration from ML4W - Stephan Raabe https://gitlab.com/stephan-raabe/dotfiles + +# variables +current_wallpaper="$HOME/dotfiles/hypr/wallpaper_effects/.wallpaper_current" +wallpaper_output="$HOME/dotfiles/hypr/wallpaper_effects/.wallpaper_modified" +SCRIPTSDIR="$HOME/dotfiles/hypr/scripts" +focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') + +# Directory for swaync +iDIR="$HOME/dotfiles/hypr/assets/" + +# swww transition config +FPS=60 +TYPE="wipe" +DURATION=2 +BEZIER=".43,1.19,1,.4" +SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION" + +# Define ImageMagick effects +# https://imagemagick.org/script/magick.php + +declare -A effects=( +["Black & White"]="magick $current_wallpaper -set colorspace Gray -separate -average $wallpaper_output" +["Blurred"]="magick $current_wallpaper -blur "20x30" $wallpaper_output" +["Solarize"]="magick $current_wallpaper -solarize 80% $wallpaper_output" +["Sepia Tone"]="magick $current_wallpaper -sepia-tone 65% $wallpaper_output" +["Negate"]="magick $current_wallpaper -negate $wallpaper_output" +["Charcoal"]="magick $current_wallpaper -charcoal "10x10" $wallpaper_output" +["No Effects"]="no-effects" +) + +# Function to apply no effects +no_effects() { + swww img -o "$focused_monitor" "$current_wallpaper" $SWWW_PARAMS & + # Wait for swww command to complete + wait $! + notify-send -u low -i "$iDIR/bell.png" "No wallpaper effects" + + # copying wallpaper for rofi menu + cp $current_wallpaper $wallpaper_output +} + +# Function to run rofi menu +main() { + # Populate rofi menu options + options="No Effects\n" + for effect in "${!effects[@]}"; do + if [ "$effect" != "No Effects" ]; then + options+="$effect\n" + fi + done + + # rofi + choice=$(echo -e "$options" | rofi -i -dmenu) + if [ ! -z "$choice" ]; then + # Check if the choice exists in the array + if [[ "${effects[$choice]+exists}" ]]; then + if [ "$choice" == "No Effects" ]; then + no_effects + else + # Apply selected effect + notify-send -u normal -i "$iDIR/bell.png" "Applying $choice effects" + eval "${effects[$choice]}" + # Wait for effects to be applied + sleep 1 + # Execute swww command after image conversion + swww img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS & + # Wait for swww command to complete + wait $! + notify-send -u low -i "$iDIR/bell.png" "$choice effects applied" + fi + else + echo "Effects not recognized." + fi + fi +} + +# Check if rofi is already running +if pidof rofi > /dev/null; then + pkill rofi + exit 0 +fi + +main diff --git a/config/hypr/wallpaper_effects/.wallpaper_current b/config/hypr/wallpaper_effects/.wallpaper_current new file mode 120000 index 00000000..b8401e4d --- /dev/null +++ b/config/hypr/wallpaper_effects/.wallpaper_current @@ -0,0 +1 @@ +/home/sankalp/Pictures/wallpapers/lordkrishna.jpg \ No newline at end of file diff --git a/config/hypr/wallpaper_effects/.wallpaper_modified b/config/hypr/wallpaper_effects/.wallpaper_modified new file mode 100644 index 00000000..7c779d79 Binary files /dev/null and b/config/hypr/wallpaper_effects/.wallpaper_modified differ diff --git a/config/waybar/modules b/config/waybar/modules index dc2c82c3..296d5683 100644 --- a/config/waybar/modules +++ b/config/waybar/modules @@ -136,7 +136,7 @@ "7": "", "8": "", "9": "󰚌", - "10": "", + "10": "#", "focused": "", "default": "", }, @@ -162,6 +162,7 @@ "title<.*facebook.*>": " ", "title<.*Picture-in-Picture.*>": " ", "class": " ", + "class<.*qutebrowser.*>": "󰖟 ", "class<.*term.*>": " ", "class": " ", "class": " ", @@ -213,14 +214,6 @@ ] }, -"group/audio": { - "orientation": "horizontal", - "modules": [ - "pulseaudio", - "pulseaudio#microphone", - ] -}, - "group/keyboard": { "orientation": "horizontal", "modules": [ @@ -229,6 +222,21 @@ ] }, +"group/mobo_drawer": { + "orientation": "inherit", + "drawer": { + "transition-duration": 500, + "children-class": "cpu", + "transition-left-to-right": true + }, + "modules": [ + "temperature", + "cpu", + "memory", + "disk", + ] +}, + "backlight": { "interval": 2, "align": 0,