GithubHelp home page GithubHelp logo

sway-ubuntu's Introduction

Sway builds for Ubuntu 24.04 (amd64)

Ubuntu 24.04 build system for sway and related tools.

Even though most of these tools (including sway and wlroots) are now available in Ubuntu, they move and evolve pretty quickly and I personally prefer to keep up to date with those.

This repository contains a Makefile based build system for all of these. We are NOT building deb packages (see my old repository which did if you want to do so), but we're directly building from source and installing as root.

Note: upgrading from Ubuntu 22.10 or earlier

You can safely ignore this note if this is the first time you're installing sway and all the other apps from this repo.

  • Wofi has been removed from our install targets as it's now semi-abandoned. It is, however, available to install from Ubuntu's repos via apt install wofi if you need it. Make sure you clean the compiled version up from the system:

      cd wofi
      sudo ninja -C build uninstall
  • Python's pip is now refusing to install global packages and instead recommending to use pipx to do so. I have migrated all such installs to pipx, but it means you need to clean up meson and ninja:

      sudo pip3 uninstall meson ninja --break-system-packages
  • After cleaning up meson and ninja, you need to install dependencies again as there are new ones, including meson and ninja. Run make yolo -e UPDATE=true to do so but also re-compile everything with the new base libraries.

Apps provided

Make sure you do not install these via Ubuntu's package repos.

Core:

  • Sway
  • wlroots
  • seatd

Apps:

  • clipman
  • kanshi
  • mako
  • nwg-panel
  • rofi (wayland fork)
  • swaylock-effects
  • swayimg
  • waybar
  • wdisplays
  • wf-recorder
  • xdg-desktop-portal-wlr (for screen sharing)

Wayfire apps:

  • wayfire / wf-config / wcm
  • wf-shell

Debs:

  • wayland-protocols 1.35

Deb rebuilds:

  • none

How about older Ubuntus?

There are (unmaintained) branches of this project for earlier versions of Ubuntu. They won't receive any fixes unless contributed by the community, as I have moved on from using them. PRs more than welcome.

I usually switch to the next ubuntu a few weeks before release, so typically old branches will have the very latest versions of the apps that are physically compilable given the libraries available.

How about the next (still in dev) version of Ubuntu

No reason it won't work. The debs files (if any) might pose a problem though as they are typically backported from the next Ubuntu version into the current when needed, and won't be needed on the next version, so make sure you tweak the Makefile not to install them.

How about arm (eg Raspberri PI)

It should work.

Prepare your system's environment

You must make sure that

LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu/

is set on your environment prior to starting Sway. This is required so that any apps you compile here can find each other's library, as they're placed somewhere else than Ubuntu's default library path.

Note: LD_LIBRARY_PATH on arm

The value will almost certainly be completely different. I don't use arm so I can't check. Please let me know if you know via a GitHub issue or a PR to this file.

Note: sudo

Some operations require root to complete - typically anything that requires access to /usr/local/. See Makefile for details.

While building, sudo will be run at some point to do so, and your password will be asked.

Note: meson and ninja

Make sure you uninstall meson and ninja if you've already installed them via Ubuntu's package manager. Sway and wlroots routinely require the very latest versions of both, so we'll be installing the latest versions using pipx instead.

Dependencies

  • git
  • lsb-release
  • make
  • sudo

Everything else can be installed via the provided targets in the Makefile.

Building stuff

First time, you should probably run

make yolo

This will clone all the app's git repos, install dev dependencies and tools required to build everything, then it proceeds to build each project in sequence.

Have a look at the Makefile for all the different build targets, in case you want to build this or the other app. I for instance build wlroots and sway once a week, for which I have

make core

If you just want to update the apps (not wlroots and sway):

make apps

Updating repositories before building

Simply pass -e UPDATE=true to make:

make mako -e UPDATE=true

App versions

At the top of the Makefile you'll see one variable per app that defines which version of that app to build that you can override via environment. By version, I mean either a git hash, or a branch, or a tag - we will simply be running git checkout $APP_VERSION before building that app.

