Updates
This commit is contained in:
1 parent
3d3d66487b
commit
0dc1ab54fe
9 files changed
+247
-62
No files matched your search
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
hyprshade_filter="blue-light-filter"
|
||||
Executable
+87
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
/home/sankalp/Pictures/wallpapers/lordkrishna.jpg
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
+17
-9
@@ -136,7 +136,7 @@
|
||||
"7": "",
|
||||
"8": "",
|
||||
"9": "",
|
||||
"10": "",
|
||||
"10": "#",
|
||||
"focused": "",
|
||||
"default": "",
|
||||
},
|
||||
@@ -162,6 +162,7 @@
|
||||
"title<.*facebook.*>": " ",
|
||||
"title<.*Picture-in-Picture.*>": " ",
|
||||
"class<firefox>": " ",
|
||||
"class<.*qutebrowser.*>": " ",
|
||||
"class<.*term.*>": " ",
|
||||
"class<kitty>": " ",
|
||||
"class<konsole>": " ",
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user