Expanded README with screenshots and useful programs

Fixes #36 and resolves partially #32
This commit is contained in:
Keith Bowes 2023-12-29 18:12:37 -05:00
parent d139b41259
commit 3687099182
8 changed files with 83 additions and 12 deletions

View file

@ -23,15 +23,43 @@ cairo-dock &
mako &
# Load a random wallpaper
oldifs=$IFS
IFS=:
data_dirs=${XDG_DATA_DIRS:-${datadir:-/usr/share}}:${XDG_DATA_HOME:-~/.local/share}
for data_dir in $data_dirs;
do
wpdir="$data_dir/wallpapers"
test -d "$wpdir" && \
find $wpdir -name '*.jpg' -o -name '*.png' -o -name '*.svg'
done | (shuf -n 1 || tail -n 1) | xargs swaybg -c '#303030' -m fill -i &
IFS=$oldifs
get_random_wallpaper()
{
oldifs=$IFS
IFS=:
data_dirs=${XDG_DATA_DIRS:-${datadir:-/usr/share}}:${XDG_DATA_HOME:-~/.local/share}
for data_dir in $data_dirs;do
IFS=$oldifs
wpdir="$data_dir/wallpapers"
test -d "$wpdir" && \
find $wpdir -name '*.jpg' -o -name '*.png' -o -name '*.svg'
done | (shuf -n 1 || tail -n 1)
}
load_wallpaper() {
if (which hyprpaper && which socat && which wayland-info) >/dev/null 2>&1; then
hyprpaper &
HYPRPAPER_SOCKET=/tmp/hypr/.hyprpaper.sock
# Change the wallpaper every hour
while test -S $HYPRPAPER_SOCKET; do
#current_output=$(wayland-info -i wl_output | \
# grep 'name:' | tail -n 1 | cut -d : -f 2 | tr -d ' ')
random_wallpaper="$(get_random_wallpaper)"
for cmd in "preload $random_wallpaper" \
"wallpaper $current_output,$random_wallpaper" \
'unload all';
do
printf "$cmd" | socat UNIX-CONNECT:$HYPRPAPER_SOCKET -
done
[ $? -eq 0 ] && sleep 60m
done
elif which swaybg >/dev/null 2>&1; then
get_random_wallpaper | xargs swaybg -c '#303030' -m fill -i &
elif which wpaperd >/dev/null 2>&1; then
wpaperd &
fi
}
load_wallpaper &
# vim: ft=sh

View file

@ -33,6 +33,12 @@ install_data(
install_mode: 'rw-r--r--',
)
install_data(
'waybox.svg',
install_dir: get_option('prefix') / get_option('datadir') / 'icons',
install_mode: 'rw-r--r--',
)
install_data(
'waybox.desktop',
install_dir: get_option('prefix') / get_option('datadir') + '/wayland-sessions',

View file

@ -4,4 +4,5 @@ Comment=An Openbox-like compositor for Wayland
Comment[de]=Ein Wayland-Compositor ähnlich zu Openbox
Comment[eo]=Komponilo de Wayland, kiu similas je Openbox
Exec=waybox
Icon=waybox
Type=Application

14
data/waybox.svg Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="48px" width="48px">
<desc>Waybox icon</desc>
<defs>
<linearGradient id="titlegradient" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#589bda" />
<stop offset="100%" stop-color="#3c7cb7" />
</linearGradient>
</defs>
<rect height="10" width="48" x="0" y="0" fill="url(#titlegradient)" />
<rect height="38" width="48" x="0" y="10" fill="#eaeaea" />
</svg>

After

Width:  |  Height:  |  Size: 601 B