For instance, if I wanted to build wlroots 0.11.0, sway 1.5 and swaylock-effects master, while making sure we're on the absolute latest commits for each:

make core swaylock-build -e SWAY_VERSION=1.5 -e WLROOTS_VERSION=0.11.0 -e UPDATE=true

Note the lack of SWAYLOCK_VERSION up there - master is already the default.

The .env file

You can create an .env file and place any overrides to environment variables in there, if you need to. This allows you to for these values in a more permanent and convenient fashion than command line (make -e FOO=bar ...) arguments, and without changing the Makefile which is handy if you need to do a git pull on this project. The .env file is ignored in source control and as such you need to create it yourself if you need it.

Example syntax:

SWAY_VERSION=master
WLROOTS_VERSION=master
SOME_APP_BUILD_MODIFIER_VAR=yes

Uninstalling stuff

When installing the stuff we're compiling, ninja will be copying the relevant files wherever they need to be in the system, without creating a deb package. Therefore, apt autoremove app won't work.

So far all the apps in the repo except for clipman use meson and ninja for building. As long as you don't delete the APP/build repository you can uninstall from the system anything ninja installs:

cd APP
sudo ninja -C build uninstall

If you deleted the build folder on the app, simply build the app again (on the same version as before) before running the command above.

wlroots & seatd dependencies

This goes without saying, but if you're updating wlroots or seatd make sure they're built first (seatd, then wlroots) so that any of the other apps that link against it (like sway) have the right version to link against instead of linking against the version you're replacing.

Screen sharing

Ubuntu 24.04 comes with all the plumbing to make it all work:

  • pipewire 0.3
  • wireplumber
  • xdg-desktop-portal-gtk with the correct build flags

Limitations

xdg-desktop-portal-wlr does not support window sharing, only entire outputs. No way around this. Apps won't show anything on the window list, when asked to initiate a screen sharing session.

How to install

make xdg-desktop-portal-wlr-build -e UPDATE=true

This will compile & install & make available the wlr portal to xdg-desktop-portal.

After that, make sure systemd has the following env var XDG_CURRENT_DESKTOP=sway. This won't work by merely setting that env var before you start sway. The best way is to create a file containing that at ~/.config/environment.d/xdg.conf, like so. Then reboot.

Choosing an output to share

When choosing to share a screen from an app, xdpw won't give it a list of available windows or screens to the app to display and for you to choose from. Instead, you'll need to tell your app to share everything and after that the xdpw's output chooser will kick in.

By default it'll be slurp - your cursor will change to a crosshairs and you'll be able to click on a screen to share only that one.

The chooser is configurable, see docs here: https://github.com/emersion/xdg-desktop-portal-wlr/blob/master/xdg-desktop-portal-wlr.5.scd#output-chooser

For instance, if you'd like to use rofi/dmenu, place the following on ~/config/xdg-desktop-portal-wlr/config

[screencast]
chooser_type=dmenu
chooser_cmd=rofi -dmenu

The actual defaults (if you had no config file) are:

[screencast]
chooser_type=simple
chooser_cmd="slurp -f %o -o"

Firefox

Should work out of the box on Firefox 84+ using the wayland backend.

When you start screensharing, on the dialog asking you what to share tell it to "Use operating system settings" when prompted. After that, the output chooser for xdpw will kick in, as explained on the previous section.

Chromium & Chrome

It should work out of the box when using the wayland backend, but if it doesn't open chrome://flags and ensure WebRTC PipeWire support is enabled.

sway-ubuntu's People

Contributors

gcalmettes avatar luispabon avatar mmhobi7 avatar monkz avatar olivierflowerror avatar sechmann avatar vipulmathur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sway-ubuntu's Issues

make yolo errors on Ubuntu Server 22.10

I don't know if you intend this to work on Ubuntu Server (but I hope so, it's an awesome initiative you've taken!), but in case, then make yolo errors (clean install with snapd removed).

