mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
Change background setup to cycle
This commit is contained in:
22
bin/swaybg-next
Executable file
22
bin/swaybg-next
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Cycles through the background images available
|
||||||
|
|
||||||
|
BACKGROUNDS_DIR="$HOME/.local/share/backgrounds"
|
||||||
|
NEXT_BACKGROUND_FILE="$HOME/.cache/next_background_index"
|
||||||
|
|
||||||
|
BACKGROUNDS=($(find "$BACKGROUNDS_DIR" -type f | sort))
|
||||||
|
TOTAL=${#BACKGROUNDS[@]}
|
||||||
|
|
||||||
|
if [[ ! -f "$NEXT_BACKGROUND_FILE" ]]; then
|
||||||
|
INDEX=0
|
||||||
|
else
|
||||||
|
INDEX=$(<"$NEXT_BACKGROUND_FILE")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Save next index (wrap around)
|
||||||
|
echo "$(( (INDEX + 1) % TOTAL ))" > "$NEXT_BACKGROUND_FILE"
|
||||||
|
|
||||||
|
# Launch swaybg
|
||||||
|
pkill -x swaybg
|
||||||
|
setsid swaybg -i "${BACKGROUNDS[$INDEX]}" -m fill >/dev/null 2>&1 &
|
@ -19,15 +19,14 @@ bind = SUPER, M, exec, spotify
|
|||||||
bind = SUPER, N, exec, alacritty -e nvim
|
bind = SUPER, N, exec, alacritty -e nvim
|
||||||
bind = SUPER, T, exec, alacritty -e btop
|
bind = SUPER, T, exec, alacritty -e btop
|
||||||
bind = SUPER SHIFT, SPACE, exec, pkill -SIGUSR1 waybar
|
bind = SUPER SHIFT, SPACE, exec, pkill -SIGUSR1 waybar
|
||||||
|
bind = SUPER CTRL, SPACE, exec, ~/.local/share/omarchy/bin/swaybg-next
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Environment-variables/
|
# See https://wiki.hyprland.org/Configuring/Environment-variables/
|
||||||
source = ~/.local/share/omarchy/default/hypr/envs.conf
|
source = ~/.local/share/omarchy/default/hypr/envs.conf
|
||||||
|
|
||||||
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
||||||
exec-once = hypridle & swaync & waybar
|
exec-once = hypridle & swaync & waybar
|
||||||
|
exec-once = ~/.local/share/omarchy/bin/swaybg-next
|
||||||
# Control backgrounds
|
|
||||||
source = ~/.local/share/omarchy/default/hypr/backgrounds.conf
|
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
### LOOK AND FEEL ###
|
### LOOK AND FEEL ###
|
||||||
|
@ -8,5 +8,5 @@ HISTFILESIZE="${HISTSIZE}"
|
|||||||
# source /usr/share/bash-completion/bash_completion
|
# source /usr/share/bash-completion/bash_completion
|
||||||
|
|
||||||
# Set complete path
|
# Set complete path
|
||||||
export PATH="./bin:$HOME/.local/bin:$PATH"
|
export PATH="./bin:$HOME/.local/bin:$HOME/.local/share/omarchy/bin:$PATH"
|
||||||
set +h
|
set +h
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
# Set a random image from ~/.local/share/backgrounds as the background
|
|
||||||
# Picks another random background on SUPER + CTRL + SPACE
|
|
||||||
exec-once = swaybg -i $(find ~/.local/share/backgrounds/ -type f -print0 | shuf -zn1 | xargs -0 printf '%s\n')
|
|
||||||
bind = SUPER CTRL, SPACE, exec, pkill -x swaybg && setsid swaybg -i $(find ~/.local/share/backgrounds/ -type f -print0 | shuf -zn1 | xargs -0 printf '%s\n')
|
|
2
install/backgrounds.sh
Normal file
2
install/backgrounds.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
gum spin --title "Downloading background image..." -- curl -sL -o ~/.local/share/backgrounds/Milad-Fakurian-Abstract-Purple-Blue.jpg https://images.unsplash.com/photo-1620207418302-439b387441b0
|
||||||
|
gum spin --title "Downloading background image..." -- curl -sL -o ~/.local/share/backgrounds/Pawel-Czerwinski-Abstract-Purple-Blue.jpg https://images.unsplash.com/photo-1651870364199-fc5f9f46ac85
|
@ -1,5 +1,2 @@
|
|||||||
# Prefer dark mode everything
|
# Prefer dark mode everything
|
||||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||||
|
|
||||||
# Download first background
|
|
||||||
curl -sL -o ~/.local/share/backgrounds/Milad-Fakurian-Abstract-Purple-Blue.jpg https://unsplash.com/photos/u8Jn2rzYIps/download?ixid=M3wxMjA3fDB8MXxzZWFyY2h8Mnx8YWJzdHJhY3QlMjB3YWxscGFwZXJ8ZW58MHx8fHwxNzQ5Mjc5ODk1fDA
|
|
||||||
|
Reference in New Issue
Block a user