diff --git a/README.md b/README.md index 2b21ccd..4359bb7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # Waybox -An Openbox clone on Wayland (WIP) + +A \*box-style (minimalist) Wayland compositor modeled largely on Openbox (WIP) ### Goals -The main goal of this project is to provide a similar feel to Openbox but on Wayland + +The main goal of this project is to provide a similar feel to \*box-style window managers but on Wayland ### Contributing @@ -29,6 +31,26 @@ ninja After that, you should have an executable as waybox/waybox +### Screenshots + +![Plain desktop with wallpaper, panel, and dock](raw/master/screenshots/emptydesktop.png) + +![Showing Firefox and some of the Waybox source code](raw/master/screenshots/work.png) + +![All work and no play](raw/master/screenshots/play.png) + +### Useful Programs + +Because \*box-style compositors are minimalist, most functionality is left to external programs. As such, Waybox only functions as a box in which you can put whatever you need. Here are some useful programs to complement Waybox if you desire: + +* Panel: You can use [Waybar](https://github.com/Alexays/Waybar) or [yambar](https://codeberg.org/dnkl/yambar), similar to tint2 or fbpanel in Openbox or Fluxbox. +* Dock: You can use [Cairo Dock](https://www.glx-dock.org/) just like you did on Openbox. There's also a [port with Wayland-specific enhancements](https://github.com/dkondor/cairo-dock-core/) that you may want to try. +* Wallpaper utility: There are various utilities to set your wallpaper, each with their own advantages, including [wpaperd](https://github.com/danyspin97/wpaperd) (can select a random wallpaper from a directory), [swaybg](https://github.com/swaywm/swaybg) (can set the background color as well well as a wallpaper), and [hyprpaper](https://github.com/hyprwm/hyprpaper) (can change the wallpaper dynamically during runtime through IPC). +* Notification client: [mako](https://wayland.emersion.fr/mako/) +* [wl-clipboard](https://wayland.emersion.fr/mako/): Access the clipboard in scripts (also used by [neovim](https://neovim.io/)) +* Screenshots: [grim](https://git.sr.ht/~emersion/grim) and [slurp](https://github.com/emersion/slurp) +* Screen recording: [wf-recorder](https://github.com/ammen99/wf-recorder) + ### Contact I can be found as wiz on Rizon and wizbright on Libera. Join [#waybox](https://libera.chat/guides/connect) for discussion diff --git a/data/autostart b/data/autostart index b975d7b..838e3ab 100644 --- a/data/autostart +++ b/data/autostart @@ -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 diff --git a/data/meson.build b/data/meson.build index 7f6f74a..a5a233b 100644 --- a/data/meson.build +++ b/data/meson.build @@ -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', diff --git a/data/waybox.desktop b/data/waybox.desktop index 49355c4..33a1e02 100644 --- a/data/waybox.desktop +++ b/data/waybox.desktop @@ -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 diff --git a/data/waybox.svg b/data/waybox.svg new file mode 100644 index 0000000..4146670 --- /dev/null +++ b/data/waybox.svg @@ -0,0 +1,14 @@ + + + + Waybox icon + + + + + + + + + diff --git a/screenshots/emptydesktop.png b/screenshots/emptydesktop.png new file mode 100644 index 0000000..7f5bd73 Binary files /dev/null and b/screenshots/emptydesktop.png differ diff --git a/screenshots/play.png b/screenshots/play.png new file mode 100644 index 0000000..f9f3a0e Binary files /dev/null and b/screenshots/play.png differ diff --git a/screenshots/work.png b/screenshots/work.png new file mode 100644 index 0000000..5f0de30 Binary files /dev/null and b/screenshots/work.png differ