Error: Symlink creation in /usr/share/xdg-desktop-portal/portals/ errors as directory does not exist.

Fix: mkdir -p /usr/share/xdg-desktop-portal/portals/, then re-run make yolo.

Then tings continue until the dependency processing for nwg-panel, where

cairo\bufferproxy.c:32:10: fatal error: Python.h No such file or directory
   32 | #include <Python.h>

(I took a photo if this is too little context).

I think I'll start over and go less YOLO. Edit: I looked at the Makefile and saw that nwg-panel-install was second last, so I just picked up with make swayimg-build, which concluded.

wofi build failing

Updated Ubuntu Desktop 21.04.

Build failing at this point.

cd wofi; hg pull; hg update;  sudo ninja -C build uninstall; sudo rm build -rf; meson build; ninja -C build; sudo ninja -C build install
/bin/sh: 1: cd: can't cd to wofi
abort: no repository found in '/home/pi/sway-ubuntu' (.hg not found)!
abort: no repository found in '/home/pi/sway-ubuntu' (.hg not found)!
ninja: Entering directory `build'
ninja: fatal: chdir to 'build' - No such file or directory

ERROR: Neither directory contains a build file meson.build.
ninja: Entering directory `build'
ninja: error: loading 'build.ninja': No such file or directory
ninja: Entering directory `build'
ninja: error: loading 'build.ninja': No such file or directory
make: *** [Makefile:247: wofi-build] Error 1

wlroots hangs when running git fetch

Looks like the HTTPS git endpoint at wlroots repo is borked:

https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/407

The only workaround available is to switch the remote to use ssh, but this requires people to create an accoung at gitlab.freedesktop and adding their pubkey.

~ cd wlroots
wlroots ~ git remote set-url origin [email protected]:wlroots/wlroots.git

Not ideal but nothing we can do from here other than tracking the error until it's fixed and let people know via this issue here.

make yolo fails while building sway

Trying this for the first time. Plain "make yolo" fails while building sway. I am attaching the error message.

WORKAROUND: make yolo -e SWAY_VERSION=1.6.1 WLROOT_VERSION=1.4 works, and builds sway 1.6.1

build-error.txt

meson.build:99:0: ERROR: Dependency "xkbregistry" not found, tried pkgconfig and cmake

Hello,

I encountered an error about "xkbregistry" when I ran make yolo on the focal branch.

Here is the trace:

$ make yolo
[...]
Dependency spdlog from subproject subprojects/spdlog-1.8.5 found: YES 1.8.5
Run-time dependency wayland-client found: YES 1.18.0
Run-time dependency wayland-cursor found: YES 1.18.0
Run-time dependency wayland-protocols found: YES 1.20
Run-time dependency gtkmm-3.0 found: YES 3.24.2
Run-time dependency dbusmenu-gtk3-0.4 found: YES 16.04.0
Run-time dependency gio-unix-2.0 found: YES 2.64.6
Run-time dependency jsoncpp found: YES 1.7.4
Run-time dependency sigc++-2.0 found: YES 2.10.2
Run-time dependency epoll-shim found: NO (tried pkgconfig and cmake)
Run-time dependency libnl-3.0 found: YES 3.4.0
Run-time dependency libnl-genl-3.0 found: YES 3.4.0
Run-time dependency libpulse found: YES 13.99.1
Run-time dependency libudev found: YES 245
Run-time dependency libevdev found: YES 1.9.0
Run-time dependency libmpdclient found: NO (tried pkgconfig and cmake)
Run-time dependency xkbregistry found: NO (tried pkgconfig and cmake)

meson.build:99:0: ERROR: Dependency "xkbregistry" not found, tried pkgconfig and cmake

A full log can be found at /home/ether/workspace/sway-ubuntu/Waybar/build/meson-logs/meson-log.txt
ninja: Entering directory `build'
ninja: error: loading 'build.ninja': No such file or directory
ninja: Entering directory `build'
ninja: error: loading 'build.ninja': No such file or directory
make[1]: *** [Makefile:166: meson-ninja-build] Error 1
make[1]: Leaving directory '/home/ether/workspace/sway-ubuntu'
make: *** [Makefile:179: waybar-build] Error 2

/home/ether/workspace/sway-ubuntu/Waybar/build/meson-logs/meson-log.txt

$ tail -n 20 /home/ether/workspace/sway-ubuntu/Waybar/build/meson-logs/meson-log.txt
-levdev
Run-time dependency libevdev found: YES 1.9.0
Pkg-config binary for 1 is cached.
Determining dependency 'libmpdclient' with pkg-config executable '/usr/bin/pkg-config'
env[PKG_CONFIG_PATH]: 
Called `/usr/bin/pkg-config --modversion libmpdclient` -> 1

CMake binary for 1 is cached.
Preliminary CMake check failed. Aborting.
Run-time dependency libmpdclient found: NO (tried pkgconfig and cmake)
Pkg-config binary for 1 is cached.
Determining dependency 'xkbregistry' with pkg-config executable '/usr/bin/pkg-config'
env[PKG_CONFIG_PATH]: 
Called `/usr/bin/pkg-config --modversion xkbregistry` -> 1

CMake binary for 1 is cached.
Preliminary CMake check failed. Aborting.
Run-time dependency xkbregistry found: NO (tried pkgconfig and cmake)

meson.build:99:0: ERROR: Dependency "xkbregistry" not found, tried pkgconfig and cmake

I found this repo while I am trying to improve my Sway's experience on Ubuntu. Indeed, since I switched from OpenSuse Tumbleweed to Ubuntu, I found sway is not working as good as before.

The most annoying part is that the screen sharing is not working very well: I can only share apps but not fullscreen.
I found it is related to PipeWire, building it with your code will install PipeWire and fix my issue?

Thanks

Ubuntu 22.04.1 LTS SERVER

After change branch to Jammy and use make yolo, I have error

Found ninja-1.10.2.git.kitware.jobserver-1 at /usr/local/bin/ninja
ninja: Entering directory `build'
[24/24] Linking target xdg-desktop-portal-wlr
ninja: Entering directory `build'
[0/1] Installing files.
Installing xdg-desktop-portal-wlr to /usr/local/libexec
Installing xdg-desktop-portal-wlr.5 to /usr/local/share/man/man5
Installing /home/pietryszak/sway-ubuntu/xdg-desktop-portal-wlr/build/xdg-desktop-portal-wlr.service to /usr/local/lib/systemd/user
Installing /home/pietryszak/sway-ubuntu/xdg-desktop-portal-wlr/build/org.freedesktop.impl.portal.desktop.wlr.service to /usr/local/share/dbus-1/services
Installing /home/pietryszak/sway-ubuntu/xdg-desktop-portal-wlr/wlr.portal to /usr/local/share/xdg-desktop-portal/portals
sudo ln -sf /usr/local/libexec/xdg-desktop-portal-wlr /usr/libexec/
sudo ln -sf /usr/local/share/xdg-desktop-portal/portals/wlr.portal /usr/share/xdg-desktop-portal/portals/
ln: failed to create symbolic link '/usr/share/xdg-desktop-portal/portals/': No such file or directory
make: *** [Makefile:282: xdg-desktop-portal-wlr-build] Error 1

Missing libwayland dependencies

Am I doing something wrong? sudo apt --fix-broken install got me going again but is this expected?

Vanilla install of latest version of Ubuntu Desktop 21.04.

sudo apt update && sudo apt upgrade -y
sudo apt install make git -y
git clone https://github.com/luispabon/sway-ubuntu.git && cd sway-ubuntu
touch .env
make yolo
Errors were encountered while processing:
 libwayland-client0:amd64
 libwayland-cursor0:amd64
 libwayland-dev:amd64
 libwayland-server0:amd64
 libwayland-cursor++0:amd64
make: *** [Makefile:202: libwayland-1.19] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.