mirror of
https://codeberg.org/scip/swaybuild.git
synced 2025-12-16 20:11:02 +01:00
add
This commit is contained in:
118
Dockerfile
Normal file
118
Dockerfile
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
# syntax=docker.io/docker/dockerfile:1
|
||||||
|
|
||||||
|
ARG BASE_IMAGE=docker.io/debian:trixie
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
PACKAGES=(
|
||||||
|
build-essential
|
||||||
|
cmake
|
||||||
|
cdbs
|
||||||
|
devscripts
|
||||||
|
equivs
|
||||||
|
meson
|
||||||
|
wayland-protocols
|
||||||
|
libwayland-dev
|
||||||
|
libwayland-bin
|
||||||
|
libwayland-client0
|
||||||
|
libdrm-dev
|
||||||
|
libxkbcommon-dev
|
||||||
|
libudev-dev
|
||||||
|
hwdata
|
||||||
|
libseat-dev
|
||||||
|
libgles-dev
|
||||||
|
libavutil-dev
|
||||||
|
libavcodec-dev
|
||||||
|
libavformat-dev
|
||||||
|
libgbm-dev
|
||||||
|
xwayland
|
||||||
|
libxcb-composite0-dev
|
||||||
|
libxcb-icccm4-dev
|
||||||
|
libxcb-res0-dev
|
||||||
|
libxcb-errors-dev
|
||||||
|
libinput-dev
|
||||||
|
libxcb-present-dev
|
||||||
|
libxcb-render-util0-dev
|
||||||
|
libxcb-xinput-dev
|
||||||
|
glslang-tools
|
||||||
|
glslang-dev
|
||||||
|
libpcre2-dev
|
||||||
|
libjson-c-dev
|
||||||
|
libgdk-pixbuf-2.0-dev
|
||||||
|
libsystemd-dev
|
||||||
|
scdoc
|
||||||
|
bash-completion
|
||||||
|
libpango1.0-dev
|
||||||
|
libcairo2-dev
|
||||||
|
libxcb-ewmh-dev
|
||||||
|
libdisplay-info-dev
|
||||||
|
libliftoff-dev
|
||||||
|
liblcms2-dev
|
||||||
|
libvulkan-dev
|
||||||
|
wget
|
||||||
|
bash
|
||||||
|
git
|
||||||
|
ca-certificates
|
||||||
|
libmpdclient-dev
|
||||||
|
libnl-3-dev
|
||||||
|
libxcb-util-dev
|
||||||
|
libxcb-xkb-dev
|
||||||
|
libxkbcommon-x11-dev
|
||||||
|
libxcb-cursor-dev
|
||||||
|
libxcb-xinerama0-dev
|
||||||
|
libxcb-keysyms1-dev
|
||||||
|
libstartup-notification0-dev
|
||||||
|
flex
|
||||||
|
bison
|
||||||
|
)
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
apt-get --yes install --no-install-recommends "${PACKAGES[@]}"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
ARG WLROOTSVERSION WLROOTSLIBVERSION SWAYFXVERSION SCENEFXVERSION SCENEFXLIBVERSION ROFIVERSION
|
||||||
|
|
||||||
|
ENV WLROOTSVERSION=${WLROOTSVERSION}
|
||||||
|
ENV WLROOTSLIBVERSION=${WLROOTSLIBVERSION}
|
||||||
|
ENV SWAYFXVERSION=${SWAYFXVERSION}
|
||||||
|
ENV SCENEFXVERSION=${SCENEFXVERSION}
|
||||||
|
ENV SCENEFXLIBVERSION=${SCENEFXLIBVERSION}
|
||||||
|
ENV ROFIVERSION=${ROFIVERSION}
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
wget "https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/${WLROOTSVERSION}/wlroots-${WLROOTSVERSION}.tar.gz"
|
||||||
|
tar -xf "wlroots-${WLROOTSVERSION}.tar.gz"
|
||||||
|
rm "wlroots-${WLROOTSVERSION}.tar.gz"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
wget "https://github.com/WillPower3309/swayfx/archive/refs/tags/${SWAYFXVERSION}.tar.gz"
|
||||||
|
tar -xf "${SWAYFXVERSION}.tar.gz"
|
||||||
|
rm "${SWAYFXVERSION}.tar.gz"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
wget "https://github.com/wlrfx/scenefx/archive/refs/tags/${SCENEFXVERSION}.tar.gz"
|
||||||
|
tar -xf "${SCENEFXVERSION}.tar.gz"
|
||||||
|
rm "${SCENEFXVERSION}.tar.gz"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
#wget "https://github.com/davatorium/rofi/releases/download/${ROFIVERSION}/rofi-${ROFIVERSION}.tar.gz"
|
||||||
|
#tar -xf "rofi-${ROFIVERSION}.tar.gz"
|
||||||
|
#rm "rofi-${ROFIVERSION}.tar.gz"
|
||||||
|
git clone --recursive https://github.com/DaveDavenport/rofi rofi-${ROFIVERSION}
|
||||||
|
cd rofi-${ROFIVERSION}
|
||||||
|
git submodule update --init
|
||||||
|
EOF
|
||||||
|
|
||||||
|
COPY build.sh .
|
||||||
|
RUN chmod 755 build.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/build/build.sh"]
|
||||||
166
README.md
Normal file
166
README.md
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="assets/swayfx_logo.svg" width="256" alt="swayfx logo">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
Sway is an incredible window manager, and certainly one of the most well established wayland window managers. However, it is restricted to only include the functionality that existed in i3. This fork ditches the simple wlr_renderer, and replaces it with our fx_renderer, capable of rendering with fancy GLES2 effects. This, along with a couple of minor changes, expands sway's featureset to include the following:
|
||||||
|
|
||||||
|
+ **Blur**
|
||||||
|
+ **Anti-aliased rounded corners, borders, and titlebars**
|
||||||
|
+ **Shadows**
|
||||||
|
+ **Dim unfocused windows**
|
||||||
|
+ **Scratchpad treated as minimize**: Allows docks, or panels with a taskbar, to correctly interpret minimize / unminimize requests ([thanks to LCBCrion](https://github.com/swaywm/sway/issues/6457))
|
||||||
|
+ **nixify the repo**: Allows nixos users to easily contribute to and test this project
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://repology.org/project/swayfx/versions"><img src="https://repology.org/badge/vertical-allrepos/swayfx.svg" height="282"/></a>
|
||||||
|
<img src="assets/swayfx_screenshot.jpg" width="500"/>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
[SwayFX is also available on the Fedora copr](https://copr.fedorainfracloud.org/coprs/swayfx/swayfx/)
|
||||||
|
|
||||||
|
[Join our Discord](https://discord.gg/qsSx397rkh)
|
||||||
|
|
||||||
|
## New Configuration Options
|
||||||
|
|
||||||
|
+ Window blur:
|
||||||
|
- `blur enable|disable`
|
||||||
|
- `blur_xray enable|disable`: this will set floating windows to blur based on the background, not the windows below. You probably want to set this to `disable` :)
|
||||||
|
- `blur_passes <integer value 0 - 10>`
|
||||||
|
- `blur_radius <integer value 0 - 10>`
|
||||||
|
- `blur_noise <float value 0 - 1>`
|
||||||
|
- `blur_brightness <float value 0 - 2>`
|
||||||
|
- `blur_contrast <float value 0 - 2>`
|
||||||
|
- `blur_saturation <float value 0 - 2>`
|
||||||
|
+ Corner radius: `corner_radius <val>`
|
||||||
|
+ Window shadows:
|
||||||
|
- `shadows enable|disable`
|
||||||
|
- `shadows_on_csd enable|disable` (**Note**: The shadow might not fit some windows)
|
||||||
|
- `shadow_blur_radius <integer value 0 - 99>`
|
||||||
|
- `shadow_color <hex color with alpha> ex, #0000007F`
|
||||||
|
- `shadow_offset <x offset> <y offset>`
|
||||||
|
- `shadow_inactive_color <hex color with alpha> ex, #0000007F`
|
||||||
|
+ LayerShell effects (to blur panels / notifications etc):
|
||||||
|
- `layer_effects <layer namespace> <effects>`
|
||||||
|
- The current layer namespaces can be shown with `swaymsg -r -t get_outputs | jq '.[0].layer_shell_surfaces | .[] | .namespace'`
|
||||||
|
- Example: `layer_effects "waybar" blur enable; shadows enable; corner_radius 6`
|
||||||
|
- Note: If an application uses gtk, its namespace is likely to be "gtk-layer-shell"
|
||||||
|
- SwayIPC Example: `swaymsg layer_effects "waybar" "blur enable"` (you can only set one effect at a time through `swaymsg`)
|
||||||
|
- Config Example:
|
||||||
|
```
|
||||||
|
layer_effects "waybar" {
|
||||||
|
blur enable;
|
||||||
|
blur_xray enable;
|
||||||
|
blur_ignore_transparent enable;
|
||||||
|
shadows enable;
|
||||||
|
corner_radius 20;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- Available Effects:
|
||||||
|
- `blur <enable|disable>`
|
||||||
|
- `blur_xray <enable|disable>`
|
||||||
|
- `blur_ignore_transparent <enable|disable>`
|
||||||
|
- `shadows <enable|disable>`
|
||||||
|
- `corner_radius <int>`
|
||||||
|
- `reset`: To reset/disable all previously applied effects to the layer application
|
||||||
|
+ Dim unfocused windows:
|
||||||
|
- `default_dim_inactive <float value 0.0 - 1.0>`
|
||||||
|
- `for_window [CRITERIA_HERE] dim_inactive <float value 0.0 - 1.0>`
|
||||||
|
- `dim_inactive_colors.unfocused <hex color> ex, #000000FF`
|
||||||
|
- `dim_inactive_colors.urgent <hex color> ex, #900000FF`
|
||||||
|
+ Keep/remove separator border between titlebar and content: `titlebar_separator enable|disable`
|
||||||
|
+ Treat Scratchpad as minimized: `scratchpad_minimize enable|disable`: **we recommend keeping this setting off, as there are many kinks to iron out here**
|
||||||
|
|
||||||
|
## Roadmap
|
||||||
|
|
||||||
|
+ fade in / out animations
|
||||||
|
+ window movement animations
|
||||||
|
|
||||||
|
## Compiling From Source
|
||||||
|
|
||||||
|
### Nix
|
||||||
|
|
||||||
|
If you have Nix installed, you can build and run SwayFX easily:
|
||||||
|
|
||||||
|
```
|
||||||
|
nix build
|
||||||
|
./result/bin/sway
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also bring up a development shell and follow the build instructions below, without installing all of the dependencies manually:
|
||||||
|
|
||||||
|
```
|
||||||
|
nix develop
|
||||||
|
```
|
||||||
|
### Debian
|
||||||
|
|
||||||
|
Check [INSTALL-deb.md](/INSTALL-deb.md)
|
||||||
|
|
||||||
|
### Container (Docker)
|
||||||
|
|
||||||
|
To build SwayFX inside a container, install Docker and run the following commands from inside this repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# build the container and run it (which builds SwayFX)
|
||||||
|
docker compose up --build
|
||||||
|
|
||||||
|
# become root to install the previously built files
|
||||||
|
sudo bash
|
||||||
|
|
||||||
|
# copy all files into the host file system at /usr/local/
|
||||||
|
while read -r FILE; do
|
||||||
|
NEW_FILE=/usr/local${FILE#opt}
|
||||||
|
NEW_DIR=$(dirname "${NEW_FILE}")
|
||||||
|
[[ -d ${NEW_DIR} ]] || mkdir -p "${NEW_DIR}"
|
||||||
|
|
||||||
|
echo "Creating '${NEW_FILE}'"
|
||||||
|
cp "${FILE}" "${NEW_FILE}"
|
||||||
|
done < <(command find opt/ -type f)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manual Steps
|
||||||
|
|
||||||
|
Install dependencies:
|
||||||
|
|
||||||
|
* meson \*
|
||||||
|
* wlroots
|
||||||
|
* wayland
|
||||||
|
* wayland-protocols \*
|
||||||
|
* pcre2
|
||||||
|
* json-c
|
||||||
|
* pango
|
||||||
|
* cairo
|
||||||
|
* [scenefx](https://github.com/wlrfx/scenefx)
|
||||||
|
* gdk-pixbuf2 (optional: additional image formats for system tray)
|
||||||
|
* [swaybg] (optional: wallpaper)
|
||||||
|
* [scdoc] (optional: man pages) \*
|
||||||
|
* git (optional: version info) \*
|
||||||
|
|
||||||
|
_\* Compile-time dep_
|
||||||
|
|
||||||
|
Run these commands:
|
||||||
|
|
||||||
|
meson build/
|
||||||
|
ninja -C build/
|
||||||
|
sudo ninja -C build/ install
|
||||||
|
|
||||||
|
On systems without logind nor seatd, you need to suid the sway binary:
|
||||||
|
|
||||||
|
sudo chmod a+s /usr/local/bin/sway
|
||||||
|
|
||||||
|
SwayFX will drop root permissions shortly after startup.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
SwayFX would love to receive any new features that you're willing to build! Generally, we'd like to focus on eye-candy type improvements to keep our scope appropriate. If you'd like to build something that you think may be out of that focus, please raise an issue and we can discuss whether or not it will fit within this project.
|
||||||
|
|
||||||
|
## Acknowledgements
|
||||||
|
|
||||||
|
The SwayFX team would like to first and foremost thank the maintainers and contributors of the Sway window manager. We are but a humble group of Sway enthusiasts who wanted to expand upon your creation.
|
||||||
|
|
||||||
|
We would also like to thank the talented artists in our community for contibuting the visual assets that give this project charm:
|
||||||
|
+ pkdesuwu and honchokomodo for creating the swayfx mascot: https://twitter.com/pkdesuwu/status/1664517033017368576
|
||||||
|
+ spooky_skeleton for the swayfx logo, and [Basil](https://basil.cafe) for making some fine adjustments to it
|
||||||
|
|
||||||
|
Lastly, we would like to thank you, the community, for enjoying and using window manager that we have spent so much time maintaining.
|
||||||
|
|
||||||
56
build.sh
Normal file
56
build.sh
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
|
||||||
|
set -eE -u -o pipefail
|
||||||
|
shopt -s inherit_errexit
|
||||||
|
|
||||||
|
#
|
||||||
|
# WLROOTS
|
||||||
|
meson setup --prefix /opt "wlroots-${WLROOTSVERSION}/build/" "wlroots-${WLROOTSVERSION}"
|
||||||
|
ninja -C "wlroots-${WLROOTSVERSION}/build/"
|
||||||
|
ninja -C "wlroots-${WLROOTSVERSION}/build/" install
|
||||||
|
ls -l /opt/lib/x86_64-linux-gnu/pkgconfig
|
||||||
|
echo "wlroots DONE"
|
||||||
|
echo
|
||||||
|
|
||||||
|
#
|
||||||
|
# SCENEFX
|
||||||
|
PKG_CONFIG_PATH="/opt/lib/x86_64-linux-gnu/pkgconfig/${PKG_CONFIG_PATH+:${PKG_CONFIG_PATH}}" \
|
||||||
|
meson setup --prefix /opt --cmake-prefix-path /opt "scenefx-${SCENEFXVERSION}/build/" "scenefx-${SCENEFXVERSION}"
|
||||||
|
ninja -C "scenefx-${SCENEFXVERSION}/build/"
|
||||||
|
ninja -C "scenefx-${SCENEFXVERSION}/build/" install
|
||||||
|
echo "scenefx DONE"
|
||||||
|
echo
|
||||||
|
|
||||||
|
#
|
||||||
|
# SWAYFX
|
||||||
|
PKG_CONFIG_PATH="/opt/lib/x86_64-linux-gnu/pkgconfig/${PKG_CONFIG_PATH+:${PKG_CONFIG_PATH}}" \
|
||||||
|
meson setup --prefix /opt --cmake-prefix-path /opt "swayfx-${SWAYFXVERSION}/build/" "swayfx-${SWAYFXVERSION}"
|
||||||
|
ninja -C "swayfx-${SWAYFXVERSION}/build/"
|
||||||
|
ninja -C "swayfx-${SWAYFXVERSION}/build/" install
|
||||||
|
echo "swayfx DONE"
|
||||||
|
echo
|
||||||
|
|
||||||
|
#
|
||||||
|
# ROFI
|
||||||
|
PKG_CONFIG_PATH="/opt/lib/x86_64-linux-gnu/pkgconfig/${PKG_CONFIG_PATH+:${PKG_CONFIG_PATH}}" \
|
||||||
|
meson setup --prefix /opt --cmake-prefix-path /opt "rofi-${ROFIVERSION}/build/" "rofi-${ROFIVERSION}"
|
||||||
|
ninja -C "rofi-${ROFIVERSION}/build/"
|
||||||
|
ninja -C "rofi-${ROFIVERSION}/build/" install
|
||||||
|
echo "rofi DONE"
|
||||||
|
echo
|
||||||
|
|
||||||
|
mv /opt/bin/sway /opt/bin/swayfx
|
||||||
|
|
||||||
|
cat >/opt/bin/swayfx.sh <<"EOF"
|
||||||
|
#!/bin/sh
|
||||||
|
export PATH=/opt/bin:${PATH}
|
||||||
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/lib/x86_64-linux-gnu/
|
||||||
|
exec /opt/bin/swayfx
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod 755 /opt/bin/swayfx.sh
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Successfully build swayfx. Find it in your hosts bind directory (default: ./opt)."
|
||||||
13
compose.yml
Normal file
13
compose.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
swayfxbuild:
|
||||||
|
container_name: swayfxbuild
|
||||||
|
build:
|
||||||
|
args:
|
||||||
|
WLROOTSVERSION: 0.19.0
|
||||||
|
WLROOTSLIBVERSION: 0.19
|
||||||
|
SWAYFXVERSION: 0.5.3
|
||||||
|
SCENEFXVERSION: 0.4.1
|
||||||
|
SCENEFXLIBVERSION: 0.4
|
||||||
|
ROFIVERSION: 1.7.9.1
|
||||||
|
volumes:
|
||||||
|
- ./opt:/opt
|
||||||
Reference in New Issue
Block a user