mirror of
https://github.com/swaywm/sway.git
synced 2026-04-25 06:46:24 -04:00
Merge branch 'master' of https://github.com/swaywm/sway into zwlr-workspaces-implenent
This commit is contained in:
commit
c375120d7c
174 changed files with 5228 additions and 2954 deletions
|
|
@ -6,6 +6,7 @@ packages:
|
||||||
- json-c-dev
|
- json-c-dev
|
||||||
- libevdev-dev
|
- libevdev-dev
|
||||||
- libinput-dev
|
- libinput-dev
|
||||||
|
- libseat-dev
|
||||||
- libxcb-dev
|
- libxcb-dev
|
||||||
- libxkbcommon-dev
|
- libxkbcommon-dev
|
||||||
- mesa-dev
|
- mesa-dev
|
||||||
|
|
@ -16,10 +17,11 @@ packages:
|
||||||
- wayland-dev
|
- wayland-dev
|
||||||
- wayland-protocols
|
- wayland-protocols
|
||||||
- xcb-util-image-dev
|
- xcb-util-image-dev
|
||||||
- xorg-server-xwayland
|
- xcb-util-wm-dev
|
||||||
|
- xwayland
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/swaywm/sway
|
- https://github.com/swaywm/sway
|
||||||
- https://github.com/swaywm/wlroots
|
- https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||||
tasks:
|
tasks:
|
||||||
- wlroots: |
|
- wlroots: |
|
||||||
cd wlroots
|
cd wlroots
|
||||||
|
|
@ -28,7 +30,7 @@ tasks:
|
||||||
sudo ninja -C build install
|
sudo ninja -C build install
|
||||||
- setup: |
|
- setup: |
|
||||||
cd sway
|
cd sway
|
||||||
meson build -Dauto_features=enabled -Dtray=disabled
|
meson build --fatal-meson-warnings -Dauto_features=enabled -Dtray=disabled
|
||||||
- build: |
|
- build: |
|
||||||
cd sway
|
cd sway
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
|
@ -36,3 +38,10 @@ tasks:
|
||||||
cd sway
|
cd sway
|
||||||
meson configure build -Dxwayland=disabled
|
meson configure build -Dxwayland=disabled
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
- build-static: |
|
||||||
|
cd sway
|
||||||
|
mkdir subprojects
|
||||||
|
ln -s ../../wlroots subprojects/wlroots
|
||||||
|
rm -rf build
|
||||||
|
meson build --fatal-meson-warnings --default-library=static --force-fallback-for=wlroots
|
||||||
|
ninja -C build
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ packages:
|
||||||
- cairo
|
- cairo
|
||||||
- gdk-pixbuf2
|
- gdk-pixbuf2
|
||||||
- json-c
|
- json-c
|
||||||
|
- libegl
|
||||||
- libinput
|
- libinput
|
||||||
- libxcb
|
- libxcb
|
||||||
- libxkbcommon
|
- libxkbcommon
|
||||||
|
|
@ -12,10 +13,12 @@ packages:
|
||||||
- wayland
|
- wayland
|
||||||
- wayland-protocols
|
- wayland-protocols
|
||||||
- xcb-util-image
|
- xcb-util-image
|
||||||
- xorg-server-xwayland
|
- xcb-util-wm
|
||||||
|
- xorg-xwayland
|
||||||
|
- seatd
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/swaywm/sway
|
- https://github.com/swaywm/sway
|
||||||
- https://github.com/swaywm/wlroots
|
- https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||||
tasks:
|
tasks:
|
||||||
- wlroots: |
|
- wlroots: |
|
||||||
cd wlroots
|
cd wlroots
|
||||||
|
|
@ -24,7 +27,7 @@ tasks:
|
||||||
sudo ninja -C build install
|
sudo ninja -C build install
|
||||||
- setup: |
|
- setup: |
|
||||||
cd sway
|
cd sway
|
||||||
meson build -Dauto_features=enabled
|
meson build --fatal-meson-warnings -Dauto_features=enabled -Dsd-bus-provider=libsystemd
|
||||||
- build: |
|
- build: |
|
||||||
cd sway
|
cd sway
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
image: freebsd/latest
|
image: freebsd/latest
|
||||||
packages:
|
packages:
|
||||||
|
- devel/basu
|
||||||
- devel/json-c
|
- devel/json-c
|
||||||
- devel/libevdev
|
- devel/libevdev
|
||||||
- devel/meson
|
- devel/meson
|
||||||
|
|
@ -18,13 +19,14 @@ packages:
|
||||||
- devel/libudev-devd
|
- devel/libudev-devd
|
||||||
- graphics/libdrm
|
- graphics/libdrm
|
||||||
- graphics/mesa-libs
|
- graphics/mesa-libs
|
||||||
|
- sysutils/seatd
|
||||||
- x11/libinput
|
- x11/libinput
|
||||||
- x11/libX11
|
- x11/libX11
|
||||||
- x11/pixman
|
- x11/pixman
|
||||||
- x11/xcb-util-wm
|
- x11/xcb-util-wm
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/swaywm/sway
|
- https://github.com/swaywm/sway
|
||||||
- https://github.com/swaywm/wlroots
|
- https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||||
tasks:
|
tasks:
|
||||||
- setup: |
|
- setup: |
|
||||||
cd sway
|
cd sway
|
||||||
|
|
@ -32,7 +34,7 @@ tasks:
|
||||||
cd subprojects
|
cd subprojects
|
||||||
ln -s ../../wlroots wlroots
|
ln -s ../../wlroots wlroots
|
||||||
cd ..
|
cd ..
|
||||||
meson build
|
meson build --fatal-meson-warnings -Dtray=enabled -Dsd-bus-provider=basu
|
||||||
- build: |
|
- build: |
|
||||||
cd sway
|
cd sway
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,11 @@ IndentCaseLabels: false
|
||||||
SortIncludes: false
|
SortIncludes: false
|
||||||
ColumnLimit: 80
|
ColumnLimit: 80
|
||||||
AlignAfterOpenBracket: DontAlign
|
AlignAfterOpenBracket: DontAlign
|
||||||
BinPackParameters: false
|
BinPackParameters: true
|
||||||
BinPackArguments: false
|
BinPackArguments: true
|
||||||
ContinuationIndentWidth: 8
|
ContinuationIndentWidth: 8
|
||||||
AllowAllParametersOfDeclarationOnNextLine: false
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
AllowShortLoopsOnASingleLine: true
|
AllowShortLoopsOnASingleLine: true
|
||||||
ReflowComments: false
|
ReflowComments: false
|
||||||
|
AllowAllArgumentsOnNextLine: false
|
||||||
|
AlignOperands: DontAlign
|
||||||
|
|
|
||||||
5
.github/FUNDING.yml
vendored
5
.github/FUNDING.yml
vendored
|
|
@ -1,5 +0,0 @@
|
||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: ddevault
|
|
||||||
patreon: sircmpwn
|
|
||||||
custom: https://drewdevault.com/donate
|
|
||||||
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -6,9 +6,10 @@ labels: 'bug'
|
||||||
---
|
---
|
||||||
|
|
||||||
### Please read the following before submitting:
|
### Please read the following before submitting:
|
||||||
- Please do NOT submit bug reports for questions. Ask questions on IRC at #sway on irc.freenode.net.
|
- Please do NOT submit bug reports for questions. Ask questions on IRC at #sway on Libera Chat.
|
||||||
- Proprietary graphics drivers, including nvidia, are not supported. Please use the open source equivalents, such as nouveau, if you would like to use Sway.
|
- Proprietary graphics drivers, including nvidia, are not supported. Please use the open source equivalents, such as nouveau, if you would like to use Sway.
|
||||||
- Problems with the Wayland version of Firefox are likely to be Firefox bugs. Start by submitting your issue to the Firefox Bugzilla and come back here only after they confirm otherwise.
|
- Please do NOT submit issues for information from the github wiki. The github wiki is community maintained and therefore may contain outdated information, scripts that don't work or obsolete workarounds.
|
||||||
|
If you fix a script or find outdated information, don't hesitate to adjust the wiki page.
|
||||||
|
|
||||||
### Please fill out the following:
|
### Please fill out the following:
|
||||||
- **Sway Version:**
|
- **Sway Version:**
|
||||||
|
|
@ -17,6 +18,7 @@ labels: 'bug'
|
||||||
- **Debug Log:**
|
- **Debug Log:**
|
||||||
- Run `sway -d 2> ~/sway.log` from a TTY and upload it to a pastebin, such as gist.github.com.
|
- Run `sway -d 2> ~/sway.log` from a TTY and upload it to a pastebin, such as gist.github.com.
|
||||||
- This will record information about sway's activity. Please try to keep the reproduction as brief as possible and exit sway.
|
- This will record information about sway's activity. Please try to keep the reproduction as brief as possible and exit sway.
|
||||||
|
- Attach the **full** file, do not truncate it.
|
||||||
|
|
||||||
- **Configuration File:**
|
- **Configuration File:**
|
||||||
- Please try to produce with the default configuration.
|
- Please try to produce with the default configuration.
|
||||||
|
|
|
||||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Questions
|
- name: Questions
|
||||||
url: "http://webchat.freenode.net/?channels=sway&uio=d4"
|
url: "https://libera.chat"
|
||||||
about: "Please ask questions on IRC in #sway on irc.freenode.net"
|
about: "Please ask questions on IRC in #sway on Libera Chat"
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE/enhancement.md
vendored
2
.github/ISSUE_TEMPLATE/enhancement.md
vendored
|
|
@ -6,7 +6,7 @@ labels: 'enhancement'
|
||||||
---
|
---
|
||||||
|
|
||||||
### Please read the following before submitting:
|
### Please read the following before submitting:
|
||||||
- We are not accepting any new window management features unless they get implemented by i3. Please consider searching for or opening an i3 feature request.
|
- We are not accepting any new window management features unless they get implemented by i3.
|
||||||
|
|
||||||
### Please fill out the following:
|
### Please fill out the following:
|
||||||
- **Description:**
|
- **Description:**
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,21 @@
|
||||||
# Contributing to sway
|
# Contributing to sway
|
||||||
|
|
||||||
Contributing just involves sending a pull request. You will probably be more
|
Contributing just involves sending a pull request. You will probably be more
|
||||||
successful with your contribution if you visit
|
successful with your contribution if you visit #sway-devel on Libera Chat
|
||||||
[#sway-devel](https://webchat.freenode.net/?channels=sway-devel) on
|
upfront and discuss your plans.
|
||||||
irc.freenode.net upfront and discuss your plans.
|
|
||||||
|
|
||||||
Note: rules are made to be broken. Adjust or ignore any/all of these as you see
|
Note: rules are made to be broken. Adjust or ignore any/all of these as you see
|
||||||
fit, but be prepared to justify it to your peers.
|
fit, but be prepared to justify it to your peers.
|
||||||
|
|
||||||
|
## Scope of future changes to sway
|
||||||
|
|
||||||
|
**Important**: Sway has completed its core value proposition: it is a fully
|
||||||
|
featured Wayland-compatible replacement for i3. It is not our intention to
|
||||||
|
expand on the scope of what i3 aims to accomplish. Our priorities now are
|
||||||
|
increasing the stability, reliability, and performance of sway within its
|
||||||
|
current scope. For this reason, most new window management feature requests are
|
||||||
|
not accepted, even if accompanied by a patch.
|
||||||
|
|
||||||
## Pull Requests
|
## Pull Requests
|
||||||
|
|
||||||
If you already have your own pull request habits, feel free to use them. If you
|
If you already have your own pull request habits, feel free to use them. If you
|
||||||
|
|
|
||||||
18
README.de.md
18
README.de.md
|
|
@ -1,14 +1,12 @@
|
||||||
# Sway
|
# Sway
|
||||||
Sway ist ein [i3](https://i3wm.org/)-kompatibler [Wayland](http://wayland.freedesktop.org/)-Compositor. Lies die [FAQ](https://github.com/swaywm/sway/wiki). Tritt dem [IRC Channel](http://webchat.freenode.net/?channels=sway&uio=d4) bei (#sway on irc.freenode.net; Englisch).
|
Sway ist ein [i3](https://i3wm.org/)-kompatibler [Wayland](http://wayland.freedesktop.org/)-Compositor. Lies die [FAQ](https://github.com/swaywm/sway/wiki). Tritt dem [IRC Channel](https://web.libera.chat/gamja/?channels=#sway) bei (#sway on irc.libera.chat; Englisch).
|
||||||
|
|
||||||
Falls du die Entwicklung von Sway unterstützen möchtest, kannst du das auf [SirCmpwn's Patreon Seite](https://patreon.com/sircmpwn) machen.
|
|
||||||
|
|
||||||
## Signaturen
|
## Signaturen
|
||||||
Jedes Release wird mit dem PGP-Schlüssel [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A) signiert und auf GitHub veröffentlicht.
|
Jedes Release wird mit dem PGP-Schlüssel [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48) signiert und auf GitHub veröffentlicht.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
### Mit der Paketverwaltung
|
### Mit der Paketverwaltung
|
||||||
Sway kann in vielen Distributionen direkt durch die Paketverwaltung installiert werden. Das Paket sollte "sway" heißen. Falls es kein solches Paket gibt, kannst du im [Wiki](https://github.com/swaywm/sway/wiki/Unsupported-packages) (Englisch) nach mehr Informationen bezüglich deiner Distribution suchen.
|
Sway kann in vielen Distributionen direkt durch die Paketverwaltung installiert werden. Das Paket sollte "sway" heißen. Falls es kein solches Paket gibt, kannst du im [Wiki](https://github.com/swaywm/sway/wiki/Unsupported-packages) (englisch) nach mehr Informationen bezüglich deiner Distribution suchen.
|
||||||
|
|
||||||
Falls du sway für deine eigene Distribution als Paket bereitstellen möchtest, solltest du die Entwickler per IRC oder E-Mail (sir@cmpwn.com) kontaktieren.
|
Falls du sway für deine eigene Distribution als Paket bereitstellen möchtest, solltest du die Entwickler per IRC oder E-Mail (sir@cmpwn.com) kontaktieren.
|
||||||
|
|
||||||
|
|
@ -17,7 +15,7 @@ Falls du sway für deine eigene Distribution als Paket bereitstellen möchtest,
|
||||||
sway benötigt die folgenden Pakete:
|
sway benötigt die folgenden Pakete:
|
||||||
|
|
||||||
* meson\*
|
* meson\*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols\*
|
* wayland-protocols\*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
@ -30,7 +28,7 @@ sway benötigt die folgenden Pakete:
|
||||||
|
|
||||||
_\*Werden nur während des Kompilierens benötigt_
|
_\*Werden nur während des Kompilierens benötigt_
|
||||||
|
|
||||||
Führe die folgenden Befehle aus
|
Führe die folgenden Befehle aus:
|
||||||
|
|
||||||
meson build
|
meson build
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
|
@ -44,8 +42,8 @@ Sway läuft nur in der Startphase mit Root-Rechten.
|
||||||
|
|
||||||
## Konfiguration
|
## Konfiguration
|
||||||
|
|
||||||
Falls du von i3 migrierst, kannst du deine Konfigurationsdatei nach `~/.config/sway/config` kopieren, und die Einstellungen sollten ohne Weiteres funktionieren. Ansonsten kannst du die Beispielkonfiguration, die normalerweise in `/etc/sway/config` liegt, nach `~/.config/sway/config` kopieren. Die Dokumentation zur Konfigurationsdatei findest du in `man 5 sway`.
|
Falls du von i3 migrierst, kannst du deine Konfigurationsdatei nach `~/.config/sway/config` kopieren und die Einstellungen sollten ohne Weiteres funktionieren. Ansonsten kannst du die Beispielkonfiguration, die normalerweise in `/etc/sway/config` liegt, nach `~/.config/sway/config` kopieren. Die Dokumentation zur Konfigurationsdatei findest du in `man 5 sway`.
|
||||||
|
|
||||||
## Sway Starten
|
## Sway starten
|
||||||
Sway kann einfach mit dem Befehl `sway` vom TTY gestartet werden.
|
Sway kann einfach mit dem Befehl `sway` vom TTY gestartet werden.
|
||||||
Display-Manager werden nicht offiziell unterstützt. Es gibt aber durchaus einige, die mit Sway funktionieren. (z.B. gdm)
|
Display-Manager werden nicht offiziell unterstützt. Es gibt aber durchaus einige, die mit Sway funktionieren (z.B. gdm).
|
||||||
|
|
|
||||||
61
README.dk.md
61
README.dk.md
|
|
@ -1,43 +1,43 @@
|
||||||
# Sway
|
# Sway
|
||||||
|
|
||||||
Sway er en [i3](https://i3wm.org/)-kompatibel [Wayland](http://wayland.freedesktop.org/) compositor.
|
Sway er en [i3]-kompatibel [Wayland] compositor. Læs [Ofte stillede spørgsmål].
|
||||||
Læs [Ofte stillede spørgsmål](https://github.com/swaywm/sway/wiki).
|
Deltag på [IRC kanalen][IRC kanal] \(#sway på irc.libera.chat).
|
||||||
Deltag på [IRC kanalen](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway på irc.freenode.net).
|
|
||||||
|
|
||||||
Hvis du har lyst til at støtte sway udviklingen, venligst send bidrag på [Sir Cmpwn's Patreon side](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Udgivelses Signaturer
|
## Udgivelses Signaturer
|
||||||
|
|
||||||
Udgivelser er signeret med [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Udgivelser er signeret med [E88F5E48] og publiceret [på GitHub][GitHub
|
||||||
og publiseret på [GitHub](https://github.com/swaywm/sway/releases).
|
releases].
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Fra Pakker
|
### Fra pakker
|
||||||
|
|
||||||
Sway er tilgængelig i mange distributioner. Prøv at installere pakken "svay". Hvis den ikke er tilgængelig, så tjek [denne wiki-side](https://github.com/swaywm/sway/wiki/Unsupported-packages)
|
Sway er tilgængelig i mange distributioner. Prøv at installere "sway" pakken
|
||||||
for information om installation til din(e) distribution(er).
|
fra din.
|
||||||
|
|
||||||
Hvis du er interesseret i at lave en Sway pakke til din distribution, burde du besøge IRC
|
Hvis du er interesseret i at pakke Sway til din distribution, kan du tage forbi
|
||||||
kanalen eller sende en e-mail til sir@cmpwn.com for rådgivning.
|
IRC kanalen eller sende en email til sir@cmpwn.com for rådgivning.
|
||||||
|
|
||||||
### Kompilering fra kildekode
|
### Kompilering fra kildekode
|
||||||
|
|
||||||
Installation afhænger af følgende programmer:
|
Se [denne wiki-side][Opsætning til udvikling] hvis du vil bygge HEAD af sway og
|
||||||
|
wlroots til test eller udvikling.
|
||||||
|
|
||||||
|
Installationsafhængigheder:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots]
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
* json-c
|
* json-c
|
||||||
* pango
|
* pango
|
||||||
* cairo
|
* cairo
|
||||||
* gdk-pixbuf2 (valgfrit tillæg: system tray)
|
* gdk-pixbuf2 (valgfrit: system tray)
|
||||||
* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (valgfrit tillæg: man pages) \*
|
* [scdoc] (valgfrit: man pages) \*
|
||||||
* git \*
|
* git \*
|
||||||
|
|
||||||
_\*Kompiler krav_
|
_\*Kompileringsafhængighed_
|
||||||
|
|
||||||
Kør følgende kommandoer:
|
Kør følgende kommandoer:
|
||||||
|
|
||||||
|
|
@ -45,21 +45,30 @@ Kør følgende kommandoer:
|
||||||
ninja -C build
|
ninja -C build
|
||||||
sudo ninja -C build install
|
sudo ninja -C build install
|
||||||
|
|
||||||
På systemer uden 'logind', behøver du at sætte ejerens bruger-id for Sways eksekverbare filer - såkaldt SUID (Set owner User ID):
|
På systemer uden logind eller seatd skal du sætte SUID bit på sway filen:
|
||||||
|
|
||||||
sudo chmod a+s /usr/local/bin/sway
|
sudo chmod a+s /usr/local/bin/sway
|
||||||
|
|
||||||
Sway vil frasige sig 'root' tilladelser kort efter opstart
|
Sway dropper 'root' tilladelser kort efter opstart.
|
||||||
|
|
||||||
## Konfiguration
|
## Konfiguration
|
||||||
|
|
||||||
Hvis du allerede bruger i3, bør du kopiere din i3-konfiguration til `~/.config/sway/config` og
|
Hvis du allerede bruger i3 kan du bare kopiere din i3 konfiguration til
|
||||||
det vil bare fungerer. Ellers skal du kopiere eksempel konfigurations filen til
|
`~/.config/sway/config`. Ellers skal du kopiere eksempelkonfigurationsfilen til
|
||||||
`~/.config/sway/config`. Den er normalt placeret i `/etc/sway/config`.
|
`~/.config/sway/config`. Den er normalt placeret i `/etc/sway/config`. Kør
|
||||||
Kør `man 5 sway` for at få oplysninger om konfigurationen.
|
`man 5 sway` for at få oplysninger om konfigurationen.
|
||||||
|
|
||||||
## Kører
|
## Eksekvering
|
||||||
|
|
||||||
Kør `sway` fra en TTY. Nogle display managers fungerer muligvis, men understøttes ikke af
|
Kør `sway` fra en TTY. Nogle display managers kan fungere, men Sway yder ikke
|
||||||
Sway (gdm er kendt for at fungere temmelig godt).
|
support til dem (gdm er kendt for at fungere temmelig godt).
|
||||||
|
|
||||||
|
[i3]: https://i3wm.org/
|
||||||
|
[Wayland]: http://wayland.freedesktop.org/
|
||||||
|
[Ofte stillede spørgsmål]: https://github.com/swaywm/sway/wiki
|
||||||
|
[IRC kanal]: https://web.libera.chat/gamja/?channels=#sway
|
||||||
|
[E88F5E48]: https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48
|
||||||
|
[GitHub releases]: https://github.com/swaywm/sway/releases
|
||||||
|
[Opsætning til udvikling]: https://github.com/swaywm/sway/wiki/Development-Setup
|
||||||
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots
|
||||||
|
[scdoc]: https://git.sr.ht/~sircmpwn/scdoc
|
||||||
|
|
|
||||||
10
README.es.md
10
README.es.md
|
|
@ -1,14 +1,12 @@
|
||||||
# sway
|
# sway
|
||||||
|
|
||||||
sway es un compositor de [Wayland](http://wayland.freedesktop.org/) compatible con [i3](https://i3wm.org/).
|
sway es un compositor de [Wayland](http://wayland.freedesktop.org/) compatible con [i3](https://i3wm.org/).
|
||||||
Lea el [FAQ](https://github.com/swaywm/sway/wiki). Únase al [canal de IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
|
Lea el [FAQ](https://github.com/swaywm/sway/wiki). Únase al [canal de IRC](https://web.libera.chat/gamja/?channels=#sway) (#sway on
|
||||||
irc.freenode.net).
|
irc.libera.chat).
|
||||||
|
|
||||||
Si quiere apoyar el desarrollo de sway, por favor, contribuya en [la página de Patreon de SirCmpwn](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Firmas de las versiones
|
## Firmas de las versiones
|
||||||
|
|
||||||
Las distintas versiones están firmadas con [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Las distintas versiones están firmadas con [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48)
|
||||||
y publicadas [en GitHub](https://github.com/swaywm/sway/releases).
|
y publicadas [en GitHub](https://github.com/swaywm/sway/releases).
|
||||||
|
|
||||||
## Instalación
|
## Instalación
|
||||||
|
|
@ -27,7 +25,7 @@ escriba un email a sir@cmpwn.com
|
||||||
Instale las dependencias:
|
Instale las dependencias:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
67
README.fr.md
67
README.fr.md
|
|
@ -1,51 +1,49 @@
|
||||||
# sway
|
# sway
|
||||||
|
|
||||||
Sway est un compositeur [Wayland](http://wayland.freedesktop.org/) compatible
|
Sway est un compositeur [Wayland] compatible avec [i3]. Lisez la
|
||||||
avec [i3](https://i3wm.org/), **en cours de développement**. Lisez la
|
[FAQ]. Rejoignez le [canal IRC] (#sway sur irc.libera.chat).
|
||||||
[FAQ](https://github.com/swaywm/sway/wiki). Rejoignez le [canal
|
|
||||||
IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway sur
|
|
||||||
irc.freenode.net).
|
|
||||||
|
|
||||||
Si vous souhaitez soutenir le développement de Sway, vous pouvez contribuer à [la page
|
|
||||||
Patreon de SirCmpwn](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Aide en français
|
## Aide en français
|
||||||
|
|
||||||
[abdelq](//github.com/abdelq) fournit du support en français sur IRC et Github, dans le fuseau horaire UTC-4 (EST).
|
[abdelq] fournit du support en français sur IRC et Github, dans le fuseau
|
||||||
|
horaire UTC-4 (EST).
|
||||||
|
|
||||||
## Signatures de nouvelles versions
|
## Signatures de nouvelles versions
|
||||||
|
|
||||||
Les nouvelles versions sont signées avec [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Les nouvelles versions sont signées avec [E88F5E48] et publiées
|
||||||
et publiées [sur GitHub](https://github.com/swaywm/sway/releases).
|
[sur GitHub][versions GitHub].
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### À partir de paquets
|
### À partir de paquets
|
||||||
|
|
||||||
Sway est disponible sur plusieurs distributions. Essayez d'installer le paquet "sway" pour
|
Sway est disponible sur beaucoup de distributions. Essayez d'installer le
|
||||||
la vôtre. Si ce n'est pas disponible, consultez [cette page wiki](https://github.com/swaywm/sway/wiki/Unsupported-packages)
|
paquet "sway" pour la vôtre.
|
||||||
pour de l'information sur l'installation pour vos distributions.
|
|
||||||
|
|
||||||
Si vous êtes intéressé à maintenir Sway pour votre distribution, passez par le canal
|
Si vous êtes intéressé à maintenir Sway pour votre distribution, passez sur le
|
||||||
IRC ou envoyez un e-mail à sir@cmpwn.com (en anglais seulement) pour des conseils.
|
canal IRC ou envoyez un e-mail à sir@cmpwn.com (en anglais seulement) pour des
|
||||||
|
conseils.
|
||||||
|
|
||||||
### Compilation depuis la source
|
### Compilation depuis les sources
|
||||||
|
|
||||||
|
Consultez [cette page wiki][Configuration de développement] si vous souhaitez
|
||||||
|
compiler la révision HEAD de sway et wlroots pour tester ou développer.
|
||||||
|
|
||||||
Installez les dépendances :
|
Installez les dépendances :
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots]
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
* json-c
|
* json-c
|
||||||
* pango
|
* pango
|
||||||
* cairo
|
* cairo
|
||||||
* gdk-pixbuf2 (optionnel: system tray)
|
* gdk-pixbuf2 (optionnel : system tray)
|
||||||
* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (optionnel: requis pour les pages man) \*
|
* [scdoc] (optionnel : requis pour les pages man) \*
|
||||||
* git \*
|
* git (optionnel : information de version) \*
|
||||||
|
|
||||||
_\*Requis uniquement pour la compilation_
|
_\* Requis uniquement pour la compilation_
|
||||||
|
|
||||||
Exécutez ces commandes :
|
Exécutez ces commandes :
|
||||||
|
|
||||||
|
|
@ -61,12 +59,25 @@ Sway se débarassera des permissions *root* peu de temps après le démarrage.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Si vous utilisez déjà i3, copiez votre configuration i3 à `~/.config/sway/config` et
|
Si vous utilisez déjà i3, copiez votre configuration i3 vers
|
||||||
cela va fonctionner. Sinon, copiez l'exemple de fichier de configuration à
|
`~/.config/sway/config` et sway fonctionnera directement. Sinon, copiez
|
||||||
`~/.config/sway/config`. Il se trouve généralement dans `/etc/sway/config`.
|
l'exemple de fichier de configuration vers `~/.config/sway/config`. Il se
|
||||||
Exécutez `man 5 sway` pour l'information sur la configuration.
|
trouve généralement dans `/etc/sway/config`. Exécutez `man 5 sway` pour lire la
|
||||||
|
documentation pour la configuration de sway.
|
||||||
|
|
||||||
## Exécution
|
## Exécution
|
||||||
|
|
||||||
Exécutez `sway` à partir d'un TTY. Certains gestionnaires d'affichage peuvent fonctionner,
|
Exécutez `sway` à partir d'un TTY. Certains gestionnaires d'affichage peuvent
|
||||||
mais ne sont pas supportés par Sway (gdm est réputé pour assez bien fonctionner).
|
fonctionner, mais ne sont pas supportés par Sway (gdm est réputé pour assez
|
||||||
|
bien fonctionner).
|
||||||
|
|
||||||
|
[Wayland]: http://wayland.freedesktop.org/
|
||||||
|
[i3]: https://i3wm.org/
|
||||||
|
[FAQ]: https://github.com/swaywm/sway/wiki
|
||||||
|
[canal IRC]: https://web.libera.chat/gamja/?channels=#sway
|
||||||
|
[abdelq]: https://github.com/abdelq
|
||||||
|
[E88F5E48]: https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48
|
||||||
|
[versions GitHub]: https://github.com/swaywm/sway/releases
|
||||||
|
[Configuration de développement]: https://github.com/swaywm/sway/wiki/Development-Setup
|
||||||
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots
|
||||||
|
[scdoc]: https://git.sr.ht/~sircmpwn/scdoc
|
||||||
|
|
|
||||||
73
README.gr.md
Normal file
73
README.gr.md
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
# Sway
|
||||||
|
|
||||||
|
Το sway ένα [i3]-συμβατό [Wayland] compositor. Διαβάστε το [FAQ]. Μπείτε στο
|
||||||
|
[IRC channel] \(#sway on irc.libera.chat).
|
||||||
|
|
||||||
|
## Υπογραφές δημοσιεύσεων
|
||||||
|
|
||||||
|
Οι εκδόσεις είναι υπογεραμμένες με [E88F5E48] και δημοσιευμένες [στο GitHub][GitHub releases].
|
||||||
|
|
||||||
|
## Εγκατάσταση
|
||||||
|
|
||||||
|
### Από πακέτα
|
||||||
|
|
||||||
|
Το Sway είναι διαθέσιμο σε πολλά distributions. Δοκιμάστε εγκαταστώντας το "sway" package για
|
||||||
|
το δικό σας.
|
||||||
|
|
||||||
|
Εάν ενδιαφέρεστε για packaging του sway για το distribution σας, να πάτε στο IRC
|
||||||
|
channel ή στείλτε ένα email στο sir@cmpwn.com για συμβουλές.
|
||||||
|
|
||||||
|
### Compiling από πηγή
|
||||||
|
|
||||||
|
Τσεκάρετε [αυτό το wiki page][Development setup] εάμα θέλετε να κάνετε build το HEAD του
|
||||||
|
sway και wlroots γιά τεστάρισμα ή development.
|
||||||
|
|
||||||
|
Εγκατάσταση των dependencies:
|
||||||
|
|
||||||
|
* meson \*
|
||||||
|
* [wlroots]
|
||||||
|
* wayland
|
||||||
|
* wayland-protocols \*
|
||||||
|
* pcre
|
||||||
|
* json-c
|
||||||
|
* pango
|
||||||
|
* cairo
|
||||||
|
* gdk-pixbuf2 (προαιρετικό: system tray)
|
||||||
|
* [scdoc] (προαιρετικό: man pages) \*
|
||||||
|
* git (προαιρετικό: πληροφορίες εκδώσεων) \*
|
||||||
|
|
||||||
|
_\*Compile-time dep_
|
||||||
|
|
||||||
|
Τρέξτε αυτά τα commands:
|
||||||
|
|
||||||
|
meson build/
|
||||||
|
ninja -C build/
|
||||||
|
sudo ninja -C build/ install
|
||||||
|
|
||||||
|
Σε συστήματα χωρίς logind ή seatd, πρέπει να κάνετε suid το sway binary:
|
||||||
|
|
||||||
|
sudo chmod a+s /usr/local/bin/sway
|
||||||
|
|
||||||
|
Το Sway θα κάνει drop root δικαιώματα λίγο μετά την εκκίνηση.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Εάν ήδη χρησιμοποιήτε το i3, αντιγράψτε το i3 config σας στο `~/.config/sway/config` και
|
||||||
|
θα δουλέψει out of the box. Αλλιώς, αντιγράψτε το sample configuration αρχείο στο
|
||||||
|
`~/.config/sway/config`. Το οποίο συνήθως βρίσκεται στο `/etc/sway/config`.
|
||||||
|
Κάντε run `man 5 sway` για πληροφορίες τού configuration.
|
||||||
|
|
||||||
|
## Τρέχοντας
|
||||||
|
|
||||||
|
Τρέξτε `sway` από ένα TTY. Μερίκα display managers μπορεί να δουλέψουν αλλά δέν είναι συμβατά με
|
||||||
|
το sway (το gdm γνωρίζεται να δουλέβει σχετικά καλά).
|
||||||
|
|
||||||
|
[i3]: https://i3wm.org/
|
||||||
|
[Wayland]: http://wayland.freedesktop.org/
|
||||||
|
[FAQ]: https://github.com/swaywm/sway/wiki
|
||||||
|
[IRC channel]: https://web.libera.chat/gamja/?channels=#sway
|
||||||
|
[E88F5E48]: https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48
|
||||||
|
[GitHub releases]: https://github.com/swaywm/sway/releases
|
||||||
|
[Development setup]: https://github.com/swaywm/sway/wiki/Development-Setup
|
||||||
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots
|
||||||
|
[scdoc]: https://git.sr.ht/~sircmpwn/scdoc
|
||||||
77
README.hu.md
Normal file
77
README.hu.md
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
# sway
|
||||||
|
|
||||||
|
A Sway egy [i3]-kompatibilis [Wayland] kompozitor. Olvasd el a [Gyarkan Ismételt Kérdéseket][FAQ]. Csatlakozz az [IRC csatornához][IRC channel] \(`#sway` az `irc.libera.chat`-en).
|
||||||
|
|
||||||
|
## Csomag aláírások
|
||||||
|
|
||||||
|
A kiadott csomagok az [E88F5E48] kulccsal vannak aláírva és [GitHub-on][GitHub releases] publikálva.
|
||||||
|
|
||||||
|
## Telepítés
|
||||||
|
|
||||||
|
### Csomagból
|
||||||
|
|
||||||
|
A Sway sok disztribúció csomagkezelőjéből elérhető, próbáld meg a "sway"
|
||||||
|
csomagot telepíteni az általad használt eszközzel.
|
||||||
|
|
||||||
|
Ha szeretnél csomagot készíteni a saját disztribúciódhoz, ugorj be az IRC
|
||||||
|
csatornára, vagy küldj levelet a sir@cmpwn.com címre tanácsokért.
|
||||||
|
|
||||||
|
### Fordítás forráskódból
|
||||||
|
|
||||||
|
Olvasd el [ezt a wiki oldalt][Development setup], ha szeretnéd tesztelési vagy
|
||||||
|
fejlesztési célokból lefordítani az aktuális (HEAD) állapotát a `sway`-nek és a
|
||||||
|
`wlroots`-nak.
|
||||||
|
|
||||||
|
Telepítsd a függőségeket:
|
||||||
|
|
||||||
|
* meson \*
|
||||||
|
* [wlroots]
|
||||||
|
* wayland
|
||||||
|
* wayland-protocols \*
|
||||||
|
* pcre
|
||||||
|
* json-c
|
||||||
|
* pango
|
||||||
|
* cairo
|
||||||
|
* gdk-pixbuf2 (opcionális: system tray)
|
||||||
|
* [scdoc] (opcionális: man pages) \*
|
||||||
|
* git (opcionális: version info) \*
|
||||||
|
|
||||||
|
_\*Fordításidejű függőség_
|
||||||
|
|
||||||
|
Futtasd ezeket a parancsokat:
|
||||||
|
|
||||||
|
meson build
|
||||||
|
ninja -C build
|
||||||
|
sudo ninja -C build install
|
||||||
|
|
||||||
|
Ha `logind` nélküli rendszert használsz, akkor be kell állítanod a `suid` bitet
|
||||||
|
a futtaható állományon:
|
||||||
|
|
||||||
|
sudo chmod a+s /usr/local/bin/sway
|
||||||
|
|
||||||
|
A Sway indulás után nem sokkal el fogja engedni a root jogosultságait.
|
||||||
|
|
||||||
|
## Konfiguráció
|
||||||
|
|
||||||
|
Ha előzőleg i3-mat használtál, akkor átmásolhatod az i3 beállításaidat a
|
||||||
|
`~/.config/sway/config` file-ba és ugyanúgy működni fognak. Egyéb esetben másold
|
||||||
|
le kiindulási alapnak a mintát, ami általában az `etc/sway/config` elérési
|
||||||
|
útvonalon található.
|
||||||
|
Futtasd a `man 5 sway` parancsot további információért a konfigurációval
|
||||||
|
kapcsolatban.
|
||||||
|
|
||||||
|
## Futtatás
|
||||||
|
|
||||||
|
Futtasd a `sway` parancsot egy TTY felületről. Néhány bejelentkezéskezelő
|
||||||
|
(display manager) működhet, de alapvetően nem támogatottak a sway által. (A
|
||||||
|
gdm-ről ismeretes, hogy egész jól működik.)
|
||||||
|
|
||||||
|
[i3]: https://i3wm.org/
|
||||||
|
[Wayland]: http://wayland.freedesktop.org/
|
||||||
|
[FAQ]: https://github.com/swaywm/sway/wiki
|
||||||
|
[IRC channel]: https://web.libera.chat/gamja/?channels=#sway
|
||||||
|
[E88F5E48]: https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48
|
||||||
|
[GitHub releases]: https://github.com/swaywm/sway/releases
|
||||||
|
[Development setup]: https://github.com/swaywm/sway/wiki/Development-Setup
|
||||||
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots
|
||||||
|
[scdoc]: https://git.sr.ht/~sircmpwn/scdoc
|
||||||
70
README.ir.md
Normal file
70
README.ir.md
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
<div dir="rtl">
|
||||||
|
|
||||||
|
# sway
|
||||||
|
|
||||||
|
sway یک کامپوزیتور الهام گرفته از [i3](https://i3wm.org/) بر روی [Wayland](http://wayland.freedesktop.org/) است. [سوالهای متداول](https://github.com/swaywm/sway/wiki) را بخوانید. در [کانال
|
||||||
|
IRC](http://web.libera.chat/gamja/?channels=sway&uio=d4) عضو شوید (#sway sur
|
||||||
|
irc.libera.chat).
|
||||||
|
|
||||||
|
برای حمایت از تیم توسعه sway به [صفحه
|
||||||
|
Patreon با نام کاربری SirCmpwn](https://patreon.com/sircmpwn) مراجعه کنید.
|
||||||
|
|
||||||
|
## امضای نسخهها
|
||||||
|
|
||||||
|
امضای نسخهها با [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A) در [GitHub](https://github.com/swaywm/sway/releases) منتشر میشود.
|
||||||
|
|
||||||
|
## شیوه نصب
|
||||||
|
|
||||||
|
### از بستههای رسمی
|
||||||
|
|
||||||
|
sway در بستههای رسمی توزیعهای مختلف وجود دارد. بسته «sway» را نصب کنید. در صورتی که بسته رسمی وجود نداشت، برای آگاهی بیشتر درباره نصب روی توزیعتان به این [صفحه راهنما](https://github.com/swaywm/sway/wiki/Unsupported-packages) مراجعه کنید.
|
||||||
|
|
||||||
|
اگر به ایجاد بسته sway برای توزیعتان علاقهمند هستید، از کانال IRC استفاده کنید یا به sir@cmpwn.com ایمیل بزنید.
|
||||||
|
|
||||||
|
### کامپایل کردن کد
|
||||||
|
|
||||||
|
چنانچه میخواهید آخرین نسخه کد sway و wlroots را برای آزمایش یا توسعه بسازید به این [صفحه راهنما](https://github.com/swaywm/sway/wiki/Development-Setup) مراجعه کنید.
|
||||||
|
|
||||||
|
بستههای مورد نیاز:
|
||||||
|
|
||||||
|
* meson \*
|
||||||
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
|
* wayland
|
||||||
|
* wayland-protocols \*
|
||||||
|
* pcre
|
||||||
|
* json-c
|
||||||
|
* pango
|
||||||
|
* cairo
|
||||||
|
* gdk-pixbuf2 (انتخابی: برای system tray)
|
||||||
|
* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (انتخابی: برای صفحههای راهنما) \*
|
||||||
|
* git (انتخابی: برای اطلاع در خصوص نسخهها) \*
|
||||||
|
|
||||||
|
_\*نیازمندیهای زمان کامپایل برنامه_
|
||||||
|
|
||||||
|
این فرمانها را اجرا کنید:
|
||||||
|
</div>
|
||||||
|
|
||||||
|
meson build
|
||||||
|
ninja -C build
|
||||||
|
sudo ninja -C build install
|
||||||
|
|
||||||
|
<div dir="rtl">
|
||||||
|
|
||||||
|
روی سیستمهای بدون logind، باید فرمان زیر را برای suid کردن باینری sway اجرا کنید:
|
||||||
|
</div>
|
||||||
|
|
||||||
|
sudo chmod a+s /usr/local/bin/sway
|
||||||
|
|
||||||
|
<div dir="rtl">
|
||||||
|
sway پس از startup مجوزهای دسترسی root را رها میکند.
|
||||||
|
|
||||||
|
### شخصی سازی و تنظیمات
|
||||||
|
|
||||||
|
اگر در حال حاضر از i3 استفاده میکنید، تنظیمات i3 خودتان را در فایل `~/.config/sway/config` کپی کنید و بدون نیاز به تغییر کار خواهد کرد. در غیر اینصورت، فایل نمونه تنظیمات را استفاده کنید. این فایل عموما در `/etc/sway/config` قرار دارد. برای آگاهی بیشتر `man 5 sway` را اجرا کنید.
|
||||||
|
|
||||||
|
## اجرا
|
||||||
|
|
||||||
|
در محیط TTY کافیست `sway` را اجرا کنید. ممکن است ابزارهای مدیریت نمایشگری نیز برای این کار وجود داشته باشند اما از طرف sway پشتیبانی نمیشوند (gdm عملکرد خوبی در این زمینه دارد).
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
@ -2,19 +2,17 @@
|
||||||
|
|
||||||
Swayは[i3](https://i3wm.org/)互換な[Wayland](http://wayland.freedesktop.org/)コンポジタです。
|
Swayは[i3](https://i3wm.org/)互換な[Wayland](http://wayland.freedesktop.org/)コンポジタです。
|
||||||
[FAQ](https://github.com/swaywm/sway/wiki)も合わせてご覧ください。
|
[FAQ](https://github.com/swaywm/sway/wiki)も合わせてご覧ください。
|
||||||
[IRC チャンネル](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on irc.freenode.net)もあります。
|
[IRC チャンネル](https://web.libera.chat/gamja/?channels=#sway) (irc.libera.chatの#sway)もあります。
|
||||||
|
|
||||||
[](https://sr.ht/ICd5.png)
|
[](https://sr.ht/ICd5.png)
|
||||||
|
|
||||||
Swayの開発を支援したい場合は、[SirCmpwnのPatreon](https://patreon.com/sircmpwn)や、特定の機能に対する[報奨金のページ](https://github.com/swaywm/sway/issues/986)から寄付ができます。誰でも報奨金を請求できますし、自分の欲しい機能に報奨金を懸ける事も出来ます。またSwayのメンテナンスを支援するには、Patreonがより有用です。
|
|
||||||
|
|
||||||
## 日本語サポート
|
## 日本語サポート
|
||||||
|
|
||||||
SirCmpwnは、日本語でのサポートをIRCとGitHubで行います。タイムゾーンはUTC-4です。
|
SirCmpwnは、日本語でのサポートをIRCとGitHubで行います。タイムゾーンはUTC-4です。
|
||||||
|
|
||||||
## リリースの署名
|
## リリースの署名
|
||||||
|
|
||||||
Swayのリリースは[B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)で署名され、[GitHub](https://github.com/swaywm/sway/releases)で公開されています。
|
Swayのリリースは[E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48)で署名され、[GitHub](https://github.com/swaywm/sway/releases)で公開されています。
|
||||||
|
|
||||||
## インストール
|
## インストール
|
||||||
|
|
||||||
|
|
@ -29,7 +27,7 @@ Swayは沢山のディストリビューションで提供されています。"
|
||||||
次の依存パッケージをインストールしてください:
|
次の依存パッケージをインストールしてください:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
# sway
|
# sway
|
||||||
|
|
||||||
sway는 [i3](https://i3wm.org/)-호환 [Wayland](http://wayland.freedesktop.org/) 컴포지터입니다.
|
sway는 [i3](https://i3wm.org/)-호환 [Wayland](http://wayland.freedesktop.org/) 컴포지터입니다.
|
||||||
[FAQ](https://github.com/swaywm/sway/wiki)를 읽어보세요. [IRC 채널](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on irc.freenode.net)도 있습니다.
|
[FAQ](https://github.com/swaywm/sway/wiki)를 읽어보세요. [IRC 채널](https://web.libera.chat/gamja/?channels=#sway) (#sway on irc.libera.chat)도 있습니다.
|
||||||
|
|
||||||
sway 개발을 도우고 싶으시다면, [SirCmpwn의 Patreon 페이지](https://patreon.com/sircmpwn)에 기여해 주세요.
|
|
||||||
|
|
||||||
## 릴리즈 서명
|
## 릴리즈 서명
|
||||||
|
|
||||||
릴리즈는 [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)에서 서명되고,
|
릴리즈는 [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48)에서 서명되고,
|
||||||
[GitHub에서](https://github.com/swaywm/sway/releases) 공개되고 있습니다.
|
[GitHub에서](https://github.com/swaywm/sway/releases) 공개되고 있습니다.
|
||||||
|
|
||||||
## 설치
|
## 설치
|
||||||
|
|
@ -26,7 +24,7 @@ IRC 채널을 방문하거나 sir@cmpwn.com으로 이메일을 보내 상담 받
|
||||||
다음 의존 패키지들을 설치해 주세요:
|
다음 의존 패키지들을 설치해 주세요:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
66
README.md
66
README.md
|
|
@ -1,39 +1,30 @@
|
||||||
# sway
|
# sway
|
||||||
|
|
||||||
[**English**](https://github.com/swaywm/sway/blob/master/README.md#sway--) - [日本語](https://github.com/swaywm/sway/blob/master/README.ja.md#sway--) - [Français](https://github.com/swaywm/sway/blob/master/README.fr.md#sway--) - [Українська](https://github.com/swaywm/sway/blob/master/README.uk.md#sway--) - [Español](https://github.com/swaywm/sway/blob/master/README.es.md#sway--) - [Polski](https://github.com/swaywm/sway/blob/master/README.pl.md#sway--) - [中文-简体](https://github.com/swaywm/sway/blob/master/README.zh-CN.md#sway--) - [Deutsch](https://github.com/swaywm/sway/blob/master/README.de.md#sway--) - [Nederlands](https://github.com/swaywm/sway/blob/master/README.nl.md#sway--) - [Русский](https://github.com/swaywm/sway/blob/master/README.ru.md#sway--)- [中文-繁體](https://github.com/swaywm/sway/blob/master/README.zh-TW.md#sway--) - [Português](https://github.com/swaywm/sway/blob/master/README.pt.md#sway--) - [Danish](https://github.com/swaywm/sway/blob/master/README.dk.md#sway--) - [한국어](https://github.com/swaywm/sway/blob/master/README.ko.md#sway--) - [Română](https://github.com/swaywm/sway/blob/master/README.ro.md#sway--)
|
**[English][en]** - [日本語][ja] - [Français][fr] - [Українська][uk] - [Español][es] - [Polski][pl] - [中文-简体][zh-CN] - [Deutsch][de] - [Nederlands][nl] - [Русский][ru] - [中文-繁體][zh-TW] - [Português][pt] - [Dansk][dk] - [한국어][ko] - [Română][ro] - [Magyar][hu] - [Türkçe][tr] - [فارسی][ir] - [Ελληνικά][gr]
|
||||||
|
|
||||||
sway is an [i3](https://i3wm.org/)-compatible [Wayland](http://wayland.freedesktop.org/) compositor.
|
sway is an [i3]-compatible [Wayland] compositor. Read the [FAQ]. Join the
|
||||||
Read the [FAQ](https://github.com/swaywm/sway/wiki). Join the [IRC
|
[IRC channel] \(#sway on irc.libera.chat).
|
||||||
channel](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
|
|
||||||
irc.freenode.net).
|
|
||||||
|
|
||||||
If you'd like to support sway development, please contribute to [SirCmpwn's
|
|
||||||
Patreon page](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Release Signatures
|
## Release Signatures
|
||||||
|
|
||||||
Releases are signed with [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Releases are signed with [E88F5E48] and published [on GitHub][GitHub releases].
|
||||||
and published [on GitHub](https://github.com/swaywm/sway/releases).
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### From Packages
|
### From Packages
|
||||||
|
|
||||||
Sway is available in many distributions. Try installing the "sway" package for
|
Sway is available in many distributions. Try installing the "sway" package for
|
||||||
yours. If it's not available, check out [this wiki page](https://github.com/swaywm/sway/wiki/Unsupported-packages)
|
yours.
|
||||||
for information on installation for your distributions.
|
|
||||||
|
|
||||||
If you're interested in packaging sway for your distribution, stop by the IRC
|
|
||||||
channel or shoot an email to sir@cmpwn.com for advice.
|
|
||||||
|
|
||||||
### Compiling from Source
|
### Compiling from Source
|
||||||
|
|
||||||
Check out [this wiki page](https://github.com/swaywm/sway/wiki/Development-Setup) if you want to build the HEAD of sway and wlroots for testing or development.
|
Check out [this wiki page][Development setup] if you want to build the HEAD of
|
||||||
|
sway and wlroots for testing or development.
|
||||||
|
|
||||||
Install dependencies:
|
Install dependencies:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots]
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
@ -41,18 +32,18 @@ Install dependencies:
|
||||||
* pango
|
* pango
|
||||||
* cairo
|
* cairo
|
||||||
* gdk-pixbuf2 (optional: system tray)
|
* gdk-pixbuf2 (optional: system tray)
|
||||||
* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (optional: man pages) \*
|
* [scdoc] (optional: man pages) \*
|
||||||
* git (optional: version info) \*
|
* git (optional: version info) \*
|
||||||
|
|
||||||
_\*Compile-time dep_
|
_\* Compile-time dep_
|
||||||
|
|
||||||
Run these commands:
|
Run these commands:
|
||||||
|
|
||||||
meson build
|
meson build/
|
||||||
ninja -C build
|
ninja -C build/
|
||||||
sudo ninja -C build install
|
sudo ninja -C build/ install
|
||||||
|
|
||||||
On systems without logind, you need to suid the sway binary:
|
On systems without logind nor seatd, you need to suid the sway binary:
|
||||||
|
|
||||||
sudo chmod a+s /usr/local/bin/sway
|
sudo chmod a+s /usr/local/bin/sway
|
||||||
|
|
||||||
|
|
@ -69,3 +60,32 @@ Run `man 5 sway` for information on the configuration.
|
||||||
|
|
||||||
Run `sway` from a TTY. Some display managers may work but are not supported by
|
Run `sway` from a TTY. Some display managers may work but are not supported by
|
||||||
sway (gdm is known to work fairly well).
|
sway (gdm is known to work fairly well).
|
||||||
|
|
||||||
|
[en]: https://github.com/swaywm/sway#readme
|
||||||
|
[ja]: https://github.com/swaywm/sway/blob/master/README.ja.md
|
||||||
|
[fr]: https://github.com/swaywm/sway/blob/master/README.fr.md
|
||||||
|
[uk]: https://github.com/swaywm/sway/blob/master/README.uk.md
|
||||||
|
[es]: https://github.com/swaywm/sway/blob/master/README.es.md
|
||||||
|
[pl]: https://github.com/swaywm/sway/blob/master/README.pl.md
|
||||||
|
[zh-CN]: https://github.com/swaywm/sway/blob/master/README.zh-CN.md
|
||||||
|
[de]: https://github.com/swaywm/sway/blob/master/README.de.md
|
||||||
|
[nl]: https://github.com/swaywm/sway/blob/master/README.nl.md
|
||||||
|
[ru]: https://github.com/swaywm/sway/blob/master/README.ru.md
|
||||||
|
[zh-TW]: https://github.com/swaywm/sway/blob/master/README.zh-TW.md
|
||||||
|
[pt]: https://github.com/swaywm/sway/blob/master/README.pt.md
|
||||||
|
[dk]: https://github.com/swaywm/sway/blob/master/README.dk.md
|
||||||
|
[ko]: https://github.com/swaywm/sway/blob/master/README.ko.md
|
||||||
|
[ro]: https://github.com/swaywm/sway/blob/master/README.ro.md
|
||||||
|
[hu]: https://github.com/swaywm/sway/blob/master/README.hu.md
|
||||||
|
[tr]: https://github.com/swaywm/sway/blob/master/README.tr.md
|
||||||
|
[ir]: https://github.com/swaywm/sway/blob/master/README.ir.md
|
||||||
|
[gr]: https://github.com/swaywm/sway/blob/master/README.gr.md
|
||||||
|
[i3]: https://i3wm.org/
|
||||||
|
[Wayland]: http://wayland.freedesktop.org/
|
||||||
|
[FAQ]: https://github.com/swaywm/sway/wiki
|
||||||
|
[IRC channel]: https://web.libera.chat/gamja/?channels=#sway
|
||||||
|
[E88F5E48]: https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48
|
||||||
|
[GitHub releases]: https://github.com/swaywm/sway/releases
|
||||||
|
[Development setup]: https://github.com/swaywm/sway/wiki/Development-Setup
|
||||||
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots
|
||||||
|
[scdoc]: https://git.sr.ht/~sircmpwn/scdoc
|
||||||
|
|
|
||||||
11
README.nl.md
11
README.nl.md
|
|
@ -2,15 +2,12 @@
|
||||||
|
|
||||||
Sway is een [i3](https://i3wm.org/)-compatibele [Wayland](http://wayland.freedesktop.org/) compositor.
|
Sway is een [i3](https://i3wm.org/)-compatibele [Wayland](http://wayland.freedesktop.org/) compositor.
|
||||||
Lees de [FAQ](https://github.com/swaywm/sway/wiki). Word lid van het [IRC
|
Lees de [FAQ](https://github.com/swaywm/sway/wiki). Word lid van het [IRC
|
||||||
kanaal](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway op
|
kanaal](https://web.libera.chat/gamja/?channels=#sway) (#sway op
|
||||||
irc.freenode.net).
|
irc.libera.chat).
|
||||||
|
|
||||||
Als je de ontwikkeling van sway wilt ondersteunen, draag dan bij aan [SirCmpwn's
|
|
||||||
Patreon-pagina](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Releasehandtekeningen
|
## Releasehandtekeningen
|
||||||
|
|
||||||
Releases worden ondertekend met [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Releases worden ondertekend met [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48)
|
||||||
en gepubliceerd [op GitHub](https://github.com/swaywm/sway/releases).
|
en gepubliceerd [op GitHub](https://github.com/swaywm/sway/releases).
|
||||||
|
|
||||||
## Installatie
|
## Installatie
|
||||||
|
|
@ -28,7 +25,7 @@ kanaal of stuur een e-mail naar sir@cmpwn.com voor advies.
|
||||||
Afhankelijkheden installeren:
|
Afhankelijkheden installeren:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
10
README.pl.md
10
README.pl.md
|
|
@ -1,14 +1,12 @@
|
||||||
# sway
|
# sway
|
||||||
|
|
||||||
sway jest kompozytorem [Wayland](http://wayland.freedesktop.org/) kompatybilnym z [i3](https://i3wm.org/).
|
sway jest kompozytorem [Wayland](http://wayland.freedesktop.org/) kompatybilnym z [i3](https://i3wm.org/).
|
||||||
Przeczytaj [FAQ](https://github.com/swaywm/sway/wiki). Dołącz do [kanału IRC](http://webchat.freenode.net/?channels=sway&uio=d4)
|
Przeczytaj [FAQ](https://github.com/swaywm/sway/wiki). Dołącz do [kanału IRC](https://web.libera.chat/gamja/?channels=#sway)
|
||||||
(#sway na irc.freenode.net).
|
(#sway na irc.libera.chat).
|
||||||
|
|
||||||
Jeśli chcesz wesprzeć rozwój sway, rozważ wsparcie SirCmpwn na jego [stronie Patreon](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Podpisy cyfrowe wydań
|
## Podpisy cyfrowe wydań
|
||||||
|
|
||||||
Wydania są podpisywane przy pomocy klucza [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Wydania są podpisywane przy pomocy klucza [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48)
|
||||||
i publikowane [na GitHubie](https://github.com/swaywm/sway/releases).
|
i publikowane [na GitHubie](https://github.com/swaywm/sway/releases).
|
||||||
|
|
||||||
## Instalacja
|
## Instalacja
|
||||||
|
|
@ -27,7 +25,7 @@ adres sir@cmpwn.com w celu uzyskania wskazówek.
|
||||||
Zainstaluj zależności:
|
Zainstaluj zależności:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
21
README.pt.md
21
README.pt.md
|
|
@ -2,15 +2,12 @@
|
||||||
|
|
||||||
O sway é um compositor do [Wayland](http://wayland.freedesktop.org/) compatível com o [i3](https://i3wm.org/).
|
O sway é um compositor do [Wayland](http://wayland.freedesktop.org/) compatível com o [i3](https://i3wm.org/).
|
||||||
Leia o [FAQ](https://github.com/swaywm/sway/wiki). Junte-se ao [canal do
|
Leia o [FAQ](https://github.com/swaywm/sway/wiki). Junte-se ao [canal do
|
||||||
IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway em
|
IRC](https://web.libera.chat/gamja/?channels=#sway) (#sway em
|
||||||
irc.freenode.net).
|
irc.libera.chat).
|
||||||
|
|
||||||
Se você gostaria de apoiar o desenvolvimento do sway, por favor, contribua na [página do patreon de
|
|
||||||
SirCmpwn](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Assinatura das versões
|
## Assinatura das versões
|
||||||
|
|
||||||
As versões são assinadas com [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
As versões são assinadas com [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48)
|
||||||
e publicadas [no GitHub](https://github.com/swaywm/sway/releases).
|
e publicadas [no GitHub](https://github.com/swaywm/sway/releases).
|
||||||
|
|
||||||
## Instalação
|
## Instalação
|
||||||
|
|
@ -25,19 +22,21 @@ ou mande um email para sir@cmpwn.com para obter informações.
|
||||||
|
|
||||||
### Compilando a partir do código-fonte
|
### Compilando a partir do código-fonte
|
||||||
|
|
||||||
|
Verifique [essa página da wiki](https://github.com/swaywm/sway/wiki/Development-Setup) se você quer compilar o HEAD do sway e o wlroots para testes ou desenvolvimento.
|
||||||
|
|
||||||
Instale as dependências:
|
Instale as dependências:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
* json-c
|
* json-c
|
||||||
* pango
|
* pango
|
||||||
* cairo
|
* cairo
|
||||||
* gdk-pixbuf2 (optional: system tray)
|
* gdk-pixbuf2 (opcional: system tray)
|
||||||
* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (Opcional: man pages) \*
|
* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (opcional: man pages) \*
|
||||||
* git \*
|
* git (opcional: informações de versão) \*
|
||||||
|
|
||||||
_\*Dependência de tempo de compilação_
|
_\*Dependência de tempo de compilação_
|
||||||
|
|
||||||
|
|
@ -62,5 +61,5 @@ Execute `man 5 sway` para se informar sobre a configuração.
|
||||||
|
|
||||||
## Execução
|
## Execução
|
||||||
|
|
||||||
Execute o comando `sway` de um TTY. Alguns gerenciadores de display (ou gerenciadores de login) podem funcionar mas alguns não são suportaods
|
Execute o comando `sway` de um TTY. Alguns gerenciadores de display (ou gerenciadores de login) podem funcionar mas alguns não são suportados
|
||||||
pelo sway (o gdm é conhecido por funcionar bem).
|
pelo sway (o gdm é conhecido por funcionar bem).
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
# sway
|
# sway
|
||||||
|
|
||||||
sway este un compositor pentru [Wayland](http://wayland.freedesktop.org/) compatibil cu [i3](https://i3wm.org/).
|
sway este un compositor pentru [Wayland](http://wayland.freedesktop.org/) compatibil cu [i3](https://i3wm.org/).
|
||||||
Citiți [FAQ](https://github.com/swaywm/sway/wiki)-ul. Connectați-vă la canalul nostru [IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway pe irc.freenode.net).
|
Citiți [FAQ](https://github.com/swaywm/sway/wiki)-ul. Connectați-vă la canalul nostru [IRC](https://web.libera.chat/gamja/?channels=#sway) (#sway pe irc.libera.chat).
|
||||||
|
|
||||||
Dacă doriți să contribuiți la dezvoltarea sway, vă rugăm contribuiți în [pagina de Patreon lui SirCmpwn](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Semnarea digitală
|
## Semnarea digitală
|
||||||
|
|
||||||
Noile versiuni sunt semnate cu [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Noile versiuni sunt semnate cu [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48)
|
||||||
și postate [pe GitHub](https://github.com/swaywm/sway/releases).
|
și postate [pe GitHub](https://github.com/swaywm/sway/releases).
|
||||||
|
|
||||||
## Instalare
|
## Instalare
|
||||||
|
|
@ -24,7 +22,7 @@ Dacă sunteți interesați in a crea pachete pentru distribuția voastră, infor
|
||||||
Dependențe pentru instalare:
|
Dependențe pentru instalare:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
44
README.ru.md
44
README.ru.md
|
|
@ -1,45 +1,41 @@
|
||||||
# sway
|
# sway
|
||||||
|
|
||||||
sway - это [i3](https://i3wm.org/)-совместимый композитор [Wayland](http://wayland.freedesktop.org/).
|
sway - это [i3]-совместимый композитор [Wayland].
|
||||||
Больше информации в [FAQ](https://github.com/swaywm/sway/wiki). Присоединяйтесь к
|
Больше информации в [FAQ]. Присоединяйтесь к
|
||||||
[IRC-каналу](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
|
[IRC-каналу][IRC channel] (#sway на
|
||||||
irc.freenode.net).
|
irc.libera.chat).
|
||||||
|
|
||||||
Если вы хотите поддержать разработку sway, сделайте пожертвование SirCmpwn на
|
|
||||||
[странице Patreon](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Подписи релизов
|
## Подписи релизов
|
||||||
|
|
||||||
Релизы подписываются ключом [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Релизы подписываются ключом [E88F5E48] и публикуются [на GitHub][GitHub releases].
|
||||||
и публикуются [на GitHub](https://github.com/swaywm/sway/releases).
|
|
||||||
|
|
||||||
## Установка
|
## Установка
|
||||||
|
|
||||||
### Из репозиториев
|
### Из репозиториев
|
||||||
|
|
||||||
sway доступен во многих дистрибутивах. Попробуйте установить пакет "sway".
|
Sway доступен во многих дистрибутивах. Попробуйте установить пакет "sway".
|
||||||
Если он вдруг недоступен, проверьте [эту страницу на wiki](https://github.com/swaywm/sway/wiki/Unsupported-packages)
|
|
||||||
для получения информации о подробностях установки для вашего
|
|
||||||
дистрибутива.
|
|
||||||
|
|
||||||
Если вы заинтересованы поддерживать sway в вашем дистрибутиве, загляните в наш IRC-канал
|
Если вас интересует создание пакета sway для вашего дистрибутива, зайдите на [IRC-канал][IRC channel]
|
||||||
или обратитесь на sir@cmpwn.com за советом.
|
или отправьте письмо на sir@cmpwn.com за советом.
|
||||||
|
|
||||||
### Сборка из исходников
|
### Сборка из исходников
|
||||||
|
|
||||||
|
Посетите [эту страницу на вики][Development setup], если вы хотите построить последнюю версию
|
||||||
|
sway и wlroots для тестирования или разработки.
|
||||||
|
|
||||||
Установите зависимости:
|
Установите зависимости:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots]
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
* json-c
|
* json-c
|
||||||
* pango
|
* pango
|
||||||
* cairo
|
* cairo
|
||||||
* gdk-pixbuf2 (необязательно: для работы трея)
|
* gdk-pixbuf2 (опционально: для работы трея)
|
||||||
* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (необязательно: для сборки man-страниц) \*
|
* [scdoc] (опционально: для man-страниц) \*
|
||||||
* git \*
|
* git (опционально: для информации о версии) \*
|
||||||
|
|
||||||
_\*Зависимости для сборки_
|
_\*Зависимости для сборки_
|
||||||
|
|
||||||
|
|
@ -66,3 +62,13 @@ sway сбросит root-права при запуске.
|
||||||
|
|
||||||
Выполните команду `sway` прямо из TTY. Некоторые дисплейные менеджеры могут работать, но они не поддерживаются со стороны
|
Выполните команду `sway` прямо из TTY. Некоторые дисплейные менеджеры могут работать, но они не поддерживаются со стороны
|
||||||
sway (gdm работает довольно неплохо).
|
sway (gdm работает довольно неплохо).
|
||||||
|
|
||||||
|
[i3]: https://i3wm.org/
|
||||||
|
[Wayland]: http://wayland.freedesktop.org/
|
||||||
|
[FAQ]: https://github.com/swaywm/sway/wiki
|
||||||
|
[IRC channel]: https://web.libera.chat/gamja/?channels=#sway
|
||||||
|
[E88F5E48]: https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48
|
||||||
|
[GitHub releases]: https://github.com/swaywm/sway/releases
|
||||||
|
[Development setup]: https://github.com/swaywm/sway/wiki/Development-Setup
|
||||||
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots
|
||||||
|
[scdoc]: https://git.sr.ht/~sircmpwn/scdoc
|
||||||
|
|
|
||||||
68
README.tr.md
Normal file
68
README.tr.md
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
# sway
|
||||||
|
|
||||||
|
|
||||||
|
Sway, [i3]-uyumlu bir [Wayland] dizgicisidir. [SSS][FAQ]'yi okuyun.
|
||||||
|
[IRC kanalı][IRC channel]na katılın \(irc.libera.chat'te #sway (İngilizce)).
|
||||||
|
|
||||||
|
## Sürüm imzaları
|
||||||
|
|
||||||
|
Sürümler [E88F5E48] ile imzalandı ve [GitHub][GitHub releases]'da yayınlandı.
|
||||||
|
|
||||||
|
## Kurulum
|
||||||
|
|
||||||
|
### Paketler ile
|
||||||
|
|
||||||
|
Sway birçok dağıtımda mevcuttur. Sizinki için "sway" paketini yüklemeyi deneyin.
|
||||||
|
|
||||||
|
Dağıtımınız için sway'i paketlemekle ilgileniyorsanız, IRC kanalına uğrayın veya tavsiye için sir@cmpwn.com adresine bir e-posta gönderin.
|
||||||
|
|
||||||
|
### Kaynak koddan derleme
|
||||||
|
|
||||||
|
Test veya geliştirme için sway ve wlroots'un HEAD'ini oluşturmak istiyorsanız [bu wiki sayfası][Development setup]na göz atın.
|
||||||
|
|
||||||
|
Aşağıdaki bağımlılıkları yükleyin:
|
||||||
|
|
||||||
|
* meson \*
|
||||||
|
* [wlroots]
|
||||||
|
* wayland
|
||||||
|
* wayland-protocols \*
|
||||||
|
* pcre
|
||||||
|
* json-c
|
||||||
|
* pango
|
||||||
|
* cairo
|
||||||
|
* gdk-pixbuf2 (isteğe bağlı: system tray)
|
||||||
|
* [scdoc] (isteğe bağlı: man pages) \*
|
||||||
|
* git (isteğe bağlı: version info) \*
|
||||||
|
|
||||||
|
_\*Derleme-anı bağımlılıkları_
|
||||||
|
|
||||||
|
Şu komutları çalıştırın:
|
||||||
|
|
||||||
|
meson build
|
||||||
|
ninja -C build
|
||||||
|
sudo ninja -C build install
|
||||||
|
|
||||||
|
logind olmayan sistemlerde, sway ikilisine (binary) izin vermeniz (suid) gerekir:
|
||||||
|
|
||||||
|
sudo chmod a+s /usr/local/bin/sway
|
||||||
|
|
||||||
|
Sway, başlangıçtan kısa bir süre sonra kök(root) izinlerini bırakacaktır.
|
||||||
|
|
||||||
|
## Yapılandırma
|
||||||
|
|
||||||
|
Zaten i3 kullanıyorsanız, i3 yapılandırmanızı `~/.config/sway/config` konumuna kopyalayın ve kutudan çıktığı gibi çalışacaktır. Aksi takdirde, örnek yapılandırma dosyasını `~/.config/sway/config` konumuna kopyalayın. Genellikle `/etc/sway/config` konumunda bulunur.
|
||||||
|
Yapılandırma hakkında bilgi almak için `man 5 sway` komutunu çalıştırın.
|
||||||
|
|
||||||
|
## Çalıştırma
|
||||||
|
|
||||||
|
TTY'den `sway` çalıştırın. Bazı görüntü yöneticileriyle(display manager) çalışabilir ama Sway tarafından desteklenmez. (gdm'nin oldukça iyi çalıştığı bilinmektedir.)
|
||||||
|
|
||||||
|
[i3]: https://i3wm.org/
|
||||||
|
[Wayland]: http://wayland.freedesktop.org/
|
||||||
|
[FAQ]: https://github.com/swaywm/sway/wiki
|
||||||
|
[IRC channel]: https://web.libera.chat/gamja/?channels=#sway
|
||||||
|
[E88F5E48]: https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48
|
||||||
|
[GitHub releases]: https://github.com/swaywm/sway/releases
|
||||||
|
[Development setup]: https://github.com/swaywm/sway/wiki/Development-Setup
|
||||||
|
[wlroots]: https://gitlab.freedesktop.org/wlroots/wlroots
|
||||||
|
[scdoc]: https://git.sr.ht/~sircmpwn/scdoc
|
||||||
11
README.uk.md
11
README.uk.md
|
|
@ -2,11 +2,8 @@
|
||||||
|
|
||||||
Sway це сумісний з [i3](https://i3wm.org/) композитор [Wayland](http://wayland.freedesktop.org/).
|
Sway це сумісний з [i3](https://i3wm.org/) композитор [Wayland](http://wayland.freedesktop.org/).
|
||||||
Ознайомтесь з [ЧаПами](https://github.com/swaywm/sway/wiki). Приєднуйтесь до [спільноти в
|
Ознайомтесь з [ЧаПами](https://github.com/swaywm/sway/wiki). Приєднуйтесь до [спільноти в
|
||||||
IRC](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway на
|
IRC](https://web.libera.chat/gamja/?channels=#sway) (#sway на
|
||||||
irc.freenode.net).
|
irc.libera.chat).
|
||||||
|
|
||||||
Якщо ви маєте бажання підтримати розробку sway, ви можете зробити свій внесок на сторінці
|
|
||||||
[SirCmpwn у Patreon](https://patreon.com/sircmpwn).
|
|
||||||
|
|
||||||
## Підтримка українською мовою
|
## Підтримка українською мовою
|
||||||
|
|
||||||
|
|
@ -18,7 +15,7 @@ Hummer12007 у IRC-спільноті. Будьте терплячі, вам о
|
||||||
|
|
||||||
## Підписи випусків
|
## Підписи випусків
|
||||||
|
|
||||||
Випуски підписані ключем [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)
|
Випуски підписані ключем [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48)
|
||||||
та публікуються на сторінці [GitHub](https://github.com/swaywm/sway/releases).
|
та публікуються на сторінці [GitHub](https://github.com/swaywm/sway/releases).
|
||||||
|
|
||||||
## Встановлення
|
## Встановлення
|
||||||
|
|
@ -39,7 +36,7 @@ Sway доступний у багатьох дистрибутивах Linux (а
|
||||||
Встановіть залежності:
|
Встановіть залежності:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,12 @@
|
||||||
|
|
||||||
sway 是和 [i3](https://i3wm.org/) 兼容的 [Wayland](http://wayland.freedesktop.org/) compositor.
|
sway 是和 [i3](https://i3wm.org/) 兼容的 [Wayland](http://wayland.freedesktop.org/) compositor.
|
||||||
阅读 [FAQ](https://github.com/swaywm/sway/wiki). 加入 [IRC
|
阅读 [FAQ](https://github.com/swaywm/sway/wiki). 加入 [IRC
|
||||||
频道](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
|
频道](https://web.libera.chat/gamja/?channels=#sway) (#sway on
|
||||||
irc.freenode.net).
|
irc.libera.chat).
|
||||||
|
|
||||||
如果你想要支持 sway 的发展, 请到 [SirCmpwn's
|
|
||||||
Patreon page](https://patreon.com/sircmpwn)贡献.
|
|
||||||
|
|
||||||
## 发布签名
|
## 发布签名
|
||||||
|
|
||||||
发布是以 [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A) 签名
|
发布是以 [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48) 签名
|
||||||
并发布在 [GitHub](https://github.com/swaywm/sway/releases).
|
并发布在 [GitHub](https://github.com/swaywm/sway/releases).
|
||||||
|
|
||||||
## 安装
|
## 安装
|
||||||
|
|
@ -28,7 +25,7 @@ Sway 在很多发行版中可用. 尝试在你的发行版中安装 "sway" 包.
|
||||||
安装依赖:
|
安装依赖:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,12 @@
|
||||||
|
|
||||||
sway 是一個與 [i3](https://i3wm.org/) 相容的 [Wayland](http://wayland.freedesktop.org/) compositor。
|
sway 是一個與 [i3](https://i3wm.org/) 相容的 [Wayland](http://wayland.freedesktop.org/) compositor。
|
||||||
閱讀 [FAQ](https://github.com/swaywm/sway/wiki)。 加入 [IRC
|
閱讀 [FAQ](https://github.com/swaywm/sway/wiki)。 加入 [IRC
|
||||||
頻道](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
|
頻道](https://web.libera.chat/gamja/?channels=#sway) (#sway on
|
||||||
irc.freenode.net)
|
irc.libera.chat)
|
||||||
|
|
||||||
如果你想支持 sway 的開發,請到 [SirCmpwn's
|
|
||||||
Patreon page](https://patreon.com/sircmpwn) 貢獻。
|
|
||||||
|
|
||||||
## 發行簽章
|
## 發行簽章
|
||||||
|
|
||||||
所有發行的版本都會以 [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A) 簽署
|
所有發行的版本都會以 [E88F5E48](https://keys.openpgp.org/search?q=34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48) 簽署
|
||||||
並發佈於 [GitHub](https://github.com/swaywm/sway/releases)
|
並發佈於 [GitHub](https://github.com/swaywm/sway/releases)
|
||||||
|
|
||||||
## 安裝
|
## 安裝
|
||||||
|
|
@ -28,7 +25,7 @@ Sway 在許多發行版都有提供。請自己嘗試於你的發行版安裝
|
||||||
相依套件:
|
相依套件:
|
||||||
|
|
||||||
* meson \*
|
* meson \*
|
||||||
* [wlroots](https://github.com/swaywm/wlroots)
|
* [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots)
|
||||||
* wayland
|
* wayland
|
||||||
* wayland-protocols \*
|
* wayland-protocols \*
|
||||||
* pcre
|
* pcre
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#define _POSIX_C_SOURCE 200809
|
#define _POSIX_C_SOURCE 200809
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <cairo/cairo.h>
|
#include <cairo.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <pango/pangocairo.h>
|
#include <pango/pangocairo.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "background-image.h"
|
#include "background-image.h"
|
||||||
#include "cairo.h"
|
#include "cairo_util.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#if HAVE_GDK_PIXBUF
|
#if HAVE_GDK_PIXBUF
|
||||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cairo/cairo.h>
|
#include <cairo.h>
|
||||||
#include "cairo.h"
|
#include "cairo_util.h"
|
||||||
|
|
||||||
void cairo_set_source_u32(cairo_t *cairo, uint32_t color) {
|
void cairo_set_source_u32(cairo_t *cairo, uint32_t color) {
|
||||||
cairo_set_source_rgba(cairo,
|
cairo_set_source_rgba(cairo,
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,13 @@ static const char *verbosity_colors[] = {
|
||||||
[SWAY_DEBUG ] = "\x1B[1;90m",
|
[SWAY_DEBUG ] = "\x1B[1;90m",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char *verbosity_headers[] = {
|
||||||
|
[SWAY_SILENT] = "",
|
||||||
|
[SWAY_ERROR] = "[ERROR]",
|
||||||
|
[SWAY_INFO] = "[INFO]",
|
||||||
|
[SWAY_DEBUG] = "[DEBUG]",
|
||||||
|
};
|
||||||
|
|
||||||
static void timespec_sub(struct timespec *r, const struct timespec *a,
|
static void timespec_sub(struct timespec *r, const struct timespec *a,
|
||||||
const struct timespec *b) {
|
const struct timespec *b) {
|
||||||
const long NSEC_PER_SEC = 1000000000;
|
const long NSEC_PER_SEC = 1000000000;
|
||||||
|
|
@ -84,6 +91,8 @@ static void sway_log_stderr(sway_log_importance_t verbosity, const char *fmt,
|
||||||
|
|
||||||
if (colored && isatty(STDERR_FILENO)) {
|
if (colored && isatty(STDERR_FILENO)) {
|
||||||
fprintf(stderr, "%s", verbosity_colors[c]);
|
fprintf(stderr, "%s", verbosity_colors[c]);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "%s ", verbosity_headers[c]);
|
||||||
}
|
}
|
||||||
|
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include <cairo/cairo.h>
|
#include <cairo.h>
|
||||||
#include <pango/pangocairo.h>
|
#include <pango/pangocairo.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "cairo.h"
|
#include "cairo_util.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "stringop.h"
|
#include "stringop.h"
|
||||||
|
|
||||||
|
|
@ -109,7 +109,23 @@ void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pango_printf(cairo_t *cairo, const char *font,
|
void get_text_metrics(const char *font, int *height, int *baseline) {
|
||||||
|
cairo_t *cairo = cairo_create(NULL);
|
||||||
|
PangoContext *pango = pango_cairo_create_context(cairo);
|
||||||
|
PangoFontDescription *description = pango_font_description_from_string(font);
|
||||||
|
// When passing NULL as a language, pango uses the current locale.
|
||||||
|
PangoFontMetrics *metrics = pango_context_get_metrics(pango, description, NULL);
|
||||||
|
|
||||||
|
*baseline = pango_font_metrics_get_ascent(metrics) / PANGO_SCALE;
|
||||||
|
*height = *baseline + pango_font_metrics_get_descent(metrics) / PANGO_SCALE;
|
||||||
|
|
||||||
|
pango_font_metrics_unref(metrics);
|
||||||
|
pango_font_description_free(description);
|
||||||
|
g_object_unref(pango);
|
||||||
|
cairo_destroy(cairo);
|
||||||
|
}
|
||||||
|
|
||||||
|
void render_text(cairo_t *cairo, const char *font,
|
||||||
double scale, bool markup, const char *fmt, ...) {
|
double scale, bool markup, const char *fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ char *lenient_strncat(char *dest, const char *src, size_t len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// strcmp that also handles null pointers.
|
// strcmp that also handles null pointers.
|
||||||
int lenient_strcmp(char *a, char *b) {
|
int lenient_strcmp(const char *a, const char *b) {
|
||||||
if (a == b) {
|
if (a == b) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if (!a) {
|
} else if (!a) {
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,6 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
uint32_t get_current_time_msec(void) {
|
|
||||||
struct timespec now;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
|
||||||
return now.tv_sec * 1000 + now.tv_nsec / 1000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
int wrap(int i, int max) {
|
int wrap(int i, int max) {
|
||||||
return ((i % max) + max) % max;
|
return ((i % max) + max) % max;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ set $down j
|
||||||
set $up k
|
set $up k
|
||||||
set $right l
|
set $right l
|
||||||
# Your preferred terminal emulator
|
# Your preferred terminal emulator
|
||||||
set $term alacritty
|
set $term foot
|
||||||
# Your preferred application launcher
|
# Your preferred application launcher
|
||||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||||
# on the original workspace that the command was run on.
|
# on the original workspace that the command was run on.
|
||||||
|
|
@ -82,7 +82,7 @@ output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||||
bindsym $mod+Shift+c reload
|
bindsym $mod+Shift+c reload
|
||||||
|
|
||||||
# Exit sway (logs you out of your Wayland session)
|
# Exit sway (logs you out of your Wayland session)
|
||||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
|
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
||||||
#
|
#
|
||||||
# Moving around:
|
# Moving around:
|
||||||
#
|
#
|
||||||
|
|
@ -205,7 +205,7 @@ bar {
|
||||||
|
|
||||||
# When the status_command prints a new line to stdout, swaybar updates.
|
# When the status_command prints a new line to stdout, swaybar updates.
|
||||||
# The default just shows the current date and time.
|
# The default just shows the current date and time.
|
||||||
status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
|
status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
|
||||||
|
|
||||||
colors {
|
colors {
|
||||||
statusline #ffffff
|
statusline #ffffff
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
#!/bin/sh -eu
|
|
||||||
old_version="$1"
|
|
||||||
new_version="$2"
|
|
||||||
|
|
||||||
if [ "$new_version" != "${new_version#v}" ]
|
|
||||||
then
|
|
||||||
echo "Error: The new version shouldn't be prefixed with a \"v\"." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
sed -i meson.build -e "s/^ version: .*#release_version/ version: '$new_version', #release_version/g"
|
|
||||||
|
|
||||||
printf "Minimum wlroots version? "
|
|
||||||
read wlr_version_min
|
|
||||||
printf "Maximum wlroots version? "
|
|
||||||
read wlr_version_max
|
|
||||||
|
|
||||||
sed -i meson.build -e "s/wlroots_version =.*/wlroots_version = ['>=$wlr_version_min', '<$wlr_version_max']/"
|
|
||||||
|
|
||||||
git add meson.build
|
|
||||||
git commit -m "Update version to $new_version"
|
|
||||||
|
|
@ -22,24 +22,17 @@ DEFAULT_ICON = ""
|
||||||
|
|
||||||
|
|
||||||
def icon_for_window(window):
|
def icon_for_window(window):
|
||||||
app_id = window.app_id
|
name = None
|
||||||
if app_id is not None and len(app_id) > 0:
|
if window.app_id is not None and len(window.app_id) > 0:
|
||||||
app_id = app_id.lower()
|
name = window.app_id.lower()
|
||||||
if app_id in WINDOW_ICONS:
|
elif window.window_class is not None and len(window.window_class) > 0:
|
||||||
return WINDOW_ICONS[app_id]
|
name = window.window_class.lower()
|
||||||
logging.info("No icon available for window with app_id: %s" % str(app_id))
|
|
||||||
else:
|
|
||||||
# xwayland support
|
|
||||||
class_name = window.window_class
|
|
||||||
if len(class_name) > 0:
|
|
||||||
class_name = class_name.lower()
|
|
||||||
if class_name in WINDOW_ICONS:
|
|
||||||
return WINDOW_ICONS[class_name]
|
|
||||||
logging.info(
|
|
||||||
"No icon available for window with class_name: %s" % str(class_name)
|
|
||||||
)
|
|
||||||
return DEFAULT_ICON
|
|
||||||
|
|
||||||
|
if name in WINDOW_ICONS:
|
||||||
|
return WINDOW_ICONS[name]
|
||||||
|
|
||||||
|
logging.info("No icon available for window with name: %s" % str(name))
|
||||||
|
return DEFAULT_ICON
|
||||||
|
|
||||||
def rename_workspaces(ipc):
|
def rename_workspaces(ipc):
|
||||||
for workspace in ipc.get_tree().workspaces():
|
for workspace in ipc.get_tree().workspaces():
|
||||||
|
|
@ -128,3 +121,4 @@ if __name__ == "__main__":
|
||||||
rename_workspaces(ipc)
|
rename_workspaces(ipc)
|
||||||
|
|
||||||
ipc.main()
|
ipc.main()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@ FILE=${3:-$(getTargetDirectory)/$(date -Ins).png}
|
||||||
|
|
||||||
if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then
|
if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " grimshot [--notify] (copy|save) [active|screen|output|area|window] [FILE]"
|
echo " grimshot [--notify] (copy|save) [active|screen|output|area|window] [FILE|-]"
|
||||||
echo " grimshot check"
|
echo " grimshot check"
|
||||||
echo " grimshot usage"
|
echo " grimshot usage"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Commands:"
|
echo "Commands:"
|
||||||
echo " copy: Copy the screenshot data into the clipboard."
|
echo " copy: Copy the screenshot data into the clipboard."
|
||||||
echo " save: Save the screenshot to a regular file."
|
echo " save: Save the screenshot to a regular file or '-' to pipe to STDOUT."
|
||||||
echo " check: Verify if required tools are installed and exit."
|
echo " check: Verify if required tools are installed and exit."
|
||||||
echo " usage: Show this message and exit."
|
echo " usage: Show this message and exit."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
@ -113,7 +113,7 @@ elif [ "$SUBJECT" = "area" ] ; then
|
||||||
GEOM=$(slurp -d)
|
GEOM=$(slurp -d)
|
||||||
# Check if user exited slurp without selecting the area
|
# Check if user exited slurp without selecting the area
|
||||||
if [ -z "$GEOM" ]; then
|
if [ -z "$GEOM" ]; then
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
WHAT="Area"
|
WHAT="Area"
|
||||||
elif [ "$SUBJECT" = "active" ] ; then
|
elif [ "$SUBJECT" = "active" ] ; then
|
||||||
|
|
@ -132,7 +132,7 @@ elif [ "$SUBJECT" = "window" ] ; then
|
||||||
GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)
|
GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)
|
||||||
# Check if user exited slurp without selecting the area
|
# Check if user exited slurp without selecting the area
|
||||||
if [ -z "$GEOM" ]; then
|
if [ -z "$GEOM" ]; then
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
WHAT="Window"
|
WHAT="Window"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,53 +1,61 @@
|
||||||
.\" Generated by scdoc 1.10.1
|
.\" Generated by scdoc 1.11.1
|
||||||
.\" Complete documentation for this program is not available as a GNU info page
|
.\" Complete documentation for this program is not available as a GNU info page
|
||||||
.ie \n(.g .ds Aq \(aq
|
.ie \n(.g .ds Aq \(aq
|
||||||
.el .ds Aq '
|
.el .ds Aq '
|
||||||
.nh
|
.nh
|
||||||
.ad l
|
.ad l
|
||||||
.\" Begin generated content:
|
.\" Begin generated content:
|
||||||
.TH "grimshot" "1" "2020-05-08"
|
.TH "grimshot" "1" "2021-02-23"
|
||||||
.P
|
.P
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.P
|
.P
|
||||||
grimshot - a helper for screenshots within sway
|
grimshot - a helper for screenshots within sway
|
||||||
.P
|
.P
|
||||||
.SH DESCRIPTION
|
.SH SYNOPSIS
|
||||||
.P
|
.P
|
||||||
grimshot [--notify] (copy|save) [TARGET] [FILE]
|
\fBgrimshot\fR [--notify] (copy|save) [TARGET] [FILE]
|
||||||
grimshot check
|
.br
|
||||||
grimshot usage
|
\fBgrimshot\fR check
|
||||||
|
.br
|
||||||
|
\fBgrimshot\fR usage
|
||||||
|
.P
|
||||||
|
.SH OPTIONS
|
||||||
.P
|
.P
|
||||||
\fB--notify\fR
|
\fB--notify\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Show notifications to the user that a screenshot has been taken.
|
Show notifications to the user that a screenshot has been taken.\&
|
||||||
.P
|
.P
|
||||||
.RE
|
.RE
|
||||||
\fBsave\fR
|
\fBsave\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Save the screenshot into a regular file. Grimshot will write images
|
Save the screenshot into a regular file.\& Grimshot will write images
|
||||||
files to \fB$XDG_SCREENSHOTS_DIR\fR if this is set (or defined
|
files to \fBXDG_SCREENSHOTS_DIR\fR if this is set (or defined
|
||||||
in `user-dirs.dir`), or otherwise fall back to `$XDG_PICTURES_DIR`
|
in \fBuser-dirs.\&dir\fR), or otherwise fall back to \fBXDG_PICTURES_DIR\fR.\&
|
||||||
|
Set FILE to '-' to pipe the output to STDOUT.\&
|
||||||
.P
|
.P
|
||||||
.RE
|
.RE
|
||||||
\fBcopy\fR
|
\fBcopy\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Copy the screenshot data (as image/png) into the clipboard.
|
Copy the screenshot data (as image/png) into the clipboard.\&
|
||||||
.P
|
.P
|
||||||
.RE
|
.RE
|
||||||
.SH SYNOPSIS
|
.SH DESCRIPTION
|
||||||
.P
|
.P
|
||||||
Grimshot is an easy to use screenshot tool for sway. It relies on grim, slurp
|
Grimshot is an easy-to-use screenshot utility for sway.\& It provides a
|
||||||
and jq to do the heavy lifting, and mostly provides an easy to use interface.
|
convenient interface over grim, slurp and jq, and supports storing the
|
||||||
|
screenshot either directly to the clipboard using wl-copy or to a file.\&
|
||||||
.P
|
.P
|
||||||
A recommended usage pattern is to just bind this to Super+P via sway:
|
.SH EXAMPLES
|
||||||
|
.P
|
||||||
|
An example usage pattern is to add these bindings to your sway config:
|
||||||
.P
|
.P
|
||||||
.nf
|
.nf
|
||||||
.RS 4
|
.RS 4
|
||||||
# Screenshots:
|
# Screenshots:
|
||||||
# Cmd+P: Current window
|
# Super+P: Current window
|
||||||
# Cmd+Shift+p: Select area
|
# Super+Shift+p: Select area
|
||||||
# Cmd+Alt+p Current output
|
# Super+Alt+p Current output
|
||||||
# Cmd+Ctrl+p Select a window
|
# Super+Ctrl+p Select a window
|
||||||
|
|
||||||
bindsym Mod4+p exec grimshot save active
|
bindsym Mod4+p exec grimshot save active
|
||||||
bindsym Mod4+Shift+p exec grimshot save area
|
bindsym Mod4+Shift+p exec grimshot save area
|
||||||
|
|
@ -62,34 +70,34 @@ grimshot can capture the following named targets:
|
||||||
.P
|
.P
|
||||||
\fIactive\fR
|
\fIactive\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Captures the currently active window.
|
Captures the currently active window.\&
|
||||||
.P
|
.P
|
||||||
.RE
|
.RE
|
||||||
\fIscreen\fR
|
\fIscreen\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Captures the entire screen. This includes all visible outputs.
|
Captures the entire screen.\& This includes all visible outputs.\&
|
||||||
.P
|
.P
|
||||||
.RE
|
.RE
|
||||||
\fIarea\fR
|
\fIarea\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Allows manually selecting a rectangular region, and captures that.
|
Allows manually selecting a rectangular region, and captures that.\&
|
||||||
.P
|
.P
|
||||||
.RE
|
.RE
|
||||||
\fIwindow\fR
|
\fIwindow\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Allows manually selecting a single window (by clicking on it), and
|
Allows manually selecting a single window (by clicking on it), and
|
||||||
captures it.
|
captures it.\&
|
||||||
.P
|
.P
|
||||||
.RE
|
.RE
|
||||||
\fIoutput\fR
|
\fIoutput\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Captures the currently active output.
|
Captures the currently active output.\&
|
||||||
.P
|
.P
|
||||||
.RE
|
.RE
|
||||||
.SH OUTPUT
|
.SH OUTPUT
|
||||||
.P
|
.P
|
||||||
Grimshot will always print the filename of the captured screenshot to
|
Grimshot will print the filename of the captured screenshot to stdout if called
|
||||||
stdout.
|
with the \fIsave\fR subcommand.\&
|
||||||
.P
|
.P
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.P
|
.P
|
||||||
|
|
|
||||||
|
|
@ -4,36 +4,42 @@ grimshot(1)
|
||||||
|
|
||||||
grimshot - a helper for screenshots within sway
|
grimshot - a helper for screenshots within sway
|
||||||
|
|
||||||
# DESCRIPTION
|
# SYNOPSIS
|
||||||
|
|
||||||
grimshot [--notify] (copy|save) [TARGET] [FILE]
|
*grimshot* [--notify] (copy|save) [TARGET] [FILE]++
|
||||||
grimshot check
|
*grimshot* check++
|
||||||
grimshot usage
|
*grimshot* usage
|
||||||
|
|
||||||
|
# OPTIONS
|
||||||
|
|
||||||
*--notify*
|
*--notify*
|
||||||
Show notifications to the user that a screenshot has been taken.
|
Show notifications to the user that a screenshot has been taken.
|
||||||
|
|
||||||
*save*
|
*save*
|
||||||
Save the screenshot into a regular file. Grimshot will write images
|
Save the screenshot into a regular file. Grimshot will write images
|
||||||
files to *$XDG_SCREENSHOTS_DIR* if this is set (or defined
|
files to *XDG_SCREENSHOTS_DIR* if this is set (or defined
|
||||||
in `user-dirs.dir`), or otherwise fall back to `$XDG_PICTURES_DIR`
|
in *user-dirs.dir*), or otherwise fall back to *XDG_PICTURES_DIR*.
|
||||||
|
Set FILE to '-' to pipe the output to STDOUT.
|
||||||
|
|
||||||
*copy*
|
*copy*
|
||||||
Copy the screenshot data (as image/png) into the clipboard.
|
Copy the screenshot data (as image/png) into the clipboard.
|
||||||
|
|
||||||
# SYNOPSIS
|
# DESCRIPTION
|
||||||
|
|
||||||
Grimshot is an easy to use screenshot tool for sway. It relies on grim, slurp
|
Grimshot is an easy-to-use screenshot utility for sway. It provides a
|
||||||
and jq to do the heavy lifting, and mostly provides an easy to use interface.
|
convenient interface over grim, slurp and jq, and supports storing the
|
||||||
|
screenshot either directly to the clipboard using wl-copy or to a file.
|
||||||
|
|
||||||
A recommended usage pattern is to just bind this to Super+P via sway:
|
# EXAMPLES
|
||||||
|
|
||||||
|
An example usage pattern is to add these bindings to your sway config:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Screenshots:
|
# Screenshots:
|
||||||
# Cmd+P: Current window
|
# Super+P: Current window
|
||||||
# Cmd+Shift+p: Select area
|
# Super+Shift+p: Select area
|
||||||
# Cmd+Alt+p Current output
|
# Super+Alt+p Current output
|
||||||
# Cmd+Ctrl+p Select a window
|
# Super+Ctrl+p Select a window
|
||||||
|
|
||||||
bindsym Mod4+p exec grimshot save active
|
bindsym Mod4+p exec grimshot save active
|
||||||
bindsym Mod4+Shift+p exec grimshot save area
|
bindsym Mod4+Shift+p exec grimshot save area
|
||||||
|
|
@ -63,8 +69,8 @@ _output_
|
||||||
|
|
||||||
# OUTPUT
|
# OUTPUT
|
||||||
|
|
||||||
Grimshot will always print the filename of the captured screenshot to
|
Grimshot will print the filename of the captured screenshot to stdout if called
|
||||||
stdout.
|
with the _save_ subcommand.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,13 @@ def on_window_focus(inactive_opacity, ipc, event):
|
||||||
global prev_focused
|
global prev_focused
|
||||||
global prev_workspace
|
global prev_workspace
|
||||||
|
|
||||||
|
focused_workspace = ipc.get_tree().find_focused()
|
||||||
|
|
||||||
|
if focused_workspace == None:
|
||||||
|
return
|
||||||
|
|
||||||
focused = event.container
|
focused = event.container
|
||||||
workspace = ipc.get_tree().find_focused().workspace().num
|
workspace = focused_workspace.workspace().num
|
||||||
|
|
||||||
if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859
|
if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859
|
||||||
focused.command("opacity 1")
|
focused.command("opacity 1")
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _SWAY_BACKGROUND_IMAGE_H
|
#ifndef _SWAY_BACKGROUND_IMAGE_H
|
||||||
#define _SWAY_BACKGROUND_IMAGE_H
|
#define _SWAY_BACKGROUND_IMAGE_H
|
||||||
#include "cairo.h"
|
#include "cairo_util.h"
|
||||||
|
|
||||||
enum background_mode {
|
enum background_mode {
|
||||||
BACKGROUND_MODE_STRETCH,
|
BACKGROUND_MODE_STRETCH,
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef _SWAY_CAIRO_H
|
#ifndef _SWAY_CAIRO_UTIL_H
|
||||||
#define _SWAY_CAIRO_H
|
#define _SWAY_CAIRO_UTIL_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cairo/cairo.h>
|
#include <cairo.h>
|
||||||
#include <wayland-client-protocol.h>
|
#include <wayland-client-protocol.h>
|
||||||
|
|
||||||
void cairo_set_source_u32(cairo_t *cairo, uint32_t color);
|
void cairo_set_source_u32(cairo_t *cairo, uint32_t color);
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
#ifndef _SWAY_IPC_CLIENT_H
|
#ifndef _SWAY_IPC_CLIENT_H
|
||||||
#define _SWAY_IPC_CLIENT_H
|
#define _SWAY_IPC_CLIENT_H
|
||||||
|
|
||||||
|
// arbitrary number, it's probably sufficient, higher number = more memory usage
|
||||||
|
#define JSON_MAX_DEPTH 512
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cairo/cairo.h>
|
#include <cairo.h>
|
||||||
#include <pango/pangocairo.h>
|
#include <pango/pangocairo.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -17,7 +17,8 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
|
||||||
const char *text, double scale, bool markup);
|
const char *text, double scale, bool markup);
|
||||||
void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,
|
void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,
|
||||||
int *baseline, double scale, bool markup, const char *fmt, ...);
|
int *baseline, double scale, bool markup, const char *fmt, ...);
|
||||||
void pango_printf(cairo_t *cairo, const char *font,
|
void get_text_metrics(const char *font, int *height, int *baseline);
|
||||||
|
void render_text(cairo_t *cairo, const char *font,
|
||||||
double scale, bool markup, const char *fmt, ...);
|
double scale, bool markup, const char *fmt, ...);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _SWAY_BUFFERS_H
|
#ifndef _SWAY_BUFFERS_H
|
||||||
#define _SWAY_BUFFERS_H
|
#define _SWAY_BUFFERS_H
|
||||||
#include <cairo/cairo.h>
|
#include <cairo.h>
|
||||||
#include <pango/pangocairo.h>
|
#include <pango/pangocairo.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ char *lenient_strcat(char *dest, const char *src);
|
||||||
char *lenient_strncat(char *dest, const char *src, size_t len);
|
char *lenient_strncat(char *dest, const char *src, size_t len);
|
||||||
|
|
||||||
// strcmp that also handles null pointers.
|
// strcmp that also handles null pointers.
|
||||||
int lenient_strcmp(char *a, char *b);
|
int lenient_strcmp(const char *a, const char *b);
|
||||||
|
|
||||||
// Simply split a string with delims, free with `list_free_items_and_destroy`
|
// Simply split a string with delims, free with `list_free_items_and_destroy`
|
||||||
list_t *split_string(const char *str, const char *delims);
|
list_t *split_string(const char *str, const char *delims);
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ enum expected_args {
|
||||||
struct cmd_results *checkarg(int argc, const char *name,
|
struct cmd_results *checkarg(int argc, const char *name,
|
||||||
enum expected_args type, int val);
|
enum expected_args type, int val);
|
||||||
|
|
||||||
struct cmd_handler *find_handler(char *line, struct cmd_handler *cmd_handlers,
|
const struct cmd_handler *find_handler(char *line,
|
||||||
size_t handlers_size);
|
const struct cmd_handler *cmd_handlers, size_t handlers_size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse and executes a command.
|
* Parse and executes a command.
|
||||||
|
|
@ -68,7 +68,7 @@ struct cmd_results *config_command(char *command, char **new_block);
|
||||||
* Parse and handle a sub command
|
* Parse and handle a sub command
|
||||||
*/
|
*/
|
||||||
struct cmd_results *config_subcommand(char **argv, int argc,
|
struct cmd_results *config_subcommand(char **argv, int argc,
|
||||||
struct cmd_handler *handlers, size_t handlers_size);
|
const struct cmd_handler *handlers, size_t handlers_size);
|
||||||
/*
|
/*
|
||||||
* Parses a command policy rule.
|
* Parses a command policy rule.
|
||||||
*/
|
*/
|
||||||
|
|
@ -97,6 +97,12 @@ void container_resize_tiled(struct sway_container *parent, uint32_t axis,
|
||||||
struct sway_container *container_find_resize_parent(struct sway_container *con,
|
struct sway_container *container_find_resize_parent(struct sway_container *con,
|
||||||
uint32_t edge);
|
uint32_t edge);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handlers shared by exec and exec_always.
|
||||||
|
*/
|
||||||
|
sway_cmd cmd_exec_validate;
|
||||||
|
sway_cmd cmd_exec_process;
|
||||||
|
|
||||||
sway_cmd cmd_assign;
|
sway_cmd cmd_assign;
|
||||||
sway_cmd cmd_bar;
|
sway_cmd cmd_bar;
|
||||||
sway_cmd cmd_bindcode;
|
sway_cmd cmd_bindcode;
|
||||||
|
|
@ -222,6 +228,7 @@ sway_cmd bar_cmd_unbindcode;
|
||||||
sway_cmd bar_cmd_unbindsym;
|
sway_cmd bar_cmd_unbindsym;
|
||||||
sway_cmd bar_cmd_wrap_scroll;
|
sway_cmd bar_cmd_wrap_scroll;
|
||||||
sway_cmd bar_cmd_workspace_buttons;
|
sway_cmd bar_cmd_workspace_buttons;
|
||||||
|
sway_cmd bar_cmd_workspace_min_width;
|
||||||
|
|
||||||
sway_cmd bar_colors_cmd_active_workspace;
|
sway_cmd bar_colors_cmd_active_workspace;
|
||||||
sway_cmd bar_colors_cmd_background;
|
sway_cmd bar_colors_cmd_background;
|
||||||
|
|
@ -257,6 +264,7 @@ sway_cmd input_cmd_scroll_button;
|
||||||
sway_cmd input_cmd_scroll_method;
|
sway_cmd input_cmd_scroll_method;
|
||||||
sway_cmd input_cmd_tap;
|
sway_cmd input_cmd_tap;
|
||||||
sway_cmd input_cmd_tap_button_map;
|
sway_cmd input_cmd_tap_button_map;
|
||||||
|
sway_cmd input_cmd_tool_mode;
|
||||||
sway_cmd input_cmd_xkb_capslock;
|
sway_cmd input_cmd_xkb_capslock;
|
||||||
sway_cmd input_cmd_xkb_file;
|
sway_cmd input_cmd_xkb_file;
|
||||||
sway_cmd input_cmd_xkb_layout;
|
sway_cmd input_cmd_xkb_layout;
|
||||||
|
|
@ -274,6 +282,7 @@ sway_cmd output_cmd_dpms;
|
||||||
sway_cmd output_cmd_enable;
|
sway_cmd output_cmd_enable;
|
||||||
sway_cmd output_cmd_max_render_time;
|
sway_cmd output_cmd_max_render_time;
|
||||||
sway_cmd output_cmd_mode;
|
sway_cmd output_cmd_mode;
|
||||||
|
sway_cmd output_cmd_modeline;
|
||||||
sway_cmd output_cmd_position;
|
sway_cmd output_cmd_position;
|
||||||
sway_cmd output_cmd_scale;
|
sway_cmd output_cmd_scale;
|
||||||
sway_cmd output_cmd_scale_filter;
|
sway_cmd output_cmd_scale_filter;
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,15 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <wlr/interfaces/wlr_switch.h>
|
#include <wlr/interfaces/wlr_switch.h>
|
||||||
#include <wlr/types/wlr_box.h>
|
#include <wlr/types/wlr_tablet_tool.h>
|
||||||
|
#include <wlr/util/box.h>
|
||||||
#include <xkbcommon/xkbcommon.h>
|
#include <xkbcommon/xkbcommon.h>
|
||||||
|
#include <xf86drmMode.h>
|
||||||
#include "../include/config.h"
|
#include "../include/config.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "swaynag.h"
|
#include "swaynag.h"
|
||||||
#include "tree/container.h"
|
#include "tree/container.h"
|
||||||
|
#include "sway/input/tablet.h"
|
||||||
#include "sway/tree/root.h"
|
#include "sway/tree/root.h"
|
||||||
#include "wlr-layer-shell-unstable-v1-protocol.h"
|
#include "wlr-layer-shell-unstable-v1-protocol.h"
|
||||||
|
|
||||||
|
|
@ -116,6 +119,11 @@ enum input_config_mapped_to {
|
||||||
MAPPED_TO_REGION,
|
MAPPED_TO_REGION,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct input_config_tool {
|
||||||
|
enum wlr_tablet_tool_type type;
|
||||||
|
enum sway_tablet_tool_mode mode;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* options for input devices
|
* options for input devices
|
||||||
*/
|
*/
|
||||||
|
|
@ -160,6 +168,8 @@ struct input_config {
|
||||||
char *mapped_to_output;
|
char *mapped_to_output;
|
||||||
struct wlr_box *mapped_to_region;
|
struct wlr_box *mapped_to_region;
|
||||||
|
|
||||||
|
list_t *tools;
|
||||||
|
|
||||||
bool capturable;
|
bool capturable;
|
||||||
struct wlr_box region;
|
struct wlr_box region;
|
||||||
};
|
};
|
||||||
|
|
@ -172,6 +182,12 @@ struct seat_attachment_config {
|
||||||
// TODO other things are configured here for some reason
|
// TODO other things are configured here for some reason
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum seat_config_hide_cursor_when_typing {
|
||||||
|
HIDE_WHEN_TYPING_DEFAULT, // the default is currently disabled
|
||||||
|
HIDE_WHEN_TYPING_ENABLE,
|
||||||
|
HIDE_WHEN_TYPING_DISABLE,
|
||||||
|
};
|
||||||
|
|
||||||
enum seat_config_allow_constrain {
|
enum seat_config_allow_constrain {
|
||||||
CONSTRAIN_DEFAULT, // the default is currently enabled
|
CONSTRAIN_DEFAULT, // the default is currently enabled
|
||||||
CONSTRAIN_ENABLE,
|
CONSTRAIN_ENABLE,
|
||||||
|
|
@ -207,6 +223,7 @@ struct seat_config {
|
||||||
int fallback; // -1 means not set
|
int fallback; // -1 means not set
|
||||||
list_t *attachments; // list of seat_attachment configs
|
list_t *attachments; // list of seat_attachment configs
|
||||||
int hide_cursor_timeout;
|
int hide_cursor_timeout;
|
||||||
|
enum seat_config_hide_cursor_when_typing hide_cursor_when_typing;
|
||||||
enum seat_config_allow_constrain allow_constrain;
|
enum seat_config_allow_constrain allow_constrain;
|
||||||
enum seat_config_shortcuts_inhibit shortcuts_inhibit;
|
enum seat_config_shortcuts_inhibit shortcuts_inhibit;
|
||||||
enum seat_keyboard_grouping keyboard_grouping;
|
enum seat_keyboard_grouping keyboard_grouping;
|
||||||
|
|
@ -241,6 +258,7 @@ struct output_config {
|
||||||
int width, height;
|
int width, height;
|
||||||
float refresh_rate;
|
float refresh_rate;
|
||||||
int custom_mode;
|
int custom_mode;
|
||||||
|
drmModeModeInfo drm_mode;
|
||||||
int x, y;
|
int x, y;
|
||||||
float scale;
|
float scale;
|
||||||
enum scale_filter_mode scale_filter;
|
enum scale_filter_mode scale_filter;
|
||||||
|
|
@ -265,6 +283,12 @@ struct side_gaps {
|
||||||
int left;
|
int left;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum smart_gaps_mode {
|
||||||
|
SMART_GAPS_OFF,
|
||||||
|
SMART_GAPS_ON,
|
||||||
|
SMART_GAPS_INVERSE_OUTER,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores configuration for a workspace, regardless of whether the workspace
|
* Stores configuration for a workspace, regardless of whether the workspace
|
||||||
* exists.
|
* exists.
|
||||||
|
|
@ -276,6 +300,12 @@ struct workspace_config {
|
||||||
struct side_gaps gaps_outer;
|
struct side_gaps gaps_outer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum pango_markup_config {
|
||||||
|
PANGO_MARKUP_DISABLED = false,
|
||||||
|
PANGO_MARKUP_ENABLED = true,
|
||||||
|
PANGO_MARKUP_DEFAULT // The default is font dependent ("pango:" prefix)
|
||||||
|
};
|
||||||
|
|
||||||
struct bar_config {
|
struct bar_config {
|
||||||
char *swaybar_command;
|
char *swaybar_command;
|
||||||
struct wl_client *client;
|
struct wl_client *client;
|
||||||
|
|
@ -307,7 +337,7 @@ struct bar_config {
|
||||||
char *position;
|
char *position;
|
||||||
list_t *bindings;
|
list_t *bindings;
|
||||||
char *status_command;
|
char *status_command;
|
||||||
bool pango_markup;
|
enum pango_markup_config pango_markup;
|
||||||
char *font;
|
char *font;
|
||||||
int height; // -1 not defined
|
int height; // -1 not defined
|
||||||
bool workspace_buttons;
|
bool workspace_buttons;
|
||||||
|
|
@ -320,6 +350,7 @@ struct bar_config {
|
||||||
struct side_gaps gaps;
|
struct side_gaps gaps;
|
||||||
int status_padding;
|
int status_padding;
|
||||||
int status_edge_padding;
|
int status_edge_padding;
|
||||||
|
uint32_t workspace_min_width;
|
||||||
struct {
|
struct {
|
||||||
char *background;
|
char *background;
|
||||||
char *statusline;
|
char *statusline;
|
||||||
|
|
@ -393,14 +424,6 @@ enum sway_popup_during_fullscreen {
|
||||||
POPUP_LEAVE,
|
POPUP_LEAVE,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum command_context {
|
|
||||||
CONTEXT_CONFIG = 1 << 0,
|
|
||||||
CONTEXT_BINDING = 1 << 1,
|
|
||||||
CONTEXT_IPC = 1 << 2,
|
|
||||||
CONTEXT_CRITERIA = 1 << 3,
|
|
||||||
CONTEXT_ALL = 0xFFFFFFFF,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum focus_follows_mouse_mode {
|
enum focus_follows_mouse_mode {
|
||||||
FOLLOWS_NO,
|
FOLLOWS_NO,
|
||||||
FOLLOWS_YES,
|
FOLLOWS_YES,
|
||||||
|
|
@ -463,8 +486,8 @@ struct sway_config {
|
||||||
enum sway_container_layout default_orientation;
|
enum sway_container_layout default_orientation;
|
||||||
enum sway_container_layout default_layout;
|
enum sway_container_layout default_layout;
|
||||||
char *font;
|
char *font;
|
||||||
size_t font_height;
|
int font_height;
|
||||||
size_t font_baseline;
|
int font_baseline;
|
||||||
bool pango_markup;
|
bool pango_markup;
|
||||||
int titlebar_border_thickness;
|
int titlebar_border_thickness;
|
||||||
int titlebar_h_padding;
|
int titlebar_h_padding;
|
||||||
|
|
@ -495,7 +518,7 @@ struct sway_config {
|
||||||
bool tiling_drag;
|
bool tiling_drag;
|
||||||
int tiling_drag_threshold;
|
int tiling_drag_threshold;
|
||||||
|
|
||||||
bool smart_gaps;
|
enum smart_gaps_mode smart_gaps;
|
||||||
int gaps_inner;
|
int gaps_inner;
|
||||||
struct side_gaps gaps_outer;
|
struct side_gaps gaps_outer;
|
||||||
|
|
||||||
|
|
@ -542,7 +565,7 @@ struct sway_config {
|
||||||
struct sway_node *node;
|
struct sway_node *node;
|
||||||
struct sway_container *container;
|
struct sway_container *container;
|
||||||
struct sway_workspace *workspace;
|
struct sway_workspace *workspace;
|
||||||
bool using_criteria;
|
bool node_overridden; // True if the node is selected by means other than focus
|
||||||
struct {
|
struct {
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
|
|
@ -673,14 +696,13 @@ void free_bar_binding(struct bar_binding *binding);
|
||||||
void free_workspace_config(struct workspace_config *wsc);
|
void free_workspace_config(struct workspace_config *wsc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the value of config->font_height based on the max title height
|
* Updates the value of config->font_height based on the metrics for title's
|
||||||
* reported by each container. If recalculate is true, the containers will
|
* font as reported by pango.
|
||||||
* recalculate their heights before reporting.
|
*
|
||||||
*
|
|
||||||
* If the height has changed, all containers will be rearranged to take on the
|
* If the height has changed, all containers will be rearranged to take on the
|
||||||
* new size.
|
* new size.
|
||||||
*/
|
*/
|
||||||
void config_update_font_height(bool recalculate);
|
void config_update_font_height(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert bindsym into bindcode using the first configured layout.
|
* Convert bindsym into bindcode using the first configured layout.
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ struct sway_idle_inhibit_manager_v1 {
|
||||||
|
|
||||||
struct sway_idle_inhibitor_v1 {
|
struct sway_idle_inhibitor_v1 {
|
||||||
struct sway_idle_inhibit_manager_v1 *manager;
|
struct sway_idle_inhibit_manager_v1 *manager;
|
||||||
|
struct wlr_idle_inhibitor_v1 *wlr_inhibitor;
|
||||||
struct sway_view *view;
|
struct sway_view *view;
|
||||||
enum sway_idle_inhibit_mode mode;
|
enum sway_idle_inhibit_mode mode;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,12 @@ struct sway_view;
|
||||||
*/
|
*/
|
||||||
void transaction_commit_dirty(void);
|
void transaction_commit_dirty(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Same as transaction_commit_dirty, but signalling that this is a
|
||||||
|
* client-initiated change has already taken effect.
|
||||||
|
*/
|
||||||
|
void transaction_commit_dirty_client(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify the transaction system that a view is ready for the new layout.
|
* Notify the transaction system that a view is ready for the new layout.
|
||||||
*
|
*
|
||||||
|
|
@ -38,11 +44,11 @@ void transaction_notify_view_ready_by_serial(struct sway_view *view,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify the transaction system that a view is ready for the new layout, but
|
* Notify the transaction system that a view is ready for the new layout, but
|
||||||
* identifying the instruction by width and height rather than by serial.
|
* identifying the instruction by geometry rather than by serial.
|
||||||
*
|
*
|
||||||
* This is used by xwayland views, as they don't have serials.
|
* This is used by xwayland views, as they don't have serials.
|
||||||
*/
|
*/
|
||||||
void transaction_notify_view_ready_by_size(struct sway_view *view,
|
void transaction_notify_view_ready_by_geometry(struct sway_view *view,
|
||||||
int width, int height);
|
double x, double y, int width, int height);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#include <wlr/types/wlr_pointer_gestures_v1.h>
|
#include <wlr/types/wlr_pointer_gestures_v1.h>
|
||||||
#include <wlr/types/wlr_surface.h>
|
#include <wlr/types/wlr_surface.h>
|
||||||
#include "sway/input/seat.h"
|
#include "sway/input/seat.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32
|
#define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32
|
||||||
|
|
||||||
|
|
@ -51,7 +52,9 @@ struct sway_cursor {
|
||||||
struct wl_listener touch_down;
|
struct wl_listener touch_down;
|
||||||
struct wl_listener touch_up;
|
struct wl_listener touch_up;
|
||||||
struct wl_listener touch_motion;
|
struct wl_listener touch_motion;
|
||||||
|
struct wl_listener touch_frame;
|
||||||
bool simulating_pointer_from_touch;
|
bool simulating_pointer_from_touch;
|
||||||
|
bool pointer_touch_up;
|
||||||
int32_t pointer_touch_id;
|
int32_t pointer_touch_id;
|
||||||
|
|
||||||
struct wl_listener tool_axis;
|
struct wl_listener tool_axis;
|
||||||
|
|
@ -68,6 +71,10 @@ struct sway_cursor {
|
||||||
|
|
||||||
struct wl_event_source *hide_source;
|
struct wl_event_source *hide_source;
|
||||||
bool hidden;
|
bool hidden;
|
||||||
|
// This field is just a cache of the field in seat_config in order to avoid
|
||||||
|
// costly seat_config lookups on every keypress. HIDE_WHEN_TYPING_DEFAULT
|
||||||
|
// indicates that there is no cached value.
|
||||||
|
enum seat_config_hide_cursor_when_typing hide_when_typing;
|
||||||
|
|
||||||
size_t pressed_button_count;
|
size_t pressed_button_count;
|
||||||
};
|
};
|
||||||
|
|
@ -90,10 +97,13 @@ void cursor_rebase(struct sway_cursor *cursor);
|
||||||
void cursor_rebase_all(void);
|
void cursor_rebase_all(void);
|
||||||
void cursor_update_image(struct sway_cursor *cursor, struct sway_node *node);
|
void cursor_update_image(struct sway_cursor *cursor, struct sway_node *node);
|
||||||
|
|
||||||
void cursor_handle_activity(struct sway_cursor *cursor,
|
void cursor_handle_activity_from_idle_source(struct sway_cursor *cursor,
|
||||||
|
enum sway_input_idle_source idle_source);
|
||||||
|
void cursor_handle_activity_from_device(struct sway_cursor *cursor,
|
||||||
struct wlr_input_device *device);
|
struct wlr_input_device *device);
|
||||||
void cursor_unhide(struct sway_cursor *cursor);
|
void cursor_unhide(struct sway_cursor *cursor);
|
||||||
int cursor_get_timeout(struct sway_cursor *cursor);
|
int cursor_get_timeout(struct sway_cursor *cursor);
|
||||||
|
void cursor_notify_key_press(struct sway_cursor *cursor);
|
||||||
|
|
||||||
void dispatch_cursor_button(struct sway_cursor *cursor,
|
void dispatch_cursor_button(struct sway_cursor *cursor,
|
||||||
struct wlr_input_device *device, uint32_t time_msec, uint32_t button,
|
struct wlr_input_device *device, uint32_t time_msec, uint32_t button,
|
||||||
|
|
@ -110,7 +120,7 @@ void cursor_set_image_surface(struct sway_cursor *cursor,
|
||||||
struct wl_client *client);
|
struct wl_client *client);
|
||||||
|
|
||||||
void cursor_warp_to_container(struct sway_cursor *cursor,
|
void cursor_warp_to_container(struct sway_cursor *cursor,
|
||||||
struct sway_container *container);
|
struct sway_container *container, bool force);
|
||||||
|
|
||||||
void cursor_warp_to_workspace(struct sway_cursor *cursor,
|
void cursor_warp_to_workspace(struct sway_cursor *cursor,
|
||||||
struct sway_workspace *workspace);
|
struct sway_workspace *workspace);
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,6 @@ void sway_input_configure_libinput_device(struct sway_input_device *device);
|
||||||
|
|
||||||
void sway_input_reset_libinput_device(struct sway_input_device *device);
|
void sway_input_reset_libinput_device(struct sway_input_device *device);
|
||||||
|
|
||||||
|
bool sway_libinput_device_is_builtin(struct sway_input_device *device);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,12 @@ struct sway_seatop_impl {
|
||||||
void (*button)(struct sway_seat *seat, uint32_t time_msec,
|
void (*button)(struct sway_seat *seat, uint32_t time_msec,
|
||||||
struct wlr_input_device *device, uint32_t button,
|
struct wlr_input_device *device, uint32_t button,
|
||||||
enum wlr_button_state state);
|
enum wlr_button_state state);
|
||||||
void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec,
|
void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec);
|
||||||
double dx, double dy);
|
|
||||||
void (*pointer_axis)(struct sway_seat *seat,
|
void (*pointer_axis)(struct sway_seat *seat,
|
||||||
struct wlr_event_pointer_axis *event);
|
struct wlr_event_pointer_axis *event);
|
||||||
void (*rebase)(struct sway_seat *seat, uint32_t time_msec);
|
void (*rebase)(struct sway_seat *seat, uint32_t time_msec);
|
||||||
void (*tablet_tool_motion)(struct sway_seat *seat,
|
void (*tablet_tool_motion)(struct sway_seat *seat,
|
||||||
struct sway_tablet_tool *tool, uint32_t time_msec, double dx, double dy);
|
struct sway_tablet_tool *tool, uint32_t time_msec);
|
||||||
void (*tablet_tool_tip)(struct sway_seat *seat, struct sway_tablet_tool *tool,
|
void (*tablet_tool_tip)(struct sway_seat *seat, struct sway_tablet_tool *tool,
|
||||||
uint32_t time_msec, enum wlr_tablet_tool_tip_state state);
|
uint32_t time_msec, enum wlr_tablet_tool_tip_state state);
|
||||||
void (*end)(struct sway_seat *seat);
|
void (*end)(struct sway_seat *seat);
|
||||||
|
|
@ -240,7 +239,10 @@ enum wlr_edges find_resize_edge(struct sway_container *cont,
|
||||||
void seatop_begin_default(struct sway_seat *seat);
|
void seatop_begin_default(struct sway_seat *seat);
|
||||||
|
|
||||||
void seatop_begin_down(struct sway_seat *seat, struct sway_container *con,
|
void seatop_begin_down(struct sway_seat *seat, struct sway_container *con,
|
||||||
uint32_t time_msec, int sx, int sy);
|
uint32_t time_msec, double sx, double sy);
|
||||||
|
|
||||||
|
void seatop_begin_down_on_surface(struct sway_seat *seat,
|
||||||
|
struct wlr_surface *surface, uint32_t time_msec, double sx, double sy);
|
||||||
|
|
||||||
void seatop_begin_move_floating(struct sway_seat *seat,
|
void seatop_begin_move_floating(struct sway_seat *seat,
|
||||||
struct sway_container *con);
|
struct sway_container *con);
|
||||||
|
|
@ -269,11 +271,7 @@ void seatop_button(struct sway_seat *seat, uint32_t time_msec,
|
||||||
struct wlr_input_device *device, uint32_t button,
|
struct wlr_input_device *device, uint32_t button,
|
||||||
enum wlr_button_state state);
|
enum wlr_button_state state);
|
||||||
|
|
||||||
/**
|
void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec);
|
||||||
* dx and dy are distances relative to previous position.
|
|
||||||
*/
|
|
||||||
void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec,
|
|
||||||
double dx, double dy);
|
|
||||||
|
|
||||||
void seatop_pointer_axis(struct sway_seat *seat,
|
void seatop_pointer_axis(struct sway_seat *seat,
|
||||||
struct wlr_event_pointer_axis *event);
|
struct wlr_event_pointer_axis *event);
|
||||||
|
|
@ -283,7 +281,7 @@ void seatop_tablet_tool_tip(struct sway_seat *seat,
|
||||||
enum wlr_tablet_tool_tip_state state);
|
enum wlr_tablet_tool_tip_state state);
|
||||||
|
|
||||||
void seatop_tablet_tool_motion(struct sway_seat *seat,
|
void seatop_tablet_tool_motion(struct sway_seat *seat,
|
||||||
struct sway_tablet_tool *tool, uint32_t time_msec, double dx, double dy);
|
struct sway_tablet_tool *tool, uint32_t time_msec);
|
||||||
|
|
||||||
void seatop_rebase(struct sway_seat *seat, uint32_t time_msec);
|
void seatop_rebase(struct sway_seat *seat, uint32_t time_msec);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,17 @@ struct sway_tablet {
|
||||||
struct wlr_tablet_v2_tablet *tablet_v2;
|
struct wlr_tablet_v2_tablet *tablet_v2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum sway_tablet_tool_mode {
|
||||||
|
SWAY_TABLET_TOOL_MODE_ABSOLUTE,
|
||||||
|
SWAY_TABLET_TOOL_MODE_RELATIVE,
|
||||||
|
};
|
||||||
|
|
||||||
struct sway_tablet_tool {
|
struct sway_tablet_tool {
|
||||||
struct sway_seat *seat;
|
struct sway_seat *seat;
|
||||||
struct sway_tablet *tablet;
|
struct sway_tablet *tablet;
|
||||||
struct wlr_tablet_v2_tablet_tool *tablet_v2_tool;
|
struct wlr_tablet_v2_tablet_tool *tablet_v2_tool;
|
||||||
|
|
||||||
|
enum sway_tablet_tool_mode mode;
|
||||||
double tilt_x, tilt_y;
|
double tilt_x, tilt_y;
|
||||||
|
|
||||||
struct wl_listener set_cursor;
|
struct wl_listener set_cursor;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,10 @@ struct sway_input_method_relay {
|
||||||
|
|
||||||
struct wl_listener input_method_new;
|
struct wl_listener input_method_new;
|
||||||
struct wl_listener input_method_commit;
|
struct wl_listener input_method_commit;
|
||||||
|
struct wl_listener input_method_grab_keyboard;
|
||||||
struct wl_listener input_method_destroy;
|
struct wl_listener input_method_destroy;
|
||||||
|
|
||||||
|
struct wl_listener input_method_keyboard_grab_destroy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sway_text_input {
|
struct sway_text_input {
|
||||||
|
|
@ -53,6 +56,8 @@ struct sway_text_input {
|
||||||
void sway_input_method_relay_init(struct sway_seat *seat,
|
void sway_input_method_relay_init(struct sway_seat *seat,
|
||||||
struct sway_input_method_relay *relay);
|
struct sway_input_method_relay *relay);
|
||||||
|
|
||||||
|
void sway_input_method_relay_finish(struct sway_input_method_relay *relay);
|
||||||
|
|
||||||
// Updates currently focused surface. Surface must belong to the same seat.
|
// Updates currently focused surface. Surface must belong to the same seat.
|
||||||
void sway_input_method_relay_set_focus(struct sway_input_method_relay *relay,
|
void sway_input_method_relay_set_focus(struct sway_input_method_relay *relay,
|
||||||
struct wlr_surface *surface);
|
struct wlr_surface *surface);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef _SWAY_LAYERS_H
|
#ifndef _SWAY_LAYERS_H
|
||||||
#define _SWAY_LAYERS_H
|
#define _SWAY_LAYERS_H
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <wlr/types/wlr_box.h>
|
|
||||||
#include <wlr/types/wlr_surface.h>
|
#include <wlr/types/wlr_surface.h>
|
||||||
#include <wlr/types/wlr_layer_shell_v1.h>
|
#include <wlr/types/wlr_layer_shell_v1.h>
|
||||||
|
|
||||||
|
|
@ -20,8 +19,11 @@ struct sway_layer_surface {
|
||||||
struct wl_listener surface_commit;
|
struct wl_listener surface_commit;
|
||||||
struct wl_listener output_destroy;
|
struct wl_listener output_destroy;
|
||||||
struct wl_listener new_popup;
|
struct wl_listener new_popup;
|
||||||
|
struct wl_listener new_subsurface;
|
||||||
|
|
||||||
struct wlr_box geo;
|
struct wlr_box geo;
|
||||||
|
bool mapped;
|
||||||
|
struct wlr_box extent;
|
||||||
enum zwlr_layer_shell_v1_layer layer;
|
enum zwlr_layer_shell_v1_layer layer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -39,6 +41,16 @@ struct sway_layer_popup {
|
||||||
struct wl_listener new_popup;
|
struct wl_listener new_popup;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct sway_layer_subsurface {
|
||||||
|
struct wlr_subsurface *wlr_subsurface;
|
||||||
|
struct sway_layer_surface *layer_surface;
|
||||||
|
|
||||||
|
struct wl_listener map;
|
||||||
|
struct wl_listener unmap;
|
||||||
|
struct wl_listener destroy;
|
||||||
|
struct wl_listener commit;
|
||||||
|
};
|
||||||
|
|
||||||
struct sway_output;
|
struct sway_output;
|
||||||
void arrange_layers(struct sway_output *output);
|
void arrange_layers(struct sway_output *output);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wayland-server-core.h>
|
#include <wayland-server-core.h>
|
||||||
#include <wlr/types/wlr_box.h>
|
|
||||||
#include <wlr/types/wlr_output.h>
|
#include <wlr/types/wlr_output.h>
|
||||||
#include <wlr/types/wlr_workspace_v1.h>
|
#include <wlr/types/wlr_workspace_v1.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
@ -44,9 +43,8 @@ struct sway_output {
|
||||||
struct sway_output_state current;
|
struct sway_output_state current;
|
||||||
|
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
|
struct wl_listener commit;
|
||||||
struct wl_listener mode;
|
struct wl_listener mode;
|
||||||
struct wl_listener transform;
|
|
||||||
struct wl_listener scale;
|
|
||||||
struct wl_listener present;
|
struct wl_listener present;
|
||||||
struct wl_listener damage_destroy;
|
struct wl_listener damage_destroy;
|
||||||
struct wl_listener damage_frame;
|
struct wl_listener damage_frame;
|
||||||
|
|
@ -77,8 +75,8 @@ struct sway_output *output_get_in_direction(struct sway_output *reference,
|
||||||
void output_add_workspace(struct sway_output *output,
|
void output_add_workspace(struct sway_output *output,
|
||||||
struct sway_workspace *workspace);
|
struct sway_workspace *workspace);
|
||||||
|
|
||||||
typedef void (*sway_surface_iterator_func_t)(struct sway_output *output, struct sway_view *view,
|
typedef void (*sway_surface_iterator_func_t)(struct sway_output *output,
|
||||||
struct wlr_surface *surface, struct wlr_box *box, float rotation,
|
struct sway_view *view, struct wlr_surface *surface, struct wlr_box *box,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
void output_damage_whole(struct sway_output *output);
|
void output_damage_whole(struct sway_output *output);
|
||||||
|
|
@ -121,7 +119,7 @@ void output_view_for_each_surface(struct sway_output *output,
|
||||||
struct sway_view *view, sway_surface_iterator_func_t iterator,
|
struct sway_view *view, sway_surface_iterator_func_t iterator,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
void output_view_for_each_popup(struct sway_output *output,
|
void output_view_for_each_popup_surface(struct sway_output *output,
|
||||||
struct sway_view *view, sway_surface_iterator_func_t iterator,
|
struct sway_view *view, sway_surface_iterator_func_t iterator,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
|
|
@ -129,11 +127,11 @@ void output_layer_for_each_surface(struct sway_output *output,
|
||||||
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
|
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
void output_layer_for_each_surface_toplevel(struct sway_output *output,
|
void output_layer_for_each_toplevel_surface(struct sway_output *output,
|
||||||
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
|
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
void output_layer_for_each_surface_popup(struct sway_output *output,
|
void output_layer_for_each_popup_surface(struct sway_output *output,
|
||||||
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
|
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wlr/types/wlr_input_method_v2.h>
|
#include <wlr/types/wlr_input_method_v2.h>
|
||||||
#include <wlr/types/wlr_foreign_toplevel_management_v1.h>
|
#include <wlr/types/wlr_foreign_toplevel_management_v1.h>
|
||||||
#include <wlr/types/wlr_workspace_v1.h>
|
#include <wlr/types/wlr_workspace_v1.h>
|
||||||
|
#include <wlr/types/wlr_drm_lease_v1.h>
|
||||||
#include <wlr/types/wlr_layer_shell_v1.h>
|
#include <wlr/types/wlr_layer_shell_v1.h>
|
||||||
#include <wlr/types/wlr_output_management_v1.h>
|
#include <wlr/types/wlr_output_management_v1.h>
|
||||||
#include <wlr/types/wlr_output_power_management_v1.h>
|
#include <wlr/types/wlr_output_power_management_v1.h>
|
||||||
|
|
@ -24,6 +25,8 @@
|
||||||
#include "sway/xwayland.h"
|
#include "sway/xwayland.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct sway_transaction;
|
||||||
|
|
||||||
struct sway_server {
|
struct sway_server {
|
||||||
struct wl_display *wl_display;
|
struct wl_display *wl_display;
|
||||||
struct wl_event_loop *wl_event_loop;
|
struct wl_event_loop *wl_event_loop;
|
||||||
|
|
@ -71,6 +74,9 @@ struct sway_server {
|
||||||
struct wl_listener xdg_decoration;
|
struct wl_listener xdg_decoration;
|
||||||
struct wl_list xdg_decorations; // sway_xdg_decoration::link
|
struct wl_list xdg_decorations; // sway_xdg_decoration::link
|
||||||
|
|
||||||
|
struct wlr_drm_lease_v1_manager *drm_lease_manager;
|
||||||
|
struct wl_listener drm_lease_request;
|
||||||
|
|
||||||
struct wlr_presentation *presentation;
|
struct wlr_presentation *presentation;
|
||||||
|
|
||||||
struct wlr_pointer_constraints_v1 *pointer_constraints;
|
struct wlr_pointer_constraints_v1 *pointer_constraints;
|
||||||
|
|
@ -88,8 +94,25 @@ struct sway_server {
|
||||||
struct wlr_workspace_manager_v1 *workspace_manager;
|
struct wlr_workspace_manager_v1 *workspace_manager;
|
||||||
struct wl_listener workspace_manager_commit_request;
|
struct wl_listener workspace_manager_commit_request;
|
||||||
|
|
||||||
|
struct wlr_xdg_activation_v1 *xdg_activation_v1;
|
||||||
|
struct wl_listener xdg_activation_v1_request_activate;
|
||||||
|
|
||||||
|
// The timeout for transactions, after which a transaction is applied
|
||||||
|
// regardless of readiness.
|
||||||
size_t txn_timeout_ms;
|
size_t txn_timeout_ms;
|
||||||
list_t *transactions;
|
|
||||||
|
// Stores a transaction after it has been committed, but is waiting for
|
||||||
|
// views to ack the new dimensions before being applied. A queued
|
||||||
|
// transaction is frozen and must not have new instructions added to it.
|
||||||
|
struct sway_transaction *queued_transaction;
|
||||||
|
|
||||||
|
// Stores a pending transaction that will be committed once the existing
|
||||||
|
// queued transaction is applied and freed. The pending transaction can be
|
||||||
|
// updated with new instructions as needed.
|
||||||
|
struct sway_transaction *pending_transaction;
|
||||||
|
|
||||||
|
// Stores the nodes that have been marked as "dirty" and will be put into
|
||||||
|
// the pending transaction.
|
||||||
list_t *dirty_nodes;
|
list_t *dirty_nodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -99,6 +122,7 @@ struct sway_debug {
|
||||||
bool noatomic; // Ignore atomic layout updates
|
bool noatomic; // Ignore atomic layout updates
|
||||||
bool txn_timings; // Log verbose messages about transactions
|
bool txn_timings; // Log verbose messages about transactions
|
||||||
bool txn_wait; // Always wait for the timeout before applying
|
bool txn_wait; // Always wait for the timeout before applying
|
||||||
|
bool noscanout; // Disable direct scan-out
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
DAMAGE_DEFAULT, // Default behaviour
|
DAMAGE_DEFAULT, // Default behaviour
|
||||||
|
|
@ -116,6 +140,8 @@ void server_fini(struct sway_server *server);
|
||||||
bool server_start(struct sway_server *server);
|
bool server_start(struct sway_server *server);
|
||||||
void server_run(struct sway_server *server);
|
void server_run(struct sway_server *server);
|
||||||
|
|
||||||
|
void restore_nofile_limit(void);
|
||||||
|
|
||||||
void handle_compositor_new_surface(struct wl_listener *listener, void *data);
|
void handle_compositor_new_surface(struct wl_listener *listener, void *data);
|
||||||
void handle_new_output(struct wl_listener *listener, void *data);
|
void handle_new_output(struct wl_listener *listener, void *data);
|
||||||
|
|
||||||
|
|
@ -128,5 +154,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data);
|
||||||
void handle_server_decoration(struct wl_listener *listener, void *data);
|
void handle_server_decoration(struct wl_listener *listener, void *data);
|
||||||
void handle_xdg_decoration(struct wl_listener *listener, void *data);
|
void handle_xdg_decoration(struct wl_listener *listener, void *data);
|
||||||
void handle_pointer_constraint(struct wl_listener *listener, void *data);
|
void handle_pointer_constraint(struct wl_listener *listener, void *data);
|
||||||
|
void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
|
||||||
|
void *data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#define _SWAY_CONTAINER_H
|
#define _SWAY_CONTAINER_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <wlr/types/wlr_box.h>
|
|
||||||
#include <wlr/types/wlr_surface.h>
|
#include <wlr/types/wlr_surface.h>
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "sway/tree/node.h"
|
#include "sway/tree/node.h"
|
||||||
|
|
@ -46,9 +45,9 @@ struct sway_container_state {
|
||||||
|
|
||||||
enum sway_fullscreen_mode fullscreen_mode;
|
enum sway_fullscreen_mode fullscreen_mode;
|
||||||
|
|
||||||
struct sway_workspace *workspace;
|
struct sway_workspace *workspace; // NULL when hidden in the scratchpad
|
||||||
struct sway_container *parent;
|
struct sway_container *parent; // NULL if container in root of workspace
|
||||||
list_t *children;
|
list_t *children; // struct sway_container
|
||||||
|
|
||||||
struct sway_container *focused_inactive_child;
|
struct sway_container *focused_inactive_child;
|
||||||
bool focused;
|
bool focused;
|
||||||
|
|
@ -60,6 +59,7 @@ struct sway_container_state {
|
||||||
bool border_left;
|
bool border_left;
|
||||||
bool border_right;
|
bool border_right;
|
||||||
|
|
||||||
|
// These are in layout coordinates.
|
||||||
double content_x, content_y;
|
double content_x, content_y;
|
||||||
double content_width, content_height;
|
double content_width, content_height;
|
||||||
};
|
};
|
||||||
|
|
@ -68,26 +68,29 @@ struct sway_container {
|
||||||
struct sway_node node;
|
struct sway_node node;
|
||||||
struct sway_view *view;
|
struct sway_view *view;
|
||||||
|
|
||||||
// The pending state is the main container properties, and the current state is in the below struct.
|
|
||||||
// This means most places of the code can refer to the main variables (pending state) and it'll just work.
|
|
||||||
struct sway_container_state current;
|
struct sway_container_state current;
|
||||||
|
struct sway_container_state pending;
|
||||||
|
|
||||||
char *title; // The view's title (unformatted)
|
char *title; // The view's title (unformatted)
|
||||||
char *formatted_title; // The title displayed in the title bar
|
char *formatted_title; // The title displayed in the title bar
|
||||||
|
|
||||||
enum sway_container_layout layout;
|
|
||||||
enum sway_container_layout prev_split_layout;
|
enum sway_container_layout prev_split_layout;
|
||||||
|
|
||||||
|
// Whether stickiness has been enabled on this container. Use
|
||||||
|
// `container_is_sticky_[or_child]` rather than accessing this field
|
||||||
|
// directly; it'll also check that the container is floating.
|
||||||
bool is_sticky;
|
bool is_sticky;
|
||||||
|
|
||||||
// For C_ROOT, this has no meaning
|
// For C_ROOT, this has no meaning
|
||||||
// For other types, this is the position in layout coordinates
|
// For other types, this is the position in layout coordinates
|
||||||
// Includes borders
|
// Includes borders
|
||||||
double x, y;
|
|
||||||
double width, height;
|
|
||||||
double saved_x, saved_y;
|
double saved_x, saved_y;
|
||||||
double saved_width, saved_height;
|
double saved_width, saved_height;
|
||||||
|
|
||||||
|
// Used when the view changes to CSD unexpectedly. This will be a non-B_CSD
|
||||||
|
// border which we use to restore when the view returns to SSD.
|
||||||
|
enum sway_container_border saved_border;
|
||||||
|
|
||||||
// The share of the space of parent container this container occupies
|
// The share of the space of parent container this container occupies
|
||||||
double width_fraction;
|
double width_fraction;
|
||||||
double height_fraction;
|
double height_fraction;
|
||||||
|
|
@ -97,33 +100,11 @@ struct sway_container {
|
||||||
double child_total_width;
|
double child_total_width;
|
||||||
double child_total_height;
|
double child_total_height;
|
||||||
|
|
||||||
// These are in layout coordinates.
|
|
||||||
double content_x, content_y;
|
|
||||||
int content_width, content_height;
|
|
||||||
|
|
||||||
// In most cases this is the same as the content x and y, but if the view
|
// In most cases this is the same as the content x and y, but if the view
|
||||||
// refuses to resize to the content dimensions then it can be smaller.
|
// refuses to resize to the content dimensions then it can be smaller.
|
||||||
// These are in layout coordinates.
|
// These are in layout coordinates.
|
||||||
double surface_x, surface_y;
|
double surface_x, surface_y;
|
||||||
|
|
||||||
enum sway_fullscreen_mode fullscreen_mode;
|
|
||||||
|
|
||||||
enum sway_container_border border;
|
|
||||||
|
|
||||||
// Used when the view changes to CSD unexpectedly. This will be a non-B_CSD
|
|
||||||
// border which we use to restore when the view returns to SSD.
|
|
||||||
enum sway_container_border saved_border;
|
|
||||||
|
|
||||||
int border_thickness;
|
|
||||||
bool border_top;
|
|
||||||
bool border_bottom;
|
|
||||||
bool border_left;
|
|
||||||
bool border_right;
|
|
||||||
|
|
||||||
struct sway_workspace *workspace; // NULL when hidden in the scratchpad
|
|
||||||
struct sway_container *parent; // NULL if container in root of workspace
|
|
||||||
list_t *children; // struct sway_container
|
|
||||||
|
|
||||||
// Outputs currently being intersected
|
// Outputs currently being intersected
|
||||||
list_t *outputs; // struct sway_output
|
list_t *outputs; // struct sway_output
|
||||||
|
|
||||||
|
|
@ -138,8 +119,6 @@ struct sway_container {
|
||||||
struct wlr_texture *title_focused_inactive;
|
struct wlr_texture *title_focused_inactive;
|
||||||
struct wlr_texture *title_unfocused;
|
struct wlr_texture *title_unfocused;
|
||||||
struct wlr_texture *title_urgent;
|
struct wlr_texture *title_urgent;
|
||||||
size_t title_height;
|
|
||||||
size_t title_baseline;
|
|
||||||
|
|
||||||
list_t *marks; // char *
|
list_t *marks; // char *
|
||||||
struct wlr_texture *marks_focused;
|
struct wlr_texture *marks_focused;
|
||||||
|
|
@ -181,6 +160,11 @@ struct sway_container *tiling_container_at(
|
||||||
void container_for_each_child(struct sway_container *container,
|
void container_for_each_child(struct sway_container *container,
|
||||||
void (*f)(struct sway_container *container, void *data), void *data);
|
void (*f)(struct sway_container *container, void *data), void *data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the fullscreen container obstructing this container if it exists.
|
||||||
|
*/
|
||||||
|
struct sway_container *container_obstructing_fullscreen_container(struct sway_container *container);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the given container is an ancestor of this container.
|
* Returns true if the given container is an ancestor of this container.
|
||||||
*/
|
*/
|
||||||
|
|
@ -197,11 +181,6 @@ struct sway_container *container_flatten(struct sway_container *container);
|
||||||
|
|
||||||
void container_update_title_textures(struct sway_container *container);
|
void container_update_title_textures(struct sway_container *container);
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate the container's title_height property.
|
|
||||||
*/
|
|
||||||
void container_calculate_title_height(struct sway_container *container);
|
|
||||||
|
|
||||||
size_t container_build_representation(enum sway_container_layout layout,
|
size_t container_build_representation(enum sway_container_layout layout,
|
||||||
list_t *children, char *buffer);
|
list_t *children, char *buffer);
|
||||||
|
|
||||||
|
|
@ -228,9 +207,16 @@ void container_set_geometry_from_content(struct sway_container *con);
|
||||||
/**
|
/**
|
||||||
* Determine if the given container is itself floating.
|
* Determine if the given container is itself floating.
|
||||||
* This will return false for any descendants of a floating container.
|
* This will return false for any descendants of a floating container.
|
||||||
|
*
|
||||||
|
* Uses pending container state.
|
||||||
*/
|
*/
|
||||||
bool container_is_floating(struct sway_container *container);
|
bool container_is_floating(struct sway_container *container);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Same as above, but for current container state.
|
||||||
|
*/
|
||||||
|
bool container_is_current_floating(struct sway_container *container);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a container's box in layout coordinates.
|
* Get a container's box in layout coordinates.
|
||||||
*/
|
*/
|
||||||
|
|
@ -296,6 +282,7 @@ bool container_is_fullscreen_or_child(struct sway_container *container);
|
||||||
/**
|
/**
|
||||||
* Return the output which will be used for scale purposes.
|
* Return the output which will be used for scale purposes.
|
||||||
* This is the most recently entered output.
|
* This is the most recently entered output.
|
||||||
|
* If the container is not on any output, return NULL.
|
||||||
*/
|
*/
|
||||||
struct sway_output *container_get_effective_output(struct sway_container *con);
|
struct sway_output *container_get_effective_output(struct sway_container *con);
|
||||||
|
|
||||||
|
|
@ -367,4 +354,21 @@ bool container_is_scratchpad_hidden(struct sway_container *con);
|
||||||
|
|
||||||
bool container_is_scratchpad_hidden_or_child(struct sway_container *con);
|
bool container_is_scratchpad_hidden_or_child(struct sway_container *con);
|
||||||
|
|
||||||
|
bool container_is_sticky(struct sway_container *con);
|
||||||
|
|
||||||
|
bool container_is_sticky_or_child(struct sway_container *con);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will destroy pairs of redundant H/V splits
|
||||||
|
* e.g. H[V[H[app app]] app] -> H[app app app]
|
||||||
|
* The middle "V[H[" are eliminated by a call to container_squash
|
||||||
|
* on the V[ con. It's grandchildren are added to it's parent.
|
||||||
|
*
|
||||||
|
* This function is roughly equivalent to i3's tree_flatten here:
|
||||||
|
* https://github.com/i3/i3/blob/1f0c628cde40cf87371481041b7197344e0417c6/src/tree.c#L651
|
||||||
|
*
|
||||||
|
* Returns the number of new containers added to the parent
|
||||||
|
*/
|
||||||
|
int container_squash(struct sway_container *con);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ struct sway_view_impl {
|
||||||
bool (*wants_floating)(struct sway_view *view);
|
bool (*wants_floating)(struct sway_view *view);
|
||||||
void (*for_each_surface)(struct sway_view *view,
|
void (*for_each_surface)(struct sway_view *view,
|
||||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||||
void (*for_each_popup)(struct sway_view *view,
|
void (*for_each_popup_surface)(struct sway_view *view,
|
||||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||||
bool (*is_transient_for)(struct sway_view *child,
|
bool (*is_transient_for)(struct sway_view *child,
|
||||||
struct sway_view *ancestor);
|
struct sway_view *ancestor);
|
||||||
|
|
@ -99,7 +99,9 @@ struct sway_view {
|
||||||
|
|
||||||
struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel;
|
struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel;
|
||||||
struct wl_listener foreign_activate_request;
|
struct wl_listener foreign_activate_request;
|
||||||
|
struct wl_listener foreign_fullscreen_request;
|
||||||
struct wl_listener foreign_close_request;
|
struct wl_listener foreign_close_request;
|
||||||
|
struct wl_listener foreign_destroy;
|
||||||
|
|
||||||
bool destroying;
|
bool destroying;
|
||||||
|
|
||||||
|
|
@ -110,7 +112,6 @@ struct sway_view {
|
||||||
#if HAVE_XWAYLAND
|
#if HAVE_XWAYLAND
|
||||||
struct wlr_xwayland_surface *wlr_xwayland_surface;
|
struct wlr_xwayland_surface *wlr_xwayland_surface;
|
||||||
#endif
|
#endif
|
||||||
struct wlr_wl_shell_surface *wlr_wl_shell_surface;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
@ -130,7 +131,6 @@ struct sway_xdg_shell_view {
|
||||||
struct wl_listener commit;
|
struct wl_listener commit;
|
||||||
struct wl_listener request_move;
|
struct wl_listener request_move;
|
||||||
struct wl_listener request_resize;
|
struct wl_listener request_resize;
|
||||||
struct wl_listener request_maximize;
|
|
||||||
struct wl_listener request_fullscreen;
|
struct wl_listener request_fullscreen;
|
||||||
struct wl_listener set_title;
|
struct wl_listener set_title;
|
||||||
struct wl_listener set_app_id;
|
struct wl_listener set_app_id;
|
||||||
|
|
@ -160,6 +160,7 @@ struct sway_xwayland_view {
|
||||||
struct wl_listener map;
|
struct wl_listener map;
|
||||||
struct wl_listener unmap;
|
struct wl_listener unmap;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
|
struct wl_listener override_redirect;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sway_xwayland_unmanaged {
|
struct sway_xwayland_unmanaged {
|
||||||
|
|
@ -171,15 +172,17 @@ struct sway_xwayland_unmanaged {
|
||||||
struct wl_listener request_configure;
|
struct wl_listener request_configure;
|
||||||
struct wl_listener request_fullscreen;
|
struct wl_listener request_fullscreen;
|
||||||
struct wl_listener commit;
|
struct wl_listener commit;
|
||||||
|
struct wl_listener set_geometry;
|
||||||
struct wl_listener map;
|
struct wl_listener map;
|
||||||
struct wl_listener unmap;
|
struct wl_listener unmap;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
|
struct wl_listener override_redirect;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
struct sway_view_child;
|
struct sway_view_child;
|
||||||
|
|
||||||
struct sway_view_child_impl {
|
struct sway_view_child_impl {
|
||||||
void (*get_root_coords)(struct sway_view_child *child, int *sx, int *sy);
|
void (*get_view_coords)(struct sway_view_child *child, int *sx, int *sy);
|
||||||
void (*destroy)(struct sway_view_child *child);
|
void (*destroy)(struct sway_view_child *child);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -292,9 +295,9 @@ void view_for_each_surface(struct sway_view *view,
|
||||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterate all popups recursively.
|
* Iterate all popup surfaces of a view.
|
||||||
*/
|
*/
|
||||||
void view_for_each_popup(struct sway_view *view,
|
void view_for_each_popup_surface(struct sway_view *view,
|
||||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||||
|
|
||||||
// view implementation
|
// view implementation
|
||||||
|
|
@ -306,12 +309,22 @@ void view_destroy(struct sway_view *view);
|
||||||
|
|
||||||
void view_begin_destroy(struct sway_view *view);
|
void view_begin_destroy(struct sway_view *view);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map a view, ie. make it visible in the tree.
|
||||||
|
*
|
||||||
|
* `fullscreen` should be set to true (and optionally `fullscreen_output`
|
||||||
|
* should be populated) if the view should be made fullscreen immediately.
|
||||||
|
*
|
||||||
|
* `decoration` should be set to true if the client prefers CSD. The client's
|
||||||
|
* preference may be ignored.
|
||||||
|
*/
|
||||||
void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
|
void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
|
||||||
bool fullscreen, struct wlr_output *fullscreen_output, bool decoration);
|
bool fullscreen, struct wlr_output *fullscreen_output, bool decoration);
|
||||||
|
|
||||||
void view_unmap(struct sway_view *view);
|
void view_unmap(struct sway_view *view);
|
||||||
|
|
||||||
void view_update_size(struct sway_view *view, int width, int height);
|
void view_update_size(struct sway_view *view);
|
||||||
|
void view_center_surface(struct sway_view *view);
|
||||||
|
|
||||||
void view_child_init(struct sway_view_child *child,
|
void view_child_init(struct sway_view_child *child,
|
||||||
const struct sway_view_child_impl *impl, struct sway_view *view,
|
const struct sway_view_child_impl *impl, struct sway_view *view,
|
||||||
|
|
|
||||||
|
|
@ -63,20 +63,20 @@ void workspace_consider_destroy(struct sway_workspace *ws);
|
||||||
|
|
||||||
char *workspace_next_name(const char *output_name);
|
char *workspace_next_name(const char *output_name);
|
||||||
|
|
||||||
bool workspace_switch(struct sway_workspace *workspace,
|
struct sway_workspace *workspace_auto_back_and_forth(
|
||||||
bool no_auto_back_and_forth);
|
struct sway_workspace *workspace);
|
||||||
|
|
||||||
|
bool workspace_switch(struct sway_workspace *workspace);
|
||||||
|
|
||||||
struct sway_workspace *workspace_by_number(const char* name);
|
struct sway_workspace *workspace_by_number(const char* name);
|
||||||
|
|
||||||
struct sway_workspace *workspace_by_name(const char*);
|
struct sway_workspace *workspace_by_name(const char*);
|
||||||
|
|
||||||
struct sway_workspace *workspace_output_next(
|
struct sway_workspace *workspace_output_next(struct sway_workspace *current);
|
||||||
struct sway_workspace *current, bool create);
|
|
||||||
|
|
||||||
struct sway_workspace *workspace_next(struct sway_workspace *current);
|
struct sway_workspace *workspace_next(struct sway_workspace *current);
|
||||||
|
|
||||||
struct sway_workspace *workspace_output_prev(
|
struct sway_workspace *workspace_output_prev(struct sway_workspace *current);
|
||||||
struct sway_workspace *current, bool create);
|
|
||||||
|
|
||||||
struct sway_workspace *workspace_prev(struct sway_workspace *current);
|
struct sway_workspace *workspace_prev(struct sway_workspace *current);
|
||||||
|
|
||||||
|
|
@ -113,13 +113,20 @@ void workspace_unwrap_children(struct sway_workspace *ws,
|
||||||
|
|
||||||
void workspace_detach(struct sway_workspace *workspace);
|
void workspace_detach(struct sway_workspace *workspace);
|
||||||
|
|
||||||
void workspace_add_tiling(struct sway_workspace *workspace,
|
struct sway_container *workspace_add_tiling(struct sway_workspace *workspace,
|
||||||
struct sway_container *con);
|
struct sway_container *con);
|
||||||
|
|
||||||
void workspace_add_floating(struct sway_workspace *workspace,
|
void workspace_add_floating(struct sway_workspace *workspace,
|
||||||
struct sway_container *con);
|
struct sway_container *con);
|
||||||
|
|
||||||
void workspace_insert_tiling(struct sway_workspace *workspace,
|
/**
|
||||||
|
* Adds a tiling container to the workspace without considering
|
||||||
|
* the workspace_layout, so the con will not be split.
|
||||||
|
*/
|
||||||
|
void workspace_insert_tiling_direct(struct sway_workspace *workspace,
|
||||||
|
struct sway_container *con, int index);
|
||||||
|
|
||||||
|
struct sway_container *workspace_insert_tiling(struct sway_workspace *workspace,
|
||||||
struct sway_container *con, int index);
|
struct sway_container *con, int index);
|
||||||
|
|
||||||
void workspace_remove_gaps(struct sway_workspace *ws);
|
void workspace_remove_gaps(struct sway_workspace *ws);
|
||||||
|
|
@ -135,4 +142,14 @@ void workspace_get_box(struct sway_workspace *workspace, struct wlr_box *box);
|
||||||
|
|
||||||
size_t workspace_num_tiling_views(struct sway_workspace *ws);
|
size_t workspace_num_tiling_views(struct sway_workspace *ws);
|
||||||
|
|
||||||
|
size_t workspace_num_sticky_containers(struct sway_workspace *ws);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* workspace_squash is container_flatten in the reverse
|
||||||
|
* direction. Instead of eliminating redundant splits that are
|
||||||
|
* parents of the target container, it eliminates pairs of
|
||||||
|
* redundant H/V splits that are children of the workspace.
|
||||||
|
*/
|
||||||
|
void workspace_squash(struct sway_workspace *workspace);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ struct swaybar_config {
|
||||||
bool binding_mode_indicator;
|
bool binding_mode_indicator;
|
||||||
bool wrap_scroll;
|
bool wrap_scroll;
|
||||||
bool workspace_buttons;
|
bool workspace_buttons;
|
||||||
|
uint32_t workspace_min_width;
|
||||||
list_t *bindings;
|
list_t *bindings;
|
||||||
struct wl_list outputs; // config_output::link
|
struct wl_list outputs; // config_output::link
|
||||||
int height;
|
int height;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ struct i3bar_block {
|
||||||
// Airblader features
|
// Airblader features
|
||||||
uint32_t background;
|
uint32_t background;
|
||||||
uint32_t border;
|
uint32_t border;
|
||||||
|
bool border_set;
|
||||||
int border_top;
|
int border_top;
|
||||||
int border_bottom;
|
int border_bottom;
|
||||||
int border_left;
|
int border_left;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,12 @@
|
||||||
#define _SWAYBAR_TRAY_TRAY_H
|
#define _SWAYBAR_TRAY_TRAY_H
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#ifdef HAVE_SYSTEMD
|
#if HAVE_LIBSYSTEMD
|
||||||
#include <systemd/sd-bus.h>
|
#include <systemd/sd-bus.h>
|
||||||
#elif HAVE_ELOGIND
|
#elif HAVE_LIBELOGIND
|
||||||
#include <elogind/sd-bus.h>
|
#include <elogind/sd-bus.h>
|
||||||
|
#elif HAVE_BASU
|
||||||
|
#include <basu/sd-bus.h>
|
||||||
#endif
|
#endif
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,12 @@ struct swaynag_type {
|
||||||
char *font;
|
char *font;
|
||||||
char *output;
|
char *output;
|
||||||
uint32_t anchors;
|
uint32_t anchors;
|
||||||
|
int32_t layer; // enum zwlr_layer_shell_v1_layer or -1 if unset
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
|
uint32_t button_text;
|
||||||
uint32_t button_background;
|
uint32_t button_background;
|
||||||
|
uint32_t details_background;
|
||||||
uint32_t background;
|
uint32_t background;
|
||||||
uint32_t text;
|
uint32_t text;
|
||||||
uint32_t border;
|
uint32_t border;
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,6 @@ enum movement_unit parse_movement_unit(const char *unit);
|
||||||
int parse_movement_amount(int argc, char **argv,
|
int parse_movement_amount(int argc, char **argv,
|
||||||
struct movement_amount *amount);
|
struct movement_amount *amount);
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current time, in milliseconds.
|
|
||||||
*/
|
|
||||||
|
|
||||||
uint32_t get_current_time_msec(void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrap i into the range [0, max]
|
* Wrap i into the range [0, max]
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
156
meson.build
156
meson.build
|
|
@ -1,9 +1,9 @@
|
||||||
project(
|
project(
|
||||||
'sway',
|
'sway',
|
||||||
'c',
|
'c',
|
||||||
version: '1.5', #release_version
|
version: '1.6',
|
||||||
license: 'MIT',
|
license: 'MIT',
|
||||||
meson_version: '>=0.53.0',
|
meson_version: '>=0.59.0',
|
||||||
default_options: [
|
default_options: [
|
||||||
'c_std=c11',
|
'c_std=c11',
|
||||||
'warning_level=2',
|
'warning_level=2',
|
||||||
|
|
@ -35,32 +35,33 @@ if is_freebsd
|
||||||
add_project_arguments('-D_C11_SOURCE', language: 'c')
|
add_project_arguments('-D_C11_SOURCE', language: 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
jsonc = dependency('json-c', version: '>=0.13')
|
jsonc = dependency('json-c', version: '>=0.13')
|
||||||
pcre = dependency('libpcre')
|
pcre = dependency('libpcre')
|
||||||
wayland_server = dependency('wayland-server')
|
wayland_server = dependency('wayland-server')
|
||||||
wayland_client = dependency('wayland-client')
|
wayland_client = dependency('wayland-client')
|
||||||
wayland_cursor = dependency('wayland-cursor')
|
wayland_cursor = dependency('wayland-cursor')
|
||||||
wayland_egl = dependency('wayland-egl')
|
wayland_egl = dependency('wayland-egl')
|
||||||
wayland_protos = dependency('wayland-protocols', version: '>=1.14')
|
wayland_protos = dependency('wayland-protocols', version: '>=1.14')
|
||||||
xkbcommon = dependency('xkbcommon')
|
xkbcommon = dependency('xkbcommon')
|
||||||
cairo = dependency('cairo')
|
cairo = dependency('cairo')
|
||||||
pango = dependency('pango')
|
pango = dependency('pango')
|
||||||
pangocairo = dependency('pangocairo')
|
pangocairo = dependency('pangocairo')
|
||||||
gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
|
gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
|
||||||
pixman = dependency('pixman-1')
|
pixman = dependency('pixman-1')
|
||||||
glesv2 = dependency('glesv2')
|
glesv2 = dependency('glesv2')
|
||||||
libevdev = dependency('libevdev')
|
libevdev = dependency('libevdev')
|
||||||
libinput = dependency('libinput', version: '>=1.6.0')
|
libinput = dependency('libinput', version: '>=1.6.0')
|
||||||
systemd = dependency('libsystemd', version: '>=239', required: false)
|
xcb = dependency('xcb', required: get_option('xwayland'))
|
||||||
elogind = dependency('libelogind', version: '>=239', required: false)
|
drm_full = dependency('libdrm') # only needed for drm_fourcc.h
|
||||||
xcb = dependency('xcb', required: get_option('xwayland'))
|
drm = drm_full.partial_dependency(compile_args: true, includes: true)
|
||||||
bash_comp = dependency('bash-completion', required: false)
|
libudev = dependency('libudev')
|
||||||
fish_comp = dependency('fish', required: false)
|
bash_comp = dependency('bash-completion', required: false)
|
||||||
math = cc.find_library('m')
|
fish_comp = dependency('fish', required: false)
|
||||||
rt = cc.find_library('rt')
|
math = cc.find_library('m')
|
||||||
|
rt = cc.find_library('rt')
|
||||||
|
|
||||||
# Try first to find wlroots as a subproject, then as a system dependency
|
# Try first to find wlroots as a subproject, then as a system dependency
|
||||||
wlroots_version = ['>=0.11.0', '<0.12.0']
|
wlroots_version = ['>=0.15.0', '<0.16.0']
|
||||||
wlroots_proj = subproject(
|
wlroots_proj = subproject(
|
||||||
'wlroots',
|
'wlroots',
|
||||||
default_options: ['examples=false'],
|
default_options: ['examples=false'],
|
||||||
|
|
@ -69,21 +70,50 @@ wlroots_proj = subproject(
|
||||||
)
|
)
|
||||||
if wlroots_proj.found()
|
if wlroots_proj.found()
|
||||||
wlroots = wlroots_proj.get_variable('wlroots')
|
wlroots = wlroots_proj.get_variable('wlroots')
|
||||||
wlroots_conf = wlroots_proj.get_variable('conf_data')
|
|
||||||
wlroots_has_xwayland = wlroots_conf.get('WLR_HAS_XWAYLAND') == 1
|
|
||||||
else
|
else
|
||||||
wlroots = dependency('wlroots', version: wlroots_version)
|
wlroots = dependency('wlroots', version: wlroots_version)
|
||||||
wlroots_has_xwayland = cc.get_define('WLR_HAS_XWAYLAND', prefix: '#include <wlr/config.h>', dependencies: wlroots) == '1'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('xwayland').enabled() and not wlroots_has_xwayland
|
wlroots_features = {
|
||||||
|
'xwayland': false,
|
||||||
|
}
|
||||||
|
foreach name, _ : wlroots_features
|
||||||
|
var_name = 'have_' + name.underscorify()
|
||||||
|
have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true'
|
||||||
|
wlroots_features += { name: have }
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
if get_option('xwayland').enabled() and not wlroots_features['xwayland']
|
||||||
error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
|
error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
|
||||||
endif
|
endif
|
||||||
have_xwayland = xcb.found() and wlroots_has_xwayland
|
have_xwayland = xcb.found() and wlroots_features['xwayland']
|
||||||
|
|
||||||
tray_deps_found = systemd.found() or elogind.found()
|
if get_option('sd-bus-provider') == 'auto'
|
||||||
|
if not get_option('tray').disabled()
|
||||||
|
assert(get_option('auto_features').auto(), 'sd-bus-provider must not be set to auto since auto_features != auto')
|
||||||
|
endif
|
||||||
|
sdbus = dependency('libsystemd',
|
||||||
|
required: false,
|
||||||
|
version: '>=239',
|
||||||
|
not_found_message: 'libsystemd not found, trying libelogind',
|
||||||
|
)
|
||||||
|
if not sdbus.found()
|
||||||
|
sdbus = dependency('libelogind',
|
||||||
|
required: false,
|
||||||
|
version: '>=239',
|
||||||
|
not_found_message: 'libelogind not found, trying basu',
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
if not sdbus.found()
|
||||||
|
sdbus = dependency('basu', required: false)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray'))
|
||||||
|
endif
|
||||||
|
|
||||||
|
tray_deps_found = sdbus.found()
|
||||||
if get_option('tray').enabled() and not tray_deps_found
|
if get_option('tray').enabled() and not tray_deps_found
|
||||||
error('Building with -Dtray=enabled, but libsystemd and libelogind have not been not found')
|
error('Building with -Dtray=enabled, but sd-bus has not been not found')
|
||||||
endif
|
endif
|
||||||
have_tray = (not get_option('tray').disabled()) and tray_deps_found
|
have_tray = (not get_option('tray').disabled()) and tray_deps_found
|
||||||
|
|
||||||
|
|
@ -91,14 +121,14 @@ conf_data = configuration_data()
|
||||||
|
|
||||||
conf_data.set10('HAVE_XWAYLAND', have_xwayland)
|
conf_data.set10('HAVE_XWAYLAND', have_xwayland)
|
||||||
conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found())
|
conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found())
|
||||||
conf_data.set10('HAVE_SYSTEMD', systemd.found())
|
conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd')
|
||||||
conf_data.set10('HAVE_ELOGIND', elogind.found())
|
conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind')
|
||||||
|
conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu')
|
||||||
conf_data.set10('HAVE_TRAY', have_tray)
|
conf_data.set10('HAVE_TRAY', have_tray)
|
||||||
|
|
||||||
scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages'))
|
scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages'))
|
||||||
if scdoc.found()
|
if scdoc.found()
|
||||||
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
|
scdoc_prog = find_program(scdoc.get_variable(pkgconfig: 'scdoc'), native: true)
|
||||||
sh = find_program('sh', native: true)
|
|
||||||
mandir = get_option('mandir')
|
mandir = get_option('mandir')
|
||||||
man_files = [
|
man_files = [
|
||||||
'sway/sway.1.scd',
|
'sway/sway.1.scd',
|
||||||
|
|
@ -109,9 +139,15 @@ if scdoc.found()
|
||||||
'sway/sway-output.5.scd',
|
'sway/sway-output.5.scd',
|
||||||
'swaybar/swaybar-protocol.7.scd',
|
'swaybar/swaybar-protocol.7.scd',
|
||||||
'swaymsg/swaymsg.1.scd',
|
'swaymsg/swaymsg.1.scd',
|
||||||
'swaynag/swaynag.1.scd',
|
|
||||||
'swaynag/swaynag.5.scd',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if get_option('swaynag')
|
||||||
|
man_files += [
|
||||||
|
'swaynag/swaynag.1.scd',
|
||||||
|
'swaynag/swaynag.5.scd',
|
||||||
|
]
|
||||||
|
endif
|
||||||
|
|
||||||
foreach filename : man_files
|
foreach filename : man_files
|
||||||
topic = filename.split('.')[-3].split('/')[-1]
|
topic = filename.split('.')[-3].split('/')[-1]
|
||||||
section = filename.split('.')[-2]
|
section = filename.split('.')[-2]
|
||||||
|
|
@ -121,10 +157,10 @@ if scdoc.found()
|
||||||
output,
|
output,
|
||||||
input: filename,
|
input: filename,
|
||||||
output: output,
|
output: output,
|
||||||
command: [
|
command: scdoc_prog,
|
||||||
sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
|
|
||||||
],
|
|
||||||
install: true,
|
install: true,
|
||||||
|
feed: true,
|
||||||
|
capture: true,
|
||||||
install_dir: '@0@/man@1@'.format(mandir, section)
|
install_dir: '@0@/man@1@'.format(mandir, section)
|
||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
@ -149,7 +185,7 @@ add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
|
||||||
|
|
||||||
# Compute the relative path used by compiler invocations.
|
# Compute the relative path used by compiler invocations.
|
||||||
source_root = meson.current_source_dir().split('/')
|
source_root = meson.current_source_dir().split('/')
|
||||||
build_root = meson.build_root().split('/')
|
build_root = meson.global_build_root().split('/')
|
||||||
relative_dir_parts = []
|
relative_dir_parts = []
|
||||||
i = 0
|
i = 0
|
||||||
in_prefix = true
|
in_prefix = true
|
||||||
|
|
@ -193,9 +229,15 @@ subdir('common')
|
||||||
subdir('sway')
|
subdir('sway')
|
||||||
subdir('swaymsg')
|
subdir('swaymsg')
|
||||||
|
|
||||||
subdir('client')
|
if get_option('swaybar') or get_option('swaynag')
|
||||||
subdir('swaybar')
|
subdir('client')
|
||||||
subdir('swaynag')
|
endif
|
||||||
|
if get_option('swaybar')
|
||||||
|
subdir('swaybar')
|
||||||
|
endif
|
||||||
|
if get_option('swaynag')
|
||||||
|
subdir('swaynag')
|
||||||
|
endif
|
||||||
|
|
||||||
config = configuration_data()
|
config = configuration_data()
|
||||||
config.set('datadir', join_paths(prefix, datadir))
|
config.set('datadir', join_paths(prefix, datadir))
|
||||||
|
|
@ -243,13 +285,17 @@ endif
|
||||||
if get_option('bash-completions')
|
if get_option('bash-completions')
|
||||||
bash_files = files(
|
bash_files = files(
|
||||||
'completions/bash/sway',
|
'completions/bash/sway',
|
||||||
'completions/bash/swaybar',
|
|
||||||
'completions/bash/swaymsg',
|
'completions/bash/swaymsg',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if get_option('swaybar')
|
||||||
|
bash_files += files('completions/bash/swaybar')
|
||||||
|
endif
|
||||||
|
|
||||||
if bash_comp.found()
|
if bash_comp.found()
|
||||||
bash_install_dir = bash_comp.get_pkgconfig_variable(
|
bash_install_dir = bash_comp.get_variable(
|
||||||
'completionsdir',
|
pkgconfig: 'completionsdir',
|
||||||
define_variable: ['datadir', datadir]
|
pkgconfig_define: ['datadir', datadir]
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
|
bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
|
||||||
|
|
@ -262,12 +308,16 @@ if get_option('fish-completions')
|
||||||
fish_files = files(
|
fish_files = files(
|
||||||
'completions/fish/sway.fish',
|
'completions/fish/sway.fish',
|
||||||
'completions/fish/swaymsg.fish',
|
'completions/fish/swaymsg.fish',
|
||||||
'completions/fish/swaynag.fish',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if get_option('swaynag')
|
||||||
|
fish_files += files('completions/fish/swaynag.fish')
|
||||||
|
endif
|
||||||
|
|
||||||
if fish_comp.found()
|
if fish_comp.found()
|
||||||
fish_install_dir = fish_comp.get_pkgconfig_variable(
|
fish_install_dir = fish_comp.get_variable(
|
||||||
'completionsdir',
|
pkgconfig: 'completionsdir',
|
||||||
define_variable: ['datadir', datadir]
|
pkgconfig_define: ['datadir', datadir]
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d')
|
fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d')
|
||||||
|
|
@ -279,13 +329,7 @@ endif
|
||||||
summary({
|
summary({
|
||||||
'xwayland': have_xwayland,
|
'xwayland': have_xwayland,
|
||||||
'gdk-pixbuf': gdk_pixbuf.found(),
|
'gdk-pixbuf': gdk_pixbuf.found(),
|
||||||
'systemd': systemd.found(),
|
|
||||||
'elogind': elogind.found(),
|
|
||||||
'tray': have_tray,
|
'tray': have_tray,
|
||||||
'man-pages': scdoc.found(),
|
'man-pages': scdoc.found(),
|
||||||
}, bool_yn: true)
|
}, bool_yn: true)
|
||||||
|
|
||||||
if not systemd.found() and not elogind.found()
|
|
||||||
warning('The sway binary must be setuid when compiled without (e)logind')
|
|
||||||
warning('You must do this manually post-install: chmod a+s /path/to/sway')
|
|
||||||
endif
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,10 @@ option('default-wallpaper', type: 'boolean', value: true, description: 'Install
|
||||||
option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
|
option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
|
||||||
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
|
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
|
||||||
option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.')
|
option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.')
|
||||||
|
option('swaybar', type: 'boolean', value: true, description: 'Enable support for swaybar')
|
||||||
|
option('swaynag', type: 'boolean', value: true, description: 'Enable support for swaynag')
|
||||||
option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
|
option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
|
||||||
option('tray', type: 'feature', value: 'auto', description: 'Enable support for swaybar tray')
|
option('tray', type: 'feature', value: 'auto', description: 'Enable support for swaybar tray')
|
||||||
option('gdk-pixbuf', type: 'feature', value: 'auto', description: 'Enable support for more image formats in swaybg')
|
option('gdk-pixbuf', type: 'feature', value: 'auto', description: 'Enable support for more image formats in swaybg')
|
||||||
option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')
|
option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')
|
||||||
|
option('sd-bus-provider', type: 'combo', choices: ['auto', 'libsystemd', 'libelogind', 'basu'], value: 'auto', description: 'Provider of the sd-bus library')
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')
|
wl_protocol_dir = wayland_protos.get_variable('pkgdatadir')
|
||||||
|
|
||||||
wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)
|
wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)
|
||||||
if wayland_scanner_dep.found()
|
if wayland_scanner_dep.found()
|
||||||
wayland_scanner = find_program(
|
wayland_scanner = find_program(
|
||||||
wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'),
|
wayland_scanner_dep.get_variable(pkgconfig: 'wayland_scanner'),
|
||||||
native: true,
|
native: true,
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
THIS SOFTWARE.
|
THIS SOFTWARE.
|
||||||
</copyright>
|
</copyright>
|
||||||
|
|
||||||
<interface name="zwlr_layer_shell_v1" version="3">
|
<interface name="zwlr_layer_shell_v1" version="4">
|
||||||
<description summary="create surfaces that are layers of the desktop">
|
<description summary="create surfaces that are layers of the desktop">
|
||||||
Clients can use this interface to assign the surface_layer role to
|
Clients can use this interface to assign the surface_layer role to
|
||||||
wl_surfaces. Such surfaces are assigned to a "layer" of the output and
|
wl_surfaces. Such surfaces are assigned to a "layer" of the output and
|
||||||
|
|
@ -47,6 +47,12 @@
|
||||||
or manipulate a buffer prior to the first layer_surface.configure call
|
or manipulate a buffer prior to the first layer_surface.configure call
|
||||||
must also be treated as errors.
|
must also be treated as errors.
|
||||||
|
|
||||||
|
After creating a layer_surface object and setting it up, the client
|
||||||
|
must perform an initial commit without any buffer attached.
|
||||||
|
The compositor will reply with a layer_surface.configure event.
|
||||||
|
The client must acknowledge it and is then allowed to attach a buffer
|
||||||
|
to map the surface.
|
||||||
|
|
||||||
You may pass NULL for output to allow the compositor to decide which
|
You may pass NULL for output to allow the compositor to decide which
|
||||||
output to use. Generally this will be the one that the user most
|
output to use. Generally this will be the one that the user most
|
||||||
recently interacted with.
|
recently interacted with.
|
||||||
|
|
@ -94,7 +100,7 @@
|
||||||
</request>
|
</request>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
<interface name="zwlr_layer_surface_v1" version="3">
|
<interface name="zwlr_layer_surface_v1" version="4">
|
||||||
<description summary="layer metadata interface">
|
<description summary="layer metadata interface">
|
||||||
An interface that may be implemented by a wl_surface, for surfaces that
|
An interface that may be implemented by a wl_surface, for surfaces that
|
||||||
are designed to be rendered as a layer of a stacked desktop-like
|
are designed to be rendered as a layer of a stacked desktop-like
|
||||||
|
|
@ -103,6 +109,14 @@
|
||||||
Layer surface state (layer, size, anchor, exclusive zone,
|
Layer surface state (layer, size, anchor, exclusive zone,
|
||||||
margin, interactivity) is double-buffered, and will be applied at the
|
margin, interactivity) is double-buffered, and will be applied at the
|
||||||
time wl_surface.commit of the corresponding wl_surface is called.
|
time wl_surface.commit of the corresponding wl_surface is called.
|
||||||
|
|
||||||
|
Attaching a null buffer to a layer surface unmaps it.
|
||||||
|
|
||||||
|
Unmapping a layer_surface means that the surface cannot be shown by the
|
||||||
|
compositor until it is explicitly mapped again. The layer_surface
|
||||||
|
returns to the state it had right after layer_shell.get_layer_surface.
|
||||||
|
The client can re-map the surface by performing a commit without any
|
||||||
|
buffer attached, waiting for a configure event and handling it as usual.
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<request name="set_size">
|
<request name="set_size">
|
||||||
|
|
@ -189,21 +203,85 @@
|
||||||
<arg name="left" type="int"/>
|
<arg name="left" type="int"/>
|
||||||
</request>
|
</request>
|
||||||
|
|
||||||
|
<enum name="keyboard_interactivity">
|
||||||
|
<description summary="types of keyboard interaction possible for a layer shell surface">
|
||||||
|
Types of keyboard interaction possible for layer shell surfaces. The
|
||||||
|
rationale for this is twofold: (1) some applications are not interested
|
||||||
|
in keyboard events and not allowing them to be focused can improve the
|
||||||
|
desktop experience; (2) some applications will want to take exclusive
|
||||||
|
keyboard focus.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<entry name="none" value="0">
|
||||||
|
<description summary="no keyboard focus is possible">
|
||||||
|
This value indicates that this surface is not interested in keyboard
|
||||||
|
events and the compositor should never assign it the keyboard focus.
|
||||||
|
|
||||||
|
This is the default value, set for newly created layer shell surfaces.
|
||||||
|
|
||||||
|
This is useful for e.g. desktop widgets that display information or
|
||||||
|
only have interaction with non-keyboard input devices.
|
||||||
|
</description>
|
||||||
|
</entry>
|
||||||
|
<entry name="exclusive" value="1">
|
||||||
|
<description summary="request exclusive keyboard focus">
|
||||||
|
Request exclusive keyboard focus if this surface is above the shell surface layer.
|
||||||
|
|
||||||
|
For the top and overlay layers, the seat will always give
|
||||||
|
exclusive keyboard focus to the top-most layer which has keyboard
|
||||||
|
interactivity set to exclusive. If this layer contains multiple
|
||||||
|
surfaces with keyboard interactivity set to exclusive, the compositor
|
||||||
|
determines the one receiving keyboard events in an implementation-
|
||||||
|
defined manner. In this case, no guarantee is made when this surface
|
||||||
|
will receive keyboard focus (if ever).
|
||||||
|
|
||||||
|
For the bottom and background layers, the compositor is allowed to use
|
||||||
|
normal focus semantics.
|
||||||
|
|
||||||
|
This setting is mainly intended for applications that need to ensure
|
||||||
|
they receive all keyboard events, such as a lock screen or a password
|
||||||
|
prompt.
|
||||||
|
</description>
|
||||||
|
</entry>
|
||||||
|
<entry name="on_demand" value="2" since="4">
|
||||||
|
<description summary="request regular keyboard focus semantics">
|
||||||
|
This requests the compositor to allow this surface to be focused and
|
||||||
|
unfocused by the user in an implementation-defined manner. The user
|
||||||
|
should be able to unfocus this surface even regardless of the layer
|
||||||
|
it is on.
|
||||||
|
|
||||||
|
Typically, the compositor will want to use its normal mechanism to
|
||||||
|
manage keyboard focus between layer shell surfaces with this setting
|
||||||
|
and regular toplevels on the desktop layer (e.g. click to focus).
|
||||||
|
Nevertheless, it is possible for a compositor to require a special
|
||||||
|
interaction to focus or unfocus layer shell surfaces (e.g. requiring
|
||||||
|
a click even if focus follows the mouse normally, or providing a
|
||||||
|
keybinding to switch focus between layers).
|
||||||
|
|
||||||
|
This setting is mainly intended for desktop shell components (e.g.
|
||||||
|
panels) that allow keyboard interaction. Using this option can allow
|
||||||
|
implementing a desktop shell that can be fully usable without the
|
||||||
|
mouse.
|
||||||
|
</description>
|
||||||
|
</entry>
|
||||||
|
</enum>
|
||||||
|
|
||||||
<request name="set_keyboard_interactivity">
|
<request name="set_keyboard_interactivity">
|
||||||
<description summary="requests keyboard events">
|
<description summary="requests keyboard events">
|
||||||
Set to 1 to request that the seat send keyboard events to this layer
|
Set how keyboard events are delivered to this surface. By default,
|
||||||
surface. For layers below the shell surface layer, the seat will use
|
layer shell surfaces do not receive keyboard events; this request can
|
||||||
normal focus semantics. For layers above the shell surface layers, the
|
be used to change this.
|
||||||
seat will always give exclusive keyboard focus to the top-most layer
|
|
||||||
which has keyboard interactivity set to true.
|
This setting is inherited by child surfaces set by the get_popup
|
||||||
|
request.
|
||||||
|
|
||||||
Layer surfaces receive pointer, touch, and tablet events normally. If
|
Layer surfaces receive pointer, touch, and tablet events normally. If
|
||||||
you do not want to receive them, set the input region on your surface
|
you do not want to receive them, set the input region on your surface
|
||||||
to an empty region.
|
to an empty region.
|
||||||
|
|
||||||
Events is double-buffered, see wl_surface.commit.
|
Keyboard interactivity is double-buffered, see wl_surface.commit.
|
||||||
</description>
|
</description>
|
||||||
<arg name="keyboard_interactivity" type="uint"/>
|
<arg name="keyboard_interactivity" type="uint" enum="keyboard_interactivity"/>
|
||||||
</request>
|
</request>
|
||||||
|
|
||||||
<request name="get_popup">
|
<request name="get_popup">
|
||||||
|
|
@ -288,6 +366,7 @@
|
||||||
<entry name="invalid_surface_state" value="0" summary="provided surface state is invalid"/>
|
<entry name="invalid_surface_state" value="0" summary="provided surface state is invalid"/>
|
||||||
<entry name="invalid_size" value="1" summary="size is invalid"/>
|
<entry name="invalid_size" value="1" summary="size is invalid"/>
|
||||||
<entry name="invalid_anchor" value="2" summary="anchor bitfield is invalid"/>
|
<entry name="invalid_anchor" value="2" summary="anchor bitfield is invalid"/>
|
||||||
|
<entry name="invalid_keyboard_interactivity" value="3" summary="keyboard interactivity is invalid"/>
|
||||||
</enum>
|
</enum>
|
||||||
|
|
||||||
<enum name="anchor" bitfield="true">
|
<enum name="anchor" bitfield="true">
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ struct cmd_results *checkarg(int argc, const char *name, enum expected_args type
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Keep alphabetized */
|
/* Keep alphabetized */
|
||||||
static struct cmd_handler handlers[] = {
|
static const struct cmd_handler handlers[] = {
|
||||||
{ "assign", cmd_assign },
|
{ "assign", cmd_assign },
|
||||||
{ "bar", cmd_bar },
|
{ "bar", cmd_bar },
|
||||||
{ "bindcode", cmd_bindcode },
|
{ "bindcode", cmd_bindcode },
|
||||||
|
|
@ -98,7 +98,7 @@ static struct cmd_handler handlers[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Config-time only commands. Keep alphabetized */
|
/* Config-time only commands. Keep alphabetized */
|
||||||
static struct cmd_handler config_handlers[] = {
|
static const struct cmd_handler config_handlers[] = {
|
||||||
{ "default_orientation", cmd_default_orientation },
|
{ "default_orientation", cmd_default_orientation },
|
||||||
{ "include", cmd_include },
|
{ "include", cmd_include },
|
||||||
{ "swaybg_command", cmd_swaybg_command },
|
{ "swaybg_command", cmd_swaybg_command },
|
||||||
|
|
@ -108,7 +108,7 @@ static struct cmd_handler config_handlers[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Runtime-only commands. Keep alphabetized */
|
/* Runtime-only commands. Keep alphabetized */
|
||||||
static struct cmd_handler command_handlers[] = {
|
static const struct cmd_handler command_handlers[] = {
|
||||||
{ "border", cmd_border },
|
{ "border", cmd_border },
|
||||||
{ "create_output", cmd_create_output },
|
{ "create_output", cmd_create_output },
|
||||||
{ "exit", cmd_exit },
|
{ "exit", cmd_exit },
|
||||||
|
|
@ -144,22 +144,22 @@ static int handler_compare(const void *_a, const void *_b) {
|
||||||
return strcasecmp(a->command, b->command);
|
return strcasecmp(a->command, b->command);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct cmd_handler *find_handler(char *line, struct cmd_handler *handlers,
|
const struct cmd_handler *find_handler(char *line,
|
||||||
size_t handlers_size) {
|
const struct cmd_handler *handlers, size_t handlers_size) {
|
||||||
if (!handlers || !handlers_size) {
|
if (!handlers || !handlers_size) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
struct cmd_handler query = { .command = line };
|
const struct cmd_handler query = { .command = line };
|
||||||
return bsearch(&query, handlers,
|
return bsearch(&query, handlers,
|
||||||
handlers_size / sizeof(struct cmd_handler),
|
handlers_size / sizeof(struct cmd_handler),
|
||||||
sizeof(struct cmd_handler), handler_compare);
|
sizeof(struct cmd_handler), handler_compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct cmd_handler *find_handler_ex(char *line,
|
static const struct cmd_handler *find_handler_ex(char *line,
|
||||||
struct cmd_handler *config_handlers, size_t config_handlers_size,
|
const struct cmd_handler *config_handlers, size_t config_handlers_size,
|
||||||
struct cmd_handler *command_handlers, size_t command_handlers_size,
|
const struct cmd_handler *command_handlers, size_t command_handlers_size,
|
||||||
struct cmd_handler *handlers, size_t handlers_size) {
|
const struct cmd_handler *handlers, size_t handlers_size) {
|
||||||
struct cmd_handler *handler = NULL;
|
const struct cmd_handler *handler = NULL;
|
||||||
if (config->reading) {
|
if (config->reading) {
|
||||||
handler = find_handler(line, config_handlers, config_handlers_size);
|
handler = find_handler(line, config_handlers, config_handlers_size);
|
||||||
} else if (config->active) {
|
} else if (config->active) {
|
||||||
|
|
@ -168,16 +168,17 @@ static struct cmd_handler *find_handler_ex(char *line,
|
||||||
return handler ? handler : find_handler(line, handlers, handlers_size);
|
return handler ? handler : find_handler(line, handlers, handlers_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct cmd_handler *find_core_handler(char *line) {
|
static const struct cmd_handler *find_core_handler(char *line) {
|
||||||
return find_handler_ex(line, config_handlers, sizeof(config_handlers),
|
return find_handler_ex(line, config_handlers, sizeof(config_handlers),
|
||||||
command_handlers, sizeof(command_handlers),
|
command_handlers, sizeof(command_handlers),
|
||||||
handlers, sizeof(handlers));
|
handlers, sizeof(handlers));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_config_node(struct sway_node *node) {
|
static void set_config_node(struct sway_node *node, bool node_overridden) {
|
||||||
config->handler_context.node = node;
|
config->handler_context.node = node;
|
||||||
config->handler_context.container = NULL;
|
config->handler_context.container = NULL;
|
||||||
config->handler_context.workspace = NULL;
|
config->handler_context.workspace = NULL;
|
||||||
|
config->handler_context.node_overridden = node_overridden;
|
||||||
|
|
||||||
if (node == NULL) {
|
if (node == NULL) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -186,7 +187,7 @@ static void set_config_node(struct sway_node *node) {
|
||||||
switch (node->type) {
|
switch (node->type) {
|
||||||
case N_CONTAINER:
|
case N_CONTAINER:
|
||||||
config->handler_context.container = node->sway_container;
|
config->handler_context.container = node->sway_container;
|
||||||
config->handler_context.workspace = node->sway_container->workspace;
|
config->handler_context.workspace = node->sway_container->pending.workspace;
|
||||||
break;
|
break;
|
||||||
case N_WORKSPACE:
|
case N_WORKSPACE:
|
||||||
config->handler_context.workspace = node->sway_workspace;
|
config->handler_context.workspace = node->sway_workspace;
|
||||||
|
|
@ -202,6 +203,7 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
|
||||||
char *cmd;
|
char *cmd;
|
||||||
char matched_delim = ';';
|
char matched_delim = ';';
|
||||||
list_t *containers = NULL;
|
list_t *containers = NULL;
|
||||||
|
bool using_criteria = false;
|
||||||
|
|
||||||
if (seat == NULL) {
|
if (seat == NULL) {
|
||||||
// passing a NULL seat means we just pick the default seat
|
// passing a NULL seat means we just pick the default seat
|
||||||
|
|
@ -225,7 +227,7 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
|
||||||
for (; isspace(*head); ++head) {}
|
for (; isspace(*head); ++head) {}
|
||||||
// Extract criteria (valid for this command list only).
|
// Extract criteria (valid for this command list only).
|
||||||
if (matched_delim == ';') {
|
if (matched_delim == ';') {
|
||||||
config->handler_context.using_criteria = false;
|
using_criteria = false;
|
||||||
if (*head == '[') {
|
if (*head == '[') {
|
||||||
char *error = NULL;
|
char *error = NULL;
|
||||||
struct criteria *criteria = criteria_parse(head, &error);
|
struct criteria *criteria = criteria_parse(head, &error);
|
||||||
|
|
@ -239,7 +241,7 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
|
||||||
containers = criteria_get_containers(criteria);
|
containers = criteria_get_containers(criteria);
|
||||||
head += strlen(criteria->raw);
|
head += strlen(criteria->raw);
|
||||||
criteria_destroy(criteria);
|
criteria_destroy(criteria);
|
||||||
config->handler_context.using_criteria = true;
|
using_criteria = true;
|
||||||
// Skip leading whitespace
|
// Skip leading whitespace
|
||||||
for (; isspace(*head); ++head) {}
|
for (; isspace(*head); ++head) {}
|
||||||
}
|
}
|
||||||
|
|
@ -265,7 +267,7 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
struct cmd_handler *handler = find_core_handler(argv[0]);
|
const struct cmd_handler *handler = find_core_handler(argv[0]);
|
||||||
if (!handler) {
|
if (!handler) {
|
||||||
list_add(res_list, cmd_results_new(CMD_INVALID,
|
list_add(res_list, cmd_results_new(CMD_INVALID,
|
||||||
"Unknown/invalid command '%s'", argv[0]));
|
"Unknown/invalid command '%s'", argv[0]));
|
||||||
|
|
@ -278,11 +280,14 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
|
||||||
argv[i] = do_var_replacement(argv[i]);
|
argv[i] = do_var_replacement(argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config->handler_context.using_criteria) {
|
|
||||||
// The container or workspace which this command will run on.
|
if (!using_criteria) {
|
||||||
struct sway_node *node = con ? &con->node :
|
if (con) {
|
||||||
seat_get_focus_inactive(seat, &root->node);
|
set_config_node(&con->node, true);
|
||||||
set_config_node(node);
|
} else {
|
||||||
|
set_config_node(seat_get_focus_inactive(seat, &root->node),
|
||||||
|
false);
|
||||||
|
}
|
||||||
struct cmd_results *res = handler->handle(argc-1, argv+1);
|
struct cmd_results *res = handler->handle(argc-1, argv+1);
|
||||||
list_add(res_list, res);
|
list_add(res_list, res);
|
||||||
if (res->status == CMD_INVALID) {
|
if (res->status == CMD_INVALID) {
|
||||||
|
|
@ -296,7 +301,7 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
|
||||||
struct cmd_results *fail_res = NULL;
|
struct cmd_results *fail_res = NULL;
|
||||||
for (int i = 0; i < containers->length; ++i) {
|
for (int i = 0; i < containers->length; ++i) {
|
||||||
struct sway_container *container = containers->items[i];
|
struct sway_container *container = containers->items[i];
|
||||||
set_config_node(&container->node);
|
set_config_node(&container->node, true);
|
||||||
struct cmd_results *res = handler->handle(argc-1, argv+1);
|
struct cmd_results *res = handler->handle(argc-1, argv+1);
|
||||||
if (res->status == CMD_SUCCESS) {
|
if (res->status == CMD_SUCCESS) {
|
||||||
free_cmd_results(res);
|
free_cmd_results(res);
|
||||||
|
|
@ -370,7 +375,7 @@ struct cmd_results *config_command(char *exec, char **new_block) {
|
||||||
|
|
||||||
// Determine the command handler
|
// Determine the command handler
|
||||||
sway_log(SWAY_INFO, "Config command: %s", exec);
|
sway_log(SWAY_INFO, "Config command: %s", exec);
|
||||||
struct cmd_handler *handler = find_core_handler(argv[0]);
|
const struct cmd_handler *handler = find_core_handler(argv[0]);
|
||||||
if (!handler || !handler->handle) {
|
if (!handler || !handler->handle) {
|
||||||
const char *error = handler
|
const char *error = handler
|
||||||
? "Command '%s' is shimmed, but unimplemented"
|
? "Command '%s' is shimmed, but unimplemented"
|
||||||
|
|
@ -418,12 +423,12 @@ cleanup:
|
||||||
}
|
}
|
||||||
|
|
||||||
struct cmd_results *config_subcommand(char **argv, int argc,
|
struct cmd_results *config_subcommand(char **argv, int argc,
|
||||||
struct cmd_handler *handlers, size_t handlers_size) {
|
const struct cmd_handler *handlers, size_t handlers_size) {
|
||||||
char *command = join_args(argv, argc);
|
char *command = join_args(argv, argc);
|
||||||
sway_log(SWAY_DEBUG, "Subcommand: %s", command);
|
sway_log(SWAY_DEBUG, "Subcommand: %s", command);
|
||||||
free(command);
|
free(command);
|
||||||
|
|
||||||
struct cmd_handler *handler = find_handler(argv[0], handlers,
|
const struct cmd_handler *handler = find_handler(argv[0], handlers,
|
||||||
handlers_size);
|
handlers_size);
|
||||||
if (!handler) {
|
if (!handler) {
|
||||||
return cmd_results_new(CMD_INVALID,
|
return cmd_results_new(CMD_INVALID,
|
||||||
|
|
@ -453,41 +458,13 @@ struct cmd_results *config_commands_command(char *exec) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct cmd_handler *handler = find_handler(cmd, NULL, 0);
|
const struct cmd_handler *handler = find_handler(cmd, NULL, 0);
|
||||||
if (!handler && strcmp(cmd, "*") != 0) {
|
if (!handler && strcmp(cmd, "*") != 0) {
|
||||||
results = cmd_results_new(CMD_INVALID,
|
results = cmd_results_new(CMD_INVALID,
|
||||||
"Unknown/invalid command '%s'", cmd);
|
"Unknown/invalid command '%s'", cmd);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum command_context context = 0;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
char *name;
|
|
||||||
enum command_context context;
|
|
||||||
} context_names[] = {
|
|
||||||
{ "config", CONTEXT_CONFIG },
|
|
||||||
{ "binding", CONTEXT_BINDING },
|
|
||||||
{ "ipc", CONTEXT_IPC },
|
|
||||||
{ "criteria", CONTEXT_CRITERIA },
|
|
||||||
{ "all", CONTEXT_ALL },
|
|
||||||
};
|
|
||||||
|
|
||||||
for (int i = 1; i < argc; ++i) {
|
|
||||||
size_t j;
|
|
||||||
for (j = 0; j < sizeof(context_names) / sizeof(context_names[0]); ++j) {
|
|
||||||
if (strcmp(context_names[j].name, argv[i]) == 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (j == sizeof(context_names) / sizeof(context_names[0])) {
|
|
||||||
results = cmd_results_new(CMD_INVALID,
|
|
||||||
"Invalid command context %s", argv[i]);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
context |= context_names[j].context;
|
|
||||||
}
|
|
||||||
|
|
||||||
results = cmd_results_new(CMD_SUCCESS, NULL);
|
results = cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
// Must be in alphabetical order for bsearch
|
// Must be in alphabetical order for bsearch
|
||||||
static struct cmd_handler bar_handlers[] = {
|
static const struct cmd_handler bar_handlers[] = {
|
||||||
{ "bindcode", bar_cmd_bindcode },
|
{ "bindcode", bar_cmd_bindcode },
|
||||||
{ "binding_mode_indicator", bar_cmd_binding_mode_indicator },
|
{ "binding_mode_indicator", bar_cmd_binding_mode_indicator },
|
||||||
{ "bindsym", bar_cmd_bindsym },
|
{ "bindsym", bar_cmd_bindsym },
|
||||||
|
|
@ -36,11 +36,12 @@ static struct cmd_handler bar_handlers[] = {
|
||||||
{ "unbindcode", bar_cmd_unbindcode },
|
{ "unbindcode", bar_cmd_unbindcode },
|
||||||
{ "unbindsym", bar_cmd_unbindsym },
|
{ "unbindsym", bar_cmd_unbindsym },
|
||||||
{ "workspace_buttons", bar_cmd_workspace_buttons },
|
{ "workspace_buttons", bar_cmd_workspace_buttons },
|
||||||
|
{ "workspace_min_width", bar_cmd_workspace_min_width },
|
||||||
{ "wrap_scroll", bar_cmd_wrap_scroll },
|
{ "wrap_scroll", bar_cmd_wrap_scroll },
|
||||||
};
|
};
|
||||||
|
|
||||||
// Must be in alphabetical order for bsearch
|
// Must be in alphabetical order for bsearch
|
||||||
static struct cmd_handler bar_config_handlers[] = {
|
static const struct cmd_handler bar_config_handlers[] = {
|
||||||
{ "id", bar_cmd_id },
|
{ "id", bar_cmd_id },
|
||||||
{ "swaybar_command", bar_cmd_swaybar_command },
|
{ "swaybar_command", bar_cmd_swaybar_command },
|
||||||
};
|
};
|
||||||
|
|
@ -115,6 +116,7 @@ struct cmd_results *cmd_bar(int argc, char **argv) {
|
||||||
if (res && res->status != CMD_SUCCESS) {
|
if (res && res->status != CMD_SUCCESS) {
|
||||||
if (id) {
|
if (id) {
|
||||||
free_bar_config(config->current_bar);
|
free_bar_config(config->current_bar);
|
||||||
|
config->current_bar = NULL;
|
||||||
id = NULL;
|
id = NULL;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
// Must be in alphabetical order for bsearch
|
// Must be in alphabetical order for bsearch
|
||||||
static struct cmd_handler bar_colors_handlers[] = {
|
static const struct cmd_handler bar_colors_handlers[] = {
|
||||||
{ "active_workspace", bar_colors_cmd_active_workspace },
|
{ "active_workspace", bar_colors_cmd_active_workspace },
|
||||||
{ "background", bar_colors_cmd_background },
|
{ "background", bar_colors_cmd_background },
|
||||||
{ "binding_mode", bar_colors_cmd_binding_mode },
|
{ "binding_mode", bar_colors_cmd_binding_mode },
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,20 @@ struct cmd_results *bar_cmd_font(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
char *font = join_args(argv, argc);
|
char *font = join_args(argv, argc);
|
||||||
free(config->current_bar->font);
|
free(config->current_bar->font);
|
||||||
config->current_bar->font = font;
|
|
||||||
|
if (strncmp(font, "pango:", 6) == 0) {
|
||||||
|
if (config->current_bar->pango_markup == PANGO_MARKUP_DEFAULT) {
|
||||||
|
config->current_bar->pango_markup = true;
|
||||||
|
}
|
||||||
|
config->current_bar->font = strdup(font + 6);
|
||||||
|
} else {
|
||||||
|
if (config->current_bar->pango_markup == PANGO_MARKUP_DEFAULT) {
|
||||||
|
config->current_bar->pango_markup = false;
|
||||||
|
}
|
||||||
|
config->current_bar->font = strdup(font);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(font);
|
||||||
sway_log(SWAY_DEBUG, "Settings font '%s' for bar: %s",
|
sway_log(SWAY_DEBUG, "Settings font '%s' for bar: %s",
|
||||||
config->current_bar->font, config->current_bar->id);
|
config->current_bar->font, config->current_bar->id);
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
|
|
||||||
33
sway/commands/bar/workspace_min_width.c
Normal file
33
sway/commands/bar/workspace_min_width.c
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <strings.h>
|
||||||
|
#include "config.h"
|
||||||
|
#include "sway/commands.h"
|
||||||
|
#include "sway/config.h"
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
|
struct cmd_results *bar_cmd_workspace_min_width(int argc, char **argv) {
|
||||||
|
struct cmd_results *error = NULL;
|
||||||
|
if ((error = checkarg(argc, "workspace_min_width", EXPECTED_AT_LEAST, 1))) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct bar_config *bar = config->current_bar;
|
||||||
|
|
||||||
|
char *end;
|
||||||
|
int min_width = strtol(argv[0], &end, 10);
|
||||||
|
if (min_width < 0 || (*end != '\0' && strcasecmp(end, "px") != 0)) {
|
||||||
|
return cmd_results_new(CMD_INVALID,
|
||||||
|
"[Bar %s] Invalid minimum workspace button width value: %s",
|
||||||
|
bar->id, argv[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc == 2 && strcasecmp(argv[1], "px") != 0) {
|
||||||
|
return cmd_results_new(CMD_INVALID,
|
||||||
|
"Expected 'workspace_min_width <px> [px]'");
|
||||||
|
}
|
||||||
|
|
||||||
|
sway_log(SWAY_DEBUG, "[Bar %s] Setting minimum workspace button width to %d",
|
||||||
|
bar->id, min_width);
|
||||||
|
config->current_bar->workspace_min_width = min_width;
|
||||||
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include <wlr/types/wlr_cursor.h>
|
#include <wlr/types/wlr_cursor.h>
|
||||||
#include "sway/commands.h"
|
#include "sway/commands.h"
|
||||||
#include "sway/config.h"
|
#include "sway/config.h"
|
||||||
|
#include "sway/desktop/transaction.h"
|
||||||
#include "sway/input/cursor.h"
|
#include "sway/input/cursor.h"
|
||||||
#include "sway/input/keyboard.h"
|
#include "sway/input/keyboard.h"
|
||||||
#include "sway/ipc-server.h"
|
#include "sway/ipc-server.h"
|
||||||
|
|
@ -559,8 +560,8 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
|
||||||
free_switch_binding(binding);
|
free_switch_binding(binding);
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
"Invalid %s command "
|
"Invalid %s command "
|
||||||
"(expected switch state: unknown state %d)",
|
"(expected switch state: unknown state %s)",
|
||||||
bindtype, split->items[0]);
|
bindtype, split->items[1]);
|
||||||
}
|
}
|
||||||
list_free_items_and_destroy(split);
|
list_free_items_and_destroy(split);
|
||||||
|
|
||||||
|
|
@ -642,6 +643,8 @@ void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding)
|
||||||
if (success) {
|
if (success) {
|
||||||
ipc_event_binding(binding);
|
ipc_event_binding(binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction_commit_dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ static void set_border(struct sway_container *con,
|
||||||
view_set_csd_from_server(con->view, false);
|
view_set_csd_from_server(con->view, false);
|
||||||
} else if (!con->view->using_csd && new_border == B_CSD) {
|
} else if (!con->view->using_csd && new_border == B_CSD) {
|
||||||
view_set_csd_from_server(con->view, true);
|
view_set_csd_from_server(con->view, true);
|
||||||
con->saved_border = con->border;
|
con->saved_border = con->pending.border;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (new_border != B_CSD || container_is_floating(con)) {
|
if (new_border != B_CSD || container_is_floating(con)) {
|
||||||
con->border = new_border;
|
con->pending.border = new_border;
|
||||||
}
|
}
|
||||||
if (con->view) {
|
if (con->view) {
|
||||||
con->view->using_csd = new_border == B_CSD;
|
con->view->using_csd = new_border == B_CSD;
|
||||||
|
|
@ -35,7 +35,7 @@ static void border_toggle(struct sway_container *con) {
|
||||||
set_border(con, B_NONE);
|
set_border(con, B_NONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (con->border) {
|
switch (con->pending.border) {
|
||||||
case B_NONE:
|
case B_NONE:
|
||||||
set_border(con, B_PIXEL);
|
set_border(con, B_PIXEL);
|
||||||
break;
|
break;
|
||||||
|
|
@ -88,7 +88,7 @@ struct cmd_results *cmd_border(int argc, char **argv) {
|
||||||
"or 'border pixel <px>'");
|
"or 'border pixel <px>'");
|
||||||
}
|
}
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
container->border_thickness = atoi(argv[1]);
|
container->pending.border_thickness = atoi(argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container_is_floating(container)) {
|
if (container_is_floating(container)) {
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,15 @@
|
||||||
#include "stringop.h"
|
#include "stringop.h"
|
||||||
|
|
||||||
struct cmd_results *cmd_exec(int argc, char **argv) {
|
struct cmd_results *cmd_exec(int argc, char **argv) {
|
||||||
if (!config->active) return cmd_results_new(CMD_DEFER, NULL);
|
struct cmd_results *error = NULL;
|
||||||
|
if ((error = cmd_exec_validate(argc, argv))) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
if (config->reloading) {
|
if (config->reloading) {
|
||||||
char *args = join_args(argv, argc);
|
char *args = join_args(argv, argc);
|
||||||
sway_log(SWAY_DEBUG, "Ignoring 'exec %s' due to reload", args);
|
sway_log(SWAY_DEBUG, "Ignoring 'exec %s' due to reload", args);
|
||||||
free(args);
|
free(args);
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
return cmd_exec_always(argc, argv);
|
return cmd_exec_process(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,22 +7,27 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "sway/commands.h"
|
#include "sway/commands.h"
|
||||||
#include "sway/config.h"
|
#include "sway/config.h"
|
||||||
|
#include "sway/server.h"
|
||||||
#include "sway/tree/container.h"
|
#include "sway/tree/container.h"
|
||||||
#include "sway/tree/root.h"
|
#include "sway/tree/root.h"
|
||||||
#include "sway/tree/workspace.h"
|
#include "sway/tree/workspace.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "stringop.h"
|
#include "stringop.h"
|
||||||
|
|
||||||
struct cmd_results *cmd_exec_always(int argc, char **argv) {
|
struct cmd_results *cmd_exec_validate(int argc, char **argv) {
|
||||||
struct cmd_results *error = NULL;
|
struct cmd_results *error = NULL;
|
||||||
if (!config->active || config->validating) {
|
|
||||||
return cmd_results_new(CMD_DEFER, NULL);
|
|
||||||
}
|
|
||||||
if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) {
|
if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
if (!config->active || config->validating) {
|
||||||
|
return cmd_results_new(CMD_DEFER, NULL);
|
||||||
|
}
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
char *tmp = NULL;
|
struct cmd_results *cmd_exec_process(int argc, char **argv) {
|
||||||
|
struct cmd_results *error = NULL;
|
||||||
|
char *cmd = NULL;
|
||||||
if (strcmp(argv[0], "--no-startup-id") == 0) {
|
if (strcmp(argv[0], "--no-startup-id") == 0) {
|
||||||
sway_log(SWAY_INFO, "exec switch '--no-startup-id' not supported, ignored.");
|
sway_log(SWAY_INFO, "exec switch '--no-startup-id' not supported, ignored.");
|
||||||
--argc; ++argv;
|
--argc; ++argv;
|
||||||
|
|
@ -32,17 +37,12 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc == 1 && (argv[0][0] == '\'' || argv[0][0] == '"')) {
|
if (argc == 1 && (argv[0][0] == '\'' || argv[0][0] == '"')) {
|
||||||
tmp = strdup(argv[0]);
|
cmd = strdup(argv[0]);
|
||||||
strip_quotes(tmp);
|
strip_quotes(cmd);
|
||||||
} else {
|
} else {
|
||||||
tmp = join_args(argv, argc);
|
cmd = join_args(argv, argc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put argument into cmd array
|
|
||||||
char cmd[4096];
|
|
||||||
strncpy(cmd, tmp, sizeof(cmd) - 1);
|
|
||||||
cmd[sizeof(cmd) - 1] = 0;
|
|
||||||
free(tmp);
|
|
||||||
sway_log(SWAY_DEBUG, "Executing %s", cmd);
|
sway_log(SWAY_DEBUG, "Executing %s", cmd);
|
||||||
|
|
||||||
int fd[2];
|
int fd[2];
|
||||||
|
|
@ -54,15 +54,18 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
|
||||||
// Fork process
|
// Fork process
|
||||||
if ((pid = fork()) == 0) {
|
if ((pid = fork()) == 0) {
|
||||||
// Fork child process again
|
// Fork child process again
|
||||||
|
restore_nofile_limit();
|
||||||
setsid();
|
setsid();
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigprocmask(SIG_SETMASK, &set, NULL);
|
sigprocmask(SIG_SETMASK, &set, NULL);
|
||||||
|
signal(SIGPIPE, SIG_DFL);
|
||||||
close(fd[0]);
|
close(fd[0]);
|
||||||
if ((child = fork()) == 0) {
|
if ((child = fork()) == 0) {
|
||||||
close(fd[1]);
|
close(fd[1]);
|
||||||
execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL);
|
execlp("sh", "sh", "-c", cmd, (void *)NULL);
|
||||||
_exit(0);
|
sway_log_errno(SWAY_ERROR, "execlp failed");
|
||||||
|
_exit(1);
|
||||||
}
|
}
|
||||||
ssize_t s = 0;
|
ssize_t s = 0;
|
||||||
while ((size_t)s < sizeof(pid_t)) {
|
while ((size_t)s < sizeof(pid_t)) {
|
||||||
|
|
@ -71,10 +74,12 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
|
||||||
close(fd[1]);
|
close(fd[1]);
|
||||||
_exit(0); // Close child process
|
_exit(0); // Close child process
|
||||||
} else if (pid < 0) {
|
} else if (pid < 0) {
|
||||||
|
free(cmd);
|
||||||
close(fd[0]);
|
close(fd[0]);
|
||||||
close(fd[1]);
|
close(fd[1]);
|
||||||
return cmd_results_new(CMD_FAILURE, "fork() failed");
|
return cmd_results_new(CMD_FAILURE, "fork() failed");
|
||||||
}
|
}
|
||||||
|
free(cmd);
|
||||||
close(fd[1]); // close write
|
close(fd[1]); // close write
|
||||||
ssize_t s = 0;
|
ssize_t s = 0;
|
||||||
while ((size_t)s < sizeof(pid_t)) {
|
while ((size_t)s < sizeof(pid_t)) {
|
||||||
|
|
@ -92,3 +97,11 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
|
||||||
|
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct cmd_results *cmd_exec_always(int argc, char **argv) {
|
||||||
|
struct cmd_results *error;
|
||||||
|
if ((error = cmd_exec_validate(argc, argv))) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
return cmd_exec_process(argc, argv);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ struct cmd_results *cmd_floating(int argc, char **argv) {
|
||||||
// If the container is in a floating split container,
|
// If the container is in a floating split container,
|
||||||
// operate on the split container instead of the child.
|
// operate on the split container instead of the child.
|
||||||
if (container_is_floating_or_child(container)) {
|
if (container_is_floating_or_child(container)) {
|
||||||
while (container->parent) {
|
while (container->pending.parent) {
|
||||||
container = container->parent;
|
container = container->pending.parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -51,8 +51,8 @@ struct cmd_results *cmd_floating(int argc, char **argv) {
|
||||||
container_set_floating(container, wants_floating);
|
container_set_floating(container, wants_floating);
|
||||||
|
|
||||||
// Floating containers in the scratchpad should be ignored
|
// Floating containers in the scratchpad should be ignored
|
||||||
if (container->workspace) {
|
if (container->pending.workspace) {
|
||||||
arrange_workspace(container->workspace);
|
arrange_workspace(container->pending.workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
|
|
||||||
|
|
@ -141,9 +141,9 @@ static struct sway_node *node_get_in_direction_tiling(
|
||||||
struct sway_container *wrap_candidate = NULL;
|
struct sway_container *wrap_candidate = NULL;
|
||||||
struct sway_container *current = container;
|
struct sway_container *current = container;
|
||||||
while (current) {
|
while (current) {
|
||||||
if (current->fullscreen_mode == FULLSCREEN_WORKSPACE) {
|
if (current->pending.fullscreen_mode == FULLSCREEN_WORKSPACE) {
|
||||||
// Fullscreen container with a direction - go straight to outputs
|
// Fullscreen container with a direction - go straight to outputs
|
||||||
struct sway_output *output = current->workspace->output;
|
struct sway_output *output = current->pending.workspace->output;
|
||||||
struct sway_output *new_output =
|
struct sway_output *new_output =
|
||||||
output_get_in_direction(output, dir);
|
output_get_in_direction(output, dir);
|
||||||
if (!new_output) {
|
if (!new_output) {
|
||||||
|
|
@ -151,7 +151,7 @@ static struct sway_node *node_get_in_direction_tiling(
|
||||||
}
|
}
|
||||||
return get_node_in_output_direction(new_output, dir);
|
return get_node_in_output_direction(new_output, dir);
|
||||||
}
|
}
|
||||||
if (current->fullscreen_mode == FULLSCREEN_GLOBAL) {
|
if (current->pending.fullscreen_mode == FULLSCREEN_GLOBAL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,11 +202,11 @@ static struct sway_node *node_get_in_direction_tiling(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
current = current->parent;
|
current = current->pending.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check a different output
|
// Check a different output
|
||||||
struct sway_output *output = container->workspace->output;
|
struct sway_output *output = container->pending.workspace->output;
|
||||||
struct sway_output *new_output = output_get_in_direction(output, dir);
|
struct sway_output *new_output = output_get_in_direction(output, dir);
|
||||||
if ((config->focus_wrapping != WRAP_WORKSPACE ||
|
if ((config->focus_wrapping != WRAP_WORKSPACE ||
|
||||||
container->node.type == N_WORKSPACE) && new_output) {
|
container->node.type == N_WORKSPACE) && new_output) {
|
||||||
|
|
@ -226,23 +226,23 @@ static struct sway_node *node_get_in_direction_tiling(
|
||||||
static struct sway_node *node_get_in_direction_floating(
|
static struct sway_node *node_get_in_direction_floating(
|
||||||
struct sway_container *con, struct sway_seat *seat,
|
struct sway_container *con, struct sway_seat *seat,
|
||||||
enum wlr_direction dir) {
|
enum wlr_direction dir) {
|
||||||
double ref_lx = con->x + con->width / 2;
|
double ref_lx = con->pending.x + con->pending.width / 2;
|
||||||
double ref_ly = con->y + con->height / 2;
|
double ref_ly = con->pending.y + con->pending.height / 2;
|
||||||
double closest_distance = DBL_MAX;
|
double closest_distance = DBL_MAX;
|
||||||
struct sway_container *closest_con = NULL;
|
struct sway_container *closest_con = NULL;
|
||||||
|
|
||||||
if (!con->workspace) {
|
if (!con->pending.workspace) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < con->workspace->floating->length; i++) {
|
for (int i = 0; i < con->pending.workspace->floating->length; i++) {
|
||||||
struct sway_container *floater = con->workspace->floating->items[i];
|
struct sway_container *floater = con->pending.workspace->floating->items[i];
|
||||||
if (floater == con) {
|
if (floater == con) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
float distance = dir == WLR_DIRECTION_LEFT || dir == WLR_DIRECTION_RIGHT
|
float distance = dir == WLR_DIRECTION_LEFT || dir == WLR_DIRECTION_RIGHT
|
||||||
? (floater->x + floater->width / 2) - ref_lx
|
? (floater->pending.x + floater->pending.width / 2) - ref_lx
|
||||||
: (floater->y + floater->height / 2) - ref_ly;
|
: (floater->pending.y + floater->pending.height / 2) - ref_ly;
|
||||||
if (dir == WLR_DIRECTION_LEFT || dir == WLR_DIRECTION_UP) {
|
if (dir == WLR_DIRECTION_LEFT || dir == WLR_DIRECTION_UP) {
|
||||||
distance = -distance;
|
distance = -distance;
|
||||||
}
|
}
|
||||||
|
|
@ -267,8 +267,22 @@ static struct cmd_results *focus_mode(struct sway_workspace *ws,
|
||||||
new_focus = seat_get_focus_inactive_tiling(seat, ws);
|
new_focus = seat_get_focus_inactive_tiling(seat, ws);
|
||||||
}
|
}
|
||||||
if (new_focus) {
|
if (new_focus) {
|
||||||
|
struct sway_container *new_focus_view =
|
||||||
|
seat_get_focus_inactive_view(seat, &new_focus->node);
|
||||||
|
if (new_focus_view) {
|
||||||
|
new_focus = new_focus_view;
|
||||||
|
}
|
||||||
seat_set_focus_container(seat, new_focus);
|
seat_set_focus_container(seat, new_focus);
|
||||||
seat_consider_warp_to_focus(seat);
|
|
||||||
|
// If we're on the floating layer and the floating container area
|
||||||
|
// overlaps the position on the tiling layer that would be warped to,
|
||||||
|
// `seat_consider_warp_to_focus` would decide not to warp, but we need
|
||||||
|
// to anyway.
|
||||||
|
if (config->mouse_warping == WARP_CONTAINER) {
|
||||||
|
cursor_warp_to_container(seat->cursor, new_focus, true);
|
||||||
|
} else {
|
||||||
|
seat_consider_warp_to_focus(seat);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
"Failed to find a %s container in workspace",
|
"Failed to find a %s container in workspace",
|
||||||
|
|
@ -325,7 +339,7 @@ static struct cmd_results *focus_output(struct sway_seat *seat,
|
||||||
static struct cmd_results *focus_parent(void) {
|
static struct cmd_results *focus_parent(void) {
|
||||||
struct sway_seat *seat = config->handler_context.seat;
|
struct sway_seat *seat = config->handler_context.seat;
|
||||||
struct sway_container *con = config->handler_context.container;
|
struct sway_container *con = config->handler_context.container;
|
||||||
if (!con || con->fullscreen_mode) {
|
if (!con || con->pending.fullscreen_mode) {
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
struct sway_node *parent = node_get_parent(&con->node);
|
struct sway_node *parent = node_get_parent(&con->node);
|
||||||
|
|
@ -368,6 +382,13 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
|
||||||
if (container_is_scratchpad_hidden_or_child(container)) {
|
if (container_is_scratchpad_hidden_or_child(container)) {
|
||||||
root_scratchpad_show(container);
|
root_scratchpad_show(container);
|
||||||
}
|
}
|
||||||
|
// if we are switching to a container under a fullscreen window, we first
|
||||||
|
// need to exit fullscreen so that the newly focused container becomes visible
|
||||||
|
struct sway_container *obstructing = container_obstructing_fullscreen_container(container);
|
||||||
|
if (obstructing) {
|
||||||
|
container_fullscreen_disable(obstructing);
|
||||||
|
arrange_root();
|
||||||
|
}
|
||||||
seat_set_focus_container(seat, container);
|
seat_set_focus_container(seat, container);
|
||||||
seat_consider_warp_to_focus(seat);
|
seat_consider_warp_to_focus(seat);
|
||||||
container_raise_floating(container);
|
container_raise_floating(container);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,6 @@ struct cmd_results *cmd_font(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
free(font);
|
free(font);
|
||||||
config_update_font_height(true);
|
config_update_font_height();
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include "sway/commands.h"
|
#include "sway/commands.h"
|
||||||
#include "sway/config.h"
|
#include "sway/config.h"
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
struct cmd_results *cmd_force_display_urgency_hint(int argc, char **argv) {
|
struct cmd_results *cmd_force_display_urgency_hint(int argc, char **argv) {
|
||||||
struct cmd_results *error = NULL;
|
struct cmd_results *error = NULL;
|
||||||
|
|
@ -8,13 +9,16 @@ struct cmd_results *cmd_force_display_urgency_hint(int argc, char **argv) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *err;
|
errno = 0;
|
||||||
int timeout = (int)strtol(argv[0], &err, 10);
|
char *end;
|
||||||
if (*err) {
|
int timeout = (int)strtol(argv[0], &end, 10);
|
||||||
if (strcmp(err, "ms") != 0) {
|
if (errno || end == argv[0] || (*end && strcmp(end, "ms") != 0)) {
|
||||||
return cmd_results_new(CMD_INVALID,
|
return cmd_results_new(CMD_INVALID, "timeout integer invalid");
|
||||||
"Expected 'force_display_urgency_hint <timeout> ms'");
|
}
|
||||||
}
|
|
||||||
|
if (argc > 1 && strcmp(argv[1], "ms") != 0) {
|
||||||
|
return cmd_results_new(CMD_INVALID,
|
||||||
|
"Expected 'force_display_urgency_hint <timeout> [ms]'");
|
||||||
}
|
}
|
||||||
|
|
||||||
config->urgent_timeout = timeout > 0 ? timeout : 0;
|
config->urgent_timeout = timeout > 0 ? timeout : 0;
|
||||||
|
|
|
||||||
|
|
@ -18,30 +18,19 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) {
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
"Can't run this command while there's no outputs connected.");
|
"Can't run this command while there's no outputs connected.");
|
||||||
}
|
}
|
||||||
struct sway_node *node = config->handler_context.node;
|
|
||||||
struct sway_container *container = config->handler_context.container;
|
struct sway_container *container = config->handler_context.container;
|
||||||
struct sway_workspace *workspace = config->handler_context.workspace;
|
|
||||||
if (node->type == N_WORKSPACE && workspace->tiling->length == 0) {
|
|
||||||
return cmd_results_new(CMD_FAILURE,
|
|
||||||
"Can't fullscreen an empty workspace");
|
|
||||||
}
|
|
||||||
|
|
||||||
// If in the scratchpad, operate on the highest container
|
if (!container) {
|
||||||
if (container && !container->workspace) {
|
// If the focus is not a container, do nothing successfully
|
||||||
while (container->parent) {
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
container = container->parent;
|
} else if (!container->pending.workspace) {
|
||||||
}
|
// If in the scratchpad, operate on the highest container
|
||||||
}
|
while (container->pending.parent) {
|
||||||
|
container = container->pending.parent;
|
||||||
bool is_fullscreen = false;
|
|
||||||
for (struct sway_container *curr = container; curr; curr = curr->parent) {
|
|
||||||
if (curr->fullscreen_mode != FULLSCREEN_NONE) {
|
|
||||||
container = curr;
|
|
||||||
is_fullscreen = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_fullscreen = container->pending.fullscreen_mode != FULLSCREEN_NONE;
|
||||||
bool global = false;
|
bool global = false;
|
||||||
bool enable = !is_fullscreen;
|
bool enable = !is_fullscreen;
|
||||||
|
|
||||||
|
|
@ -57,13 +46,6 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) {
|
||||||
global = strcasecmp(argv[1], "global") == 0;
|
global = strcasecmp(argv[1], "global") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable && node->type == N_WORKSPACE) {
|
|
||||||
// Wrap the workspace's children in a container so we can fullscreen it
|
|
||||||
container = workspace_wrap_children(workspace);
|
|
||||||
workspace->layout = L_HORIZ;
|
|
||||||
seat_set_focus_container(config->handler_context.seat, container);
|
|
||||||
}
|
|
||||||
|
|
||||||
enum sway_fullscreen_mode mode = FULLSCREEN_NONE;
|
enum sway_fullscreen_mode mode = FULLSCREEN_NONE;
|
||||||
if (enable) {
|
if (enable) {
|
||||||
mode = global ? FULLSCREEN_GLOBAL : FULLSCREEN_WORKSPACE;
|
mode = global ? FULLSCREEN_GLOBAL : FULLSCREEN_WORKSPACE;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@
|
||||||
enum gaps_op {
|
enum gaps_op {
|
||||||
GAPS_OP_SET,
|
GAPS_OP_SET,
|
||||||
GAPS_OP_ADD,
|
GAPS_OP_ADD,
|
||||||
GAPS_OP_SUBTRACT
|
GAPS_OP_SUBTRACT,
|
||||||
|
GAPS_OP_TOGGLE
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gaps_data {
|
struct gaps_data {
|
||||||
|
|
@ -102,6 +103,9 @@ static void apply_gaps_op(int *prop, enum gaps_op op, int amount) {
|
||||||
case GAPS_OP_SUBTRACT:
|
case GAPS_OP_SUBTRACT:
|
||||||
*prop -= amount;
|
*prop -= amount;
|
||||||
break;
|
break;
|
||||||
|
case GAPS_OP_TOGGLE:
|
||||||
|
*prop = *prop ? 0 : amount;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,9 +137,9 @@ static void configure_gaps(struct sway_workspace *ws, void *_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// gaps inner|outer|horizontal|vertical|top|right|bottom|left current|all
|
// gaps inner|outer|horizontal|vertical|top|right|bottom|left current|all
|
||||||
// set|plus|minus <px>
|
// set|plus|minus|toggle <px>
|
||||||
static const char expected_runtime[] = "'gaps inner|outer|horizontal|vertical|"
|
static const char expected_runtime[] = "'gaps inner|outer|horizontal|vertical|"
|
||||||
"top|right|bottom|left current|all set|plus|minus <px>'";
|
"top|right|bottom|left current|all set|plus|minus|toggle <px>'";
|
||||||
static struct cmd_results *gaps_set_runtime(int argc, char **argv) {
|
static struct cmd_results *gaps_set_runtime(int argc, char **argv) {
|
||||||
struct cmd_results *error = checkarg(argc, "gaps", EXPECTED_EQUAL_TO, 4);
|
struct cmd_results *error = checkarg(argc, "gaps", EXPECTED_EQUAL_TO, 4);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|
@ -180,6 +184,8 @@ static struct cmd_results *gaps_set_runtime(int argc, char **argv) {
|
||||||
data.operation = GAPS_OP_ADD;
|
data.operation = GAPS_OP_ADD;
|
||||||
} else if (strcasecmp(argv[2], "minus") == 0) {
|
} else if (strcasecmp(argv[2], "minus") == 0) {
|
||||||
data.operation = GAPS_OP_SUBTRACT;
|
data.operation = GAPS_OP_SUBTRACT;
|
||||||
|
} else if (strcasecmp(argv[2], "toggle") == 0) {
|
||||||
|
data.operation = GAPS_OP_TOGGLE;
|
||||||
} else {
|
} else {
|
||||||
return cmd_results_new(CMD_INVALID, "Expected %s", expected_runtime);
|
return cmd_results_new(CMD_INVALID, "Expected %s", expected_runtime);
|
||||||
}
|
}
|
||||||
|
|
@ -200,7 +206,7 @@ static struct cmd_results *gaps_set_runtime(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// gaps inner|outer|<dir>|<side> <px> - sets defaults for workspaces
|
// gaps inner|outer|<dir>|<side> <px> - sets defaults for workspaces
|
||||||
// gaps inner|outer|<dir>|<side> current|all set|plus|minus <px> - runtime only
|
// gaps inner|outer|<dir>|<side> current|all set|plus|minus|toggle <px> - runtime only
|
||||||
// <dir> = horizontal|vertical
|
// <dir> = horizontal|vertical
|
||||||
// <side> = top|right|bottom|left
|
// <side> = top|right|bottom|left
|
||||||
struct cmd_results *cmd_gaps(int argc, char **argv) {
|
struct cmd_results *cmd_gaps(int argc, char **argv) {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#include "stringop.h"
|
#include "stringop.h"
|
||||||
|
|
||||||
// must be in order for the bsearch
|
// must be in order for the bsearch
|
||||||
static struct cmd_handler input_handlers[] = {
|
static const struct cmd_handler input_handlers[] = {
|
||||||
{ "accel_profile", input_cmd_accel_profile },
|
{ "accel_profile", input_cmd_accel_profile },
|
||||||
{ "calibration_matrix", input_cmd_calibration_matrix },
|
{ "calibration_matrix", input_cmd_calibration_matrix },
|
||||||
{ "click_method", input_cmd_click_method },
|
{ "click_method", input_cmd_click_method },
|
||||||
|
|
@ -29,6 +29,7 @@ static struct cmd_handler input_handlers[] = {
|
||||||
{ "scroll_method", input_cmd_scroll_method },
|
{ "scroll_method", input_cmd_scroll_method },
|
||||||
{ "tap", input_cmd_tap },
|
{ "tap", input_cmd_tap },
|
||||||
{ "tap_button_map", input_cmd_tap_button_map },
|
{ "tap_button_map", input_cmd_tap_button_map },
|
||||||
|
{ "tool_mode", input_cmd_tool_mode },
|
||||||
{ "xkb_file", input_cmd_xkb_file },
|
{ "xkb_file", input_cmd_xkb_file },
|
||||||
{ "xkb_layout", input_cmd_xkb_layout },
|
{ "xkb_layout", input_cmd_xkb_layout },
|
||||||
{ "xkb_model", input_cmd_xkb_model },
|
{ "xkb_model", input_cmd_xkb_model },
|
||||||
|
|
@ -39,7 +40,7 @@ static struct cmd_handler input_handlers[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// must be in order for the bsearch
|
// must be in order for the bsearch
|
||||||
static struct cmd_handler input_config_handlers[] = {
|
static const struct cmd_handler input_config_handlers[] = {
|
||||||
{ "xkb_capslock", input_cmd_xkb_capslock },
|
{ "xkb_capslock", input_cmd_xkb_capslock },
|
||||||
{ "xkb_numlock", input_cmd_xkb_numlock },
|
{ "xkb_numlock", input_cmd_xkb_numlock },
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#define _POSIX_C_SOURCE 200809L
|
#define _POSIX_C_SOURCE 200809L
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <wlr/types/wlr_box.h>
|
|
||||||
#include "sway/commands.h"
|
#include "sway/commands.h"
|
||||||
#include "sway/config.h"
|
#include "sway/config.h"
|
||||||
|
|
||||||
|
|
|
||||||
73
sway/commands/input/tool_mode.c
Normal file
73
sway/commands/input/tool_mode.c
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
#include <strings.h>
|
||||||
|
#include "sway/commands.h"
|
||||||
|
#include "sway/config.h"
|
||||||
|
|
||||||
|
static void set_tool_mode(struct input_config *ic,
|
||||||
|
enum wlr_tablet_tool_type type, enum sway_tablet_tool_mode mode) {
|
||||||
|
for (int i = 0; i < ic->tools->length; i++) {
|
||||||
|
struct input_config_tool *tool = ic->tools->items[i];
|
||||||
|
if (tool->type == type) {
|
||||||
|
tool->mode = mode;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct input_config_tool *tool = calloc(1, sizeof(*tool));
|
||||||
|
if (tool) {
|
||||||
|
tool->type = type;
|
||||||
|
tool->mode = mode;
|
||||||
|
list_add(ic->tools, tool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct cmd_results *input_cmd_tool_mode(int argc, char **argv) {
|
||||||
|
struct cmd_results *error;
|
||||||
|
if ((error = checkarg(argc, "tool_mode", EXPECTED_AT_LEAST, 2))) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct input_config *ic = config->handler_context.input_config;
|
||||||
|
if (!ic) {
|
||||||
|
return cmd_results_new(CMD_FAILURE, "No input device defined.");
|
||||||
|
}
|
||||||
|
|
||||||
|
enum sway_tablet_tool_mode tool_mode;
|
||||||
|
if (!strcasecmp(argv[1], "absolute")) {
|
||||||
|
tool_mode = SWAY_TABLET_TOOL_MODE_ABSOLUTE;
|
||||||
|
} else if (!strcasecmp(argv[1], "relative")) {
|
||||||
|
tool_mode = SWAY_TABLET_TOOL_MODE_RELATIVE;
|
||||||
|
} else {
|
||||||
|
goto invalid_command;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strcasecmp(argv[0], "*")) {
|
||||||
|
set_tool_mode(ic, WLR_TABLET_TOOL_TYPE_PEN, tool_mode);
|
||||||
|
set_tool_mode(ic, WLR_TABLET_TOOL_TYPE_ERASER, tool_mode);
|
||||||
|
set_tool_mode(ic, WLR_TABLET_TOOL_TYPE_BRUSH, tool_mode);
|
||||||
|
set_tool_mode(ic, WLR_TABLET_TOOL_TYPE_PENCIL, tool_mode);
|
||||||
|
set_tool_mode(ic, WLR_TABLET_TOOL_TYPE_AIRBRUSH, tool_mode);
|
||||||
|
} else {
|
||||||
|
enum wlr_tablet_tool_type tool_type;
|
||||||
|
if (!strcasecmp(argv[0], "pen")) {
|
||||||
|
tool_type = WLR_TABLET_TOOL_TYPE_PEN;
|
||||||
|
} else if (!strcasecmp(argv[0], "eraser")) {
|
||||||
|
tool_type = WLR_TABLET_TOOL_TYPE_ERASER;
|
||||||
|
} else if (!strcasecmp(argv[0], "brush")) {
|
||||||
|
tool_type = WLR_TABLET_TOOL_TYPE_BRUSH;
|
||||||
|
} else if (!strcasecmp(argv[0], "pencil")) {
|
||||||
|
tool_type = WLR_TABLET_TOOL_TYPE_PENCIL;
|
||||||
|
} else if (!strcasecmp(argv[0], "airbrush")) {
|
||||||
|
tool_type = WLR_TABLET_TOOL_TYPE_AIRBRUSH;
|
||||||
|
} else {
|
||||||
|
goto invalid_command;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_tool_mode(ic, tool_type, tool_mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
|
||||||
|
invalid_command:
|
||||||
|
return cmd_results_new(CMD_INVALID,
|
||||||
|
"Expected 'tool_mode <tool> <absolute|relative>'");
|
||||||
|
}
|
||||||
|
|
@ -133,7 +133,7 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
|
||||||
|
|
||||||
// Operate on parent container, like i3.
|
// Operate on parent container, like i3.
|
||||||
if (container) {
|
if (container) {
|
||||||
container = container->parent;
|
container = container->pending.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We could be working with a container OR a workspace. These are different
|
// We could be working with a container OR a workspace. These are different
|
||||||
|
|
@ -142,10 +142,10 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
|
||||||
enum sway_container_layout new_layout = L_NONE;
|
enum sway_container_layout new_layout = L_NONE;
|
||||||
enum sway_container_layout old_layout = L_NONE;
|
enum sway_container_layout old_layout = L_NONE;
|
||||||
if (container) {
|
if (container) {
|
||||||
old_layout = container->layout;
|
old_layout = container->pending.layout;
|
||||||
new_layout = get_layout(argc, argv,
|
new_layout = get_layout(argc, argv,
|
||||||
container->layout, container->prev_split_layout,
|
container->pending.layout, container->prev_split_layout,
|
||||||
container->workspace->output);
|
container->pending.workspace->output);
|
||||||
} else {
|
} else {
|
||||||
old_layout = workspace->layout;
|
old_layout = workspace->layout;
|
||||||
new_layout = get_layout(argc, argv,
|
new_layout = get_layout(argc, argv,
|
||||||
|
|
@ -160,7 +160,13 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
|
||||||
if (old_layout != L_TABBED && old_layout != L_STACKED) {
|
if (old_layout != L_TABBED && old_layout != L_STACKED) {
|
||||||
container->prev_split_layout = old_layout;
|
container->prev_split_layout = old_layout;
|
||||||
}
|
}
|
||||||
container->layout = new_layout;
|
container->pending.layout = new_layout;
|
||||||
|
container_update_representation(container);
|
||||||
|
} else if (config->handler_context.container) {
|
||||||
|
// i3 avoids changing workspace layouts with a new container
|
||||||
|
// https://github.com/i3/i3/blob/3cd1c45eba6de073bc4300eebb4e1cc1a0c4479a/src/con.c#L1817
|
||||||
|
container = workspace_wrap_children(workspace);
|
||||||
|
container->pending.layout = new_layout;
|
||||||
container_update_representation(container);
|
container_update_representation(container);
|
||||||
} else {
|
} else {
|
||||||
if (old_layout != L_TABBED && old_layout != L_STACKED) {
|
if (old_layout != L_TABBED && old_layout != L_STACKED) {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
#include "stringop.h"
|
#include "stringop.h"
|
||||||
|
|
||||||
// Must be in order for the bsearch
|
// Must be in order for the bsearch
|
||||||
static struct cmd_handler mode_handlers[] = {
|
static const struct cmd_handler mode_handlers[] = {
|
||||||
{ "bindcode", cmd_bindcode },
|
{ "bindcode", cmd_bindcode },
|
||||||
{ "bindswitch", cmd_bindswitch },
|
{ "bindswitch", cmd_bindswitch },
|
||||||
{ "bindsym", cmd_bindsym },
|
{ "bindsym", cmd_bindsym },
|
||||||
|
|
|
||||||
|
|
@ -113,38 +113,41 @@ static void container_move_to_container_from_direction(
|
||||||
struct sway_container *container, struct sway_container *destination,
|
struct sway_container *container, struct sway_container *destination,
|
||||||
enum wlr_direction move_dir) {
|
enum wlr_direction move_dir) {
|
||||||
if (destination->view) {
|
if (destination->view) {
|
||||||
if (destination->parent == container->parent &&
|
if (destination->pending.parent == container->pending.parent &&
|
||||||
destination->workspace == container->workspace) {
|
destination->pending.workspace == container->pending.workspace) {
|
||||||
sway_log(SWAY_DEBUG, "Swapping siblings");
|
sway_log(SWAY_DEBUG, "Swapping siblings");
|
||||||
list_t *siblings = container_get_siblings(container);
|
list_t *siblings = container_get_siblings(container);
|
||||||
int container_index = list_find(siblings, container);
|
int container_index = list_find(siblings, container);
|
||||||
int destination_index = list_find(siblings, destination);
|
int destination_index = list_find(siblings, destination);
|
||||||
list_swap(siblings, container_index, destination_index);
|
list_swap(siblings, container_index, destination_index);
|
||||||
|
container_update_representation(container);
|
||||||
} else {
|
} else {
|
||||||
sway_log(SWAY_DEBUG, "Promoting to sibling of cousin");
|
sway_log(SWAY_DEBUG, "Promoting to sibling of cousin");
|
||||||
int offset =
|
int offset =
|
||||||
move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP;
|
move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP;
|
||||||
int index = container_sibling_index(destination) + offset;
|
int index = container_sibling_index(destination) + offset;
|
||||||
if (destination->parent) {
|
if (destination->pending.parent) {
|
||||||
container_insert_child(destination->parent, container, index);
|
container_insert_child(destination->pending.parent, container, index);
|
||||||
} else {
|
} else {
|
||||||
workspace_insert_tiling(destination->workspace,
|
workspace_insert_tiling(destination->pending.workspace,
|
||||||
container, index);
|
container, index);
|
||||||
}
|
}
|
||||||
container->width = container->height = 0;
|
container->pending.width = container->pending.height = 0;
|
||||||
container->width_fraction = container->height_fraction = 0;
|
container->width_fraction = container->height_fraction = 0;
|
||||||
|
workspace_squash(destination->pending.workspace);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_parallel(destination->layout, move_dir)) {
|
if (is_parallel(destination->pending.layout, move_dir)) {
|
||||||
sway_log(SWAY_DEBUG, "Reparenting container (parallel)");
|
sway_log(SWAY_DEBUG, "Reparenting container (parallel)");
|
||||||
int index =
|
int index =
|
||||||
move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ?
|
move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ?
|
||||||
0 : destination->children->length;
|
0 : destination->pending.children->length;
|
||||||
container_insert_child(destination, container, index);
|
container_insert_child(destination, container, index);
|
||||||
container->width = container->height = 0;
|
container->pending.width = container->pending.height = 0;
|
||||||
container->width_fraction = container->height_fraction = 0;
|
container->width_fraction = container->height_fraction = 0;
|
||||||
|
workspace_squash(destination->pending.workspace);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -165,7 +168,7 @@ static void container_move_to_container_from_direction(
|
||||||
static void container_move_to_workspace_from_direction(
|
static void container_move_to_workspace_from_direction(
|
||||||
struct sway_container *container, struct sway_workspace *workspace,
|
struct sway_container *container, struct sway_workspace *workspace,
|
||||||
enum wlr_direction move_dir) {
|
enum wlr_direction move_dir) {
|
||||||
container->width = container->height = 0;
|
container->pending.width = container->pending.height = 0;
|
||||||
container->width_fraction = container->height_fraction = 0;
|
container->width_fraction = container->height_fraction = 0;
|
||||||
|
|
||||||
if (is_parallel(workspace->layout, move_dir)) {
|
if (is_parallel(workspace->layout, move_dir)) {
|
||||||
|
|
@ -185,8 +188,8 @@ static void container_move_to_workspace_from_direction(
|
||||||
workspace_add_tiling(workspace, container);
|
workspace_add_tiling(workspace, container);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while (focus_inactive->parent) {
|
while (focus_inactive->pending.parent) {
|
||||||
focus_inactive = focus_inactive->parent;
|
focus_inactive = focus_inactive->pending.parent;
|
||||||
}
|
}
|
||||||
container_move_to_container_from_direction(container, focus_inactive,
|
container_move_to_container_from_direction(container, focus_inactive,
|
||||||
move_dir);
|
move_dir);
|
||||||
|
|
@ -194,25 +197,25 @@ static void container_move_to_workspace_from_direction(
|
||||||
|
|
||||||
static void container_move_to_workspace(struct sway_container *container,
|
static void container_move_to_workspace(struct sway_container *container,
|
||||||
struct sway_workspace *workspace) {
|
struct sway_workspace *workspace) {
|
||||||
if (container->workspace == workspace) {
|
if (container->pending.workspace == workspace) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
struct sway_workspace *old_workspace = container->workspace;
|
struct sway_workspace *old_workspace = container->pending.workspace;
|
||||||
if (container_is_floating(container)) {
|
if (container_is_floating(container)) {
|
||||||
struct sway_output *old_output = container->workspace->output;
|
struct sway_output *old_output = container->pending.workspace->output;
|
||||||
container_detach(container);
|
container_detach(container);
|
||||||
workspace_add_floating(workspace, container);
|
workspace_add_floating(workspace, container);
|
||||||
container_handle_fullscreen_reparent(container);
|
container_handle_fullscreen_reparent(container);
|
||||||
// If changing output, center it within the workspace
|
// If changing output, center it within the workspace
|
||||||
if (old_output != workspace->output && !container->fullscreen_mode) {
|
if (old_output != workspace->output && !container->pending.fullscreen_mode) {
|
||||||
container_floating_move_to_center(container);
|
container_floating_move_to_center(container);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
container_detach(container);
|
container_detach(container);
|
||||||
if (workspace_is_empty(workspace) && container->children) {
|
if (workspace_is_empty(workspace) && container->pending.children) {
|
||||||
workspace_unwrap_children(workspace, container);
|
workspace_unwrap_children(workspace, container);
|
||||||
} else {
|
} else {
|
||||||
container->width = container->height = 0;
|
container->pending.width = container->pending.height = 0;
|
||||||
container->width_fraction = container->height_fraction = 0;
|
container->width_fraction = container->height_fraction = 0;
|
||||||
workspace_add_tiling(workspace, container);
|
workspace_add_tiling(workspace, container);
|
||||||
}
|
}
|
||||||
|
|
@ -234,13 +237,13 @@ static void container_move_to_container(struct sway_container *container,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (container_is_floating(container)) {
|
if (container_is_floating(container)) {
|
||||||
container_move_to_workspace(container, destination->workspace);
|
container_move_to_workspace(container, destination->pending.workspace);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
struct sway_workspace *old_workspace = container->workspace;
|
struct sway_workspace *old_workspace = container->pending.workspace;
|
||||||
|
|
||||||
container_detach(container);
|
container_detach(container);
|
||||||
container->width = container->height = 0;
|
container->pending.width = container->pending.height = 0;
|
||||||
container->width_fraction = container->height_fraction = 0;
|
container->width_fraction = container->height_fraction = 0;
|
||||||
|
|
||||||
if (destination->view) {
|
if (destination->view) {
|
||||||
|
|
@ -253,147 +256,154 @@ static void container_move_to_container(struct sway_container *container,
|
||||||
ipc_event_window(container, "move");
|
ipc_event_window(container, "move");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destination->workspace) {
|
if (destination->pending.workspace) {
|
||||||
workspace_focus_fullscreen(destination->workspace);
|
workspace_focus_fullscreen(destination->pending.workspace);
|
||||||
workspace_detect_urgent(destination->workspace);
|
workspace_detect_urgent(destination->pending.workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old_workspace && old_workspace != destination->workspace) {
|
if (old_workspace && old_workspace != destination->pending.workspace) {
|
||||||
workspace_detect_urgent(old_workspace);
|
workspace_detect_urgent(old_workspace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Takes one child, sets it aside, wraps the rest of the children in a new
|
static bool container_move_to_next_output(struct sway_container *container,
|
||||||
* container, switches the layout of the workspace, and drops the child back in.
|
struct sway_output *output, enum wlr_direction move_dir) {
|
||||||
* In other words, rejigger it. */
|
struct sway_output *next_output =
|
||||||
static void workspace_rejigger(struct sway_workspace *ws,
|
output_get_in_direction(output, move_dir);
|
||||||
struct sway_container *child, enum wlr_direction move_dir) {
|
if (next_output) {
|
||||||
if (!child->parent && ws->tiling->length == 1) {
|
struct sway_workspace *ws = output_get_active_workspace(next_output);
|
||||||
ws->layout =
|
if (!sway_assert(ws, "Expected output to have a workspace")) {
|
||||||
move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ?
|
return false;
|
||||||
L_HORIZ : L_VERT;
|
}
|
||||||
workspace_update_representation(ws);
|
switch (container->pending.fullscreen_mode) {
|
||||||
return;
|
case FULLSCREEN_NONE:
|
||||||
|
container_move_to_workspace_from_direction(container, ws, move_dir);
|
||||||
|
return true;
|
||||||
|
case FULLSCREEN_WORKSPACE:
|
||||||
|
container_move_to_workspace(container, ws);
|
||||||
|
return true;
|
||||||
|
case FULLSCREEN_GLOBAL:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
container_detach(child);
|
return false;
|
||||||
workspace_wrap_children(ws);
|
|
||||||
|
|
||||||
int index =
|
|
||||||
move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? 0 : 1;
|
|
||||||
workspace_insert_tiling(ws, child, index);
|
|
||||||
ws->layout =
|
|
||||||
move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ?
|
|
||||||
L_HORIZ : L_VERT;
|
|
||||||
workspace_update_representation(ws);
|
|
||||||
child->width = child->height = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if moved
|
// Returns true if moved
|
||||||
static bool container_move_in_direction(struct sway_container *container,
|
static bool container_move_in_direction(struct sway_container *container,
|
||||||
enum wlr_direction move_dir) {
|
enum wlr_direction move_dir) {
|
||||||
// If moving a fullscreen view, only consider outputs
|
// If moving a fullscreen view, only consider outputs
|
||||||
if (container->fullscreen_mode == FULLSCREEN_WORKSPACE) {
|
switch (container->pending.fullscreen_mode) {
|
||||||
struct sway_output *new_output =
|
case FULLSCREEN_NONE:
|
||||||
output_get_in_direction(container->workspace->output, move_dir);
|
break;
|
||||||
if (!new_output) {
|
case FULLSCREEN_WORKSPACE:
|
||||||
return false;
|
return container_move_to_next_output(container,
|
||||||
}
|
container->pending.workspace->output, move_dir);
|
||||||
struct sway_workspace *ws = output_get_active_workspace(new_output);
|
case FULLSCREEN_GLOBAL:
|
||||||
if (!sway_assert(ws, "Expected output to have a workspace")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
container_move_to_workspace(container, ws);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (container->fullscreen_mode == FULLSCREEN_GLOBAL) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If container is in a split container by itself, move out of the split
|
|
||||||
if (container->parent) {
|
|
||||||
struct sway_container *new_parent =
|
|
||||||
container_flatten(container->parent);
|
|
||||||
if (new_parent != container->parent) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Look for a suitable *container* sibling or parent.
|
|
||||||
// The below loop stops once we hit the workspace because current->parent
|
|
||||||
// is NULL for the topmost containers in a workspace.
|
|
||||||
struct sway_container *current = container;
|
|
||||||
int offs =
|
int offs =
|
||||||
move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? -1 : 1;
|
move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? -1 : 1;
|
||||||
|
int index = -1;
|
||||||
|
int desired = -1;
|
||||||
|
list_t *siblings = NULL;
|
||||||
|
struct sway_container *target = NULL;
|
||||||
|
|
||||||
while (current) {
|
// Look for a suitable ancestor of the container to move within
|
||||||
list_t *siblings = container_get_siblings(current);
|
struct sway_container *ancestor = NULL;
|
||||||
if (siblings) {
|
struct sway_container *current = container;
|
||||||
enum sway_container_layout layout = container_parent_layout(current);
|
bool wrapped = false;
|
||||||
int index = list_find(siblings, current);
|
while (!ancestor) {
|
||||||
int desired = index + offs;
|
// Don't allow containers to move out of their
|
||||||
|
// fullscreen or floating parent
|
||||||
|
if (current->pending.fullscreen_mode || container_is_floating(current)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Don't allow containers to move out of their
|
enum sway_container_layout parent_layout = container_parent_layout(current);
|
||||||
// fullscreen or floating parent
|
if (!is_parallel(parent_layout, move_dir)) {
|
||||||
if (current->fullscreen_mode || container_is_floating(current)) {
|
if (!current->pending.parent) {
|
||||||
return false;
|
// No parallel parent, so we reorient the workspace
|
||||||
|
current = workspace_wrap_children(current->pending.workspace);
|
||||||
|
current->pending.workspace->layout =
|
||||||
|
move_dir == WLR_DIRECTION_LEFT ||
|
||||||
|
move_dir == WLR_DIRECTION_RIGHT ?
|
||||||
|
L_HORIZ : L_VERT;
|
||||||
|
container->pending.height = container->pending.width = 0;
|
||||||
|
container->height_fraction = container->width_fraction = 0;
|
||||||
|
workspace_update_representation(current->pending.workspace);
|
||||||
|
wrapped = true;
|
||||||
|
} else {
|
||||||
|
// Keep looking for a parallel parent
|
||||||
|
current = current->pending.parent;
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_parallel(layout, move_dir)) {
|
// Only scratchpad hidden containers don't have siblings
|
||||||
if (desired == -1 || desired == siblings->length) {
|
// so siblings != NULL here
|
||||||
if (current->parent == container->parent) {
|
siblings = container_get_siblings(current);
|
||||||
current = current->parent;
|
index = list_find(siblings, current);
|
||||||
continue;
|
desired = index + offs;
|
||||||
} else {
|
target = desired == -1 || desired == siblings->length ?
|
||||||
// Reparenting
|
NULL : siblings->items[desired];
|
||||||
if (current->parent) {
|
|
||||||
container_insert_child(current->parent, container,
|
// If the move is simple we can complete it here early
|
||||||
index + (offs < 0 ? 0 : 1));
|
if (current == container) {
|
||||||
} else {
|
if (target) {
|
||||||
struct sway_workspace *ws = current->workspace;
|
// Container will swap with or descend into its neighbor
|
||||||
workspace_insert_tiling(ws,
|
container_move_to_container_from_direction(container,
|
||||||
container_split(container,
|
target, move_dir);
|
||||||
output_get_default_layout(ws->output)),
|
return true;
|
||||||
index + (offs < 0 ? 0 : 1));
|
} else if (!container->pending.parent) {
|
||||||
}
|
// Container is at workspace level so we move it to the
|
||||||
return true;
|
// next workspace if possible
|
||||||
}
|
return container_move_to_next_output(container,
|
||||||
} else {
|
current->pending.workspace->output, move_dir);
|
||||||
// Container can move within its siblings
|
} else {
|
||||||
container_move_to_container_from_direction(container,
|
// Container has escaped its immediate parallel parent
|
||||||
siblings->items[desired], move_dir);
|
current = current->pending.parent;
|
||||||
return true;
|
continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
current = current->parent;
|
// We found a suitable ancestor, the loop will end
|
||||||
|
ancestor = current;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maybe rejigger the workspace
|
if (target) {
|
||||||
struct sway_workspace *ws = container->workspace;
|
// Container will move in with its cousin
|
||||||
if (ws) {
|
container_move_to_container_from_direction(container,
|
||||||
if (!is_parallel(ws->layout, move_dir)) {
|
target, move_dir);
|
||||||
workspace_rejigger(ws, container, move_dir);
|
return true;
|
||||||
return true;
|
} else if (!wrapped && !container->pending.parent->pending.parent &&
|
||||||
} else if (ws->layout == L_TABBED || ws->layout == L_STACKED) {
|
container->pending.parent->pending.children->length == 1) {
|
||||||
workspace_rejigger(ws, container, move_dir);
|
// Treat singleton children as if they are at workspace level like i3
|
||||||
return true;
|
// https://github.com/i3/i3/blob/1d9160f2d247dbaa83fb62f02fd7041dec767fc2/src/move.c#L367
|
||||||
|
return container_move_to_next_output(container,
|
||||||
|
ancestor->pending.workspace->output, move_dir);
|
||||||
|
} else {
|
||||||
|
// Container will be promoted
|
||||||
|
struct sway_container *old_parent = container->pending.parent;
|
||||||
|
if (ancestor->pending.parent) {
|
||||||
|
// Container will move in with its parent
|
||||||
|
container_insert_child(ancestor->pending.parent, container,
|
||||||
|
index + (offs < 0 ? 0 : 1));
|
||||||
|
} else {
|
||||||
|
// Container will move to workspace level,
|
||||||
|
// may be re-split by workspace_layout
|
||||||
|
workspace_insert_tiling(ancestor->pending.workspace, container,
|
||||||
|
index + (offs < 0 ? 0 : 1));
|
||||||
}
|
}
|
||||||
|
ancestor->pending.height = ancestor->pending.width = 0;
|
||||||
// Try adjacent output
|
ancestor->height_fraction = ancestor->width_fraction = 0;
|
||||||
struct sway_output *output =
|
if (old_parent) {
|
||||||
output_get_in_direction(container->workspace->output, move_dir);
|
container_reap_empty(old_parent);
|
||||||
if (output) {
|
|
||||||
struct sway_workspace *ws = output_get_active_workspace(output);
|
|
||||||
if (!sway_assert(ws, "Expected output to have a workspace")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
container_move_to_workspace_from_direction(container, ws, move_dir);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
sway_log(SWAY_DEBUG, "Hit edge of output, nowhere else to go");
|
workspace_squash(container->pending.workspace);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct cmd_results *cmd_move_to_scratchpad(void);
|
static struct cmd_results *cmd_move_to_scratchpad(void);
|
||||||
|
|
@ -417,14 +427,14 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth,
|
||||||
container = workspace_wrap_children(workspace);
|
container = workspace_wrap_children(workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container->fullscreen_mode == FULLSCREEN_GLOBAL) {
|
if (container->pending.fullscreen_mode == FULLSCREEN_GLOBAL) {
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
"Can't move fullscreen global container");
|
"Can't move fullscreen global container");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sway_seat *seat = config->handler_context.seat;
|
struct sway_seat *seat = config->handler_context.seat;
|
||||||
struct sway_container *old_parent = container->parent;
|
struct sway_container *old_parent = container->pending.parent;
|
||||||
struct sway_workspace *old_ws = container->workspace;
|
struct sway_workspace *old_ws = container->pending.workspace;
|
||||||
struct sway_output *old_output = old_ws ? old_ws->output : NULL;
|
struct sway_output *old_output = old_ws ? old_ws->output : NULL;
|
||||||
struct sway_node *destination = NULL;
|
struct sway_node *destination = NULL;
|
||||||
|
|
||||||
|
|
@ -481,7 +491,7 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth,
|
||||||
// We have to create the workspace, but if the container is
|
// We have to create the workspace, but if the container is
|
||||||
// sticky and the workspace is going to be created on the same
|
// sticky and the workspace is going to be created on the same
|
||||||
// output, we'll bail out first.
|
// output, we'll bail out first.
|
||||||
if (container->is_sticky && container_is_floating_or_child(container)) {
|
if (container_is_sticky_or_child(container)) {
|
||||||
struct sway_output *new_output =
|
struct sway_output *new_output =
|
||||||
workspace_get_initial_output(ws_name);
|
workspace_get_initial_output(ws_name);
|
||||||
if (old_output == new_output) {
|
if (old_output == new_output) {
|
||||||
|
|
@ -498,7 +508,7 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth,
|
||||||
destination = dst ? &dst->node : &ws->node;
|
destination = dst ? &dst->node : &ws->node;
|
||||||
} else if (strcasecmp(argv[0], "output") == 0) {
|
} else if (strcasecmp(argv[0], "output") == 0) {
|
||||||
struct sway_output *new_output = output_in_direction(argv[1],
|
struct sway_output *new_output = output_in_direction(argv[1],
|
||||||
old_output, container->x, container->y);
|
old_output, container->pending.x, container->pending.y);
|
||||||
if (!new_output) {
|
if (!new_output) {
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
"Can't find output with name/direction '%s'", argv[1]);
|
"Can't find output with name/direction '%s'", argv[1]);
|
||||||
|
|
@ -520,8 +530,8 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth,
|
||||||
return cmd_move_to_scratchpad();
|
return cmd_move_to_scratchpad();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container->is_sticky && container_is_floating_or_child(container) &&
|
if (container_is_sticky_or_child(container) && old_output &&
|
||||||
old_output && node_has_ancestor(destination, &old_output->node)) {
|
node_has_ancestor(destination, &old_output->node)) {
|
||||||
return cmd_results_new(CMD_FAILURE, "Can't move sticky "
|
return cmd_results_new(CMD_FAILURE, "Can't move sticky "
|
||||||
"container to another workspace on the same output");
|
"container to another workspace on the same output");
|
||||||
}
|
}
|
||||||
|
|
@ -536,7 +546,8 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth,
|
||||||
struct sway_node *focus = seat_get_focus(seat);
|
struct sway_node *focus = seat_get_focus(seat);
|
||||||
|
|
||||||
// move container
|
// move container
|
||||||
if (container->scratchpad) {
|
if (container_is_scratchpad_hidden_or_child(container)) {
|
||||||
|
container_detach(container);
|
||||||
root_scratchpad_show(container);
|
root_scratchpad_show(container);
|
||||||
}
|
}
|
||||||
switch (destination->type) {
|
switch (destination->type) {
|
||||||
|
|
@ -695,12 +706,12 @@ static struct cmd_results *cmd_move_in_direction(
|
||||||
"Cannot move workspaces in a direction");
|
"Cannot move workspaces in a direction");
|
||||||
}
|
}
|
||||||
if (container_is_floating(container)) {
|
if (container_is_floating(container)) {
|
||||||
if (container->fullscreen_mode) {
|
if (container->pending.fullscreen_mode) {
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
"Cannot move fullscreen floating container");
|
"Cannot move fullscreen floating container");
|
||||||
}
|
}
|
||||||
double lx = container->x;
|
double lx = container->pending.x;
|
||||||
double ly = container->y;
|
double ly = container->pending.y;
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case WLR_DIRECTION_LEFT:
|
case WLR_DIRECTION_LEFT:
|
||||||
lx -= move_amt;
|
lx -= move_amt;
|
||||||
|
|
@ -718,14 +729,22 @@ static struct cmd_results *cmd_move_in_direction(
|
||||||
container_floating_move_to(container, lx, ly);
|
container_floating_move_to(container, lx, ly);
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
struct sway_workspace *old_ws = container->workspace;
|
struct sway_workspace *old_ws = container->pending.workspace;
|
||||||
|
struct sway_container *old_parent = container->pending.parent;
|
||||||
|
|
||||||
if (!container_move_in_direction(container, direction)) {
|
if (!container_move_in_direction(container, direction)) {
|
||||||
// Container didn't move
|
// Container didn't move
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sway_workspace *new_ws = container->workspace;
|
// clean-up, destroying parents if the container was the last child
|
||||||
|
if (old_parent) {
|
||||||
|
container_reap_empty(old_parent);
|
||||||
|
} else if (old_ws) {
|
||||||
|
workspace_consider_destroy(old_ws);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct sway_workspace *new_ws = container->pending.workspace;
|
||||||
|
|
||||||
if (root->fullscreen_global) {
|
if (root->fullscreen_global) {
|
||||||
arrange_root();
|
arrange_root();
|
||||||
|
|
@ -762,8 +781,8 @@ static struct cmd_results *cmd_move_to_position_pointer(
|
||||||
}
|
}
|
||||||
struct wlr_cursor *cursor = seat->cursor->cursor;
|
struct wlr_cursor *cursor = seat->cursor->cursor;
|
||||||
/* Determine where to put the window. */
|
/* Determine where to put the window. */
|
||||||
double lx = cursor->x - container->width / 2;
|
double lx = cursor->x - container->pending.width / 2;
|
||||||
double ly = cursor->y - container->height / 2;
|
double ly = cursor->y - container->pending.height / 2;
|
||||||
|
|
||||||
/* Correct target coordinates to be in bounds (on screen). */
|
/* Correct target coordinates to be in bounds (on screen). */
|
||||||
struct wlr_output *output = wlr_output_layout_output_at(
|
struct wlr_output *output = wlr_output_layout_output_at(
|
||||||
|
|
@ -773,11 +792,11 @@ static struct cmd_results *cmd_move_to_position_pointer(
|
||||||
wlr_output_layout_get_box(root->output_layout, output);
|
wlr_output_layout_get_box(root->output_layout, output);
|
||||||
lx = fmax(lx, box->x);
|
lx = fmax(lx, box->x);
|
||||||
ly = fmax(ly, box->y);
|
ly = fmax(ly, box->y);
|
||||||
if (lx + container->width > box->x + box->width) {
|
if (lx + container->pending.width > box->x + box->width) {
|
||||||
lx = box->x + box->width - container->width;
|
lx = box->x + box->width - container->pending.width;
|
||||||
}
|
}
|
||||||
if (ly + container->height > box->y + box->height) {
|
if (ly + container->pending.height > box->y + box->height) {
|
||||||
ly = box->y + box->height - container->height;
|
ly = box->y + box->height - container->pending.height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -827,16 +846,16 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) {
|
||||||
} else if (strcmp(argv[0], "center") == 0) {
|
} else if (strcmp(argv[0], "center") == 0) {
|
||||||
double lx, ly;
|
double lx, ly;
|
||||||
if (absolute) {
|
if (absolute) {
|
||||||
lx = root->x + (root->width - container->width) / 2;
|
lx = root->x + (root->width - container->pending.width) / 2;
|
||||||
ly = root->y + (root->height - container->height) / 2;
|
ly = root->y + (root->height - container->pending.height) / 2;
|
||||||
} else {
|
} else {
|
||||||
struct sway_workspace *ws = container->workspace;
|
struct sway_workspace *ws = container->pending.workspace;
|
||||||
if (!ws) {
|
if (!ws) {
|
||||||
struct sway_seat *seat = config->handler_context.seat;
|
struct sway_seat *seat = config->handler_context.seat;
|
||||||
ws = seat_get_focused_workspace(seat);
|
ws = seat_get_focused_workspace(seat);
|
||||||
}
|
}
|
||||||
lx = ws->x + (ws->width - container->width) / 2;
|
lx = ws->x + (ws->width - container->pending.width) / 2;
|
||||||
ly = ws->y + (ws->height - container->height) / 2;
|
ly = ws->y + (ws->height - container->pending.height) / 2;
|
||||||
}
|
}
|
||||||
container_floating_move_to(container, lx, ly);
|
container_floating_move_to(container, lx, ly);
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
|
@ -867,7 +886,7 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) {
|
||||||
return cmd_results_new(CMD_INVALID, "Invalid y position specified");
|
return cmd_results_new(CMD_INVALID, "Invalid y position specified");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sway_workspace *ws = container->workspace;
|
struct sway_workspace *ws = container->pending.workspace;
|
||||||
if (!ws) {
|
if (!ws) {
|
||||||
struct sway_seat *seat = config->handler_context.seat;
|
struct sway_seat *seat = config->handler_context.seat;
|
||||||
ws = seat_get_focused_workspace(seat);
|
ws = seat_get_focused_workspace(seat);
|
||||||
|
|
@ -941,14 +960,14 @@ static struct cmd_results *cmd_move_to_scratchpad(void) {
|
||||||
// If the container is in a floating split container,
|
// If the container is in a floating split container,
|
||||||
// operate on the split container instead of the child.
|
// operate on the split container instead of the child.
|
||||||
if (container_is_floating_or_child(con)) {
|
if (container_is_floating_or_child(con)) {
|
||||||
while (con->parent) {
|
while (con->pending.parent) {
|
||||||
con = con->parent;
|
con = con->pending.parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!con->scratchpad) {
|
if (!con->scratchpad) {
|
||||||
root_scratchpad_add_container(con, NULL);
|
root_scratchpad_add_container(con, NULL);
|
||||||
} else if (con->workspace) {
|
} else if (con->pending.workspace) {
|
||||||
root_scratchpad_hide(con);
|
root_scratchpad_hide(con);
|
||||||
}
|
}
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
// must be in order for the bsearch
|
// must be in order for the bsearch
|
||||||
static struct cmd_handler output_handlers[] = {
|
static const struct cmd_handler output_handlers[] = {
|
||||||
{ "adaptive_sync", output_cmd_adaptive_sync },
|
{ "adaptive_sync", output_cmd_adaptive_sync },
|
||||||
{ "background", output_cmd_background },
|
{ "background", output_cmd_background },
|
||||||
{ "bg", output_cmd_background },
|
{ "bg", output_cmd_background },
|
||||||
|
|
@ -15,6 +15,7 @@ static struct cmd_handler output_handlers[] = {
|
||||||
{ "enable", output_cmd_enable },
|
{ "enable", output_cmd_enable },
|
||||||
{ "max_render_time", output_cmd_max_render_time },
|
{ "max_render_time", output_cmd_max_render_time },
|
||||||
{ "mode", output_cmd_mode },
|
{ "mode", output_cmd_mode },
|
||||||
|
{ "modeline", output_cmd_modeline },
|
||||||
{ "pos", output_cmd_position },
|
{ "pos", output_cmd_position },
|
||||||
{ "position", output_cmd_position },
|
{ "position", output_cmd_position },
|
||||||
{ "res", output_cmd_mode },
|
{ "res", output_cmd_mode },
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#include "sway/commands.h"
|
#include "sway/commands.h"
|
||||||
#include "sway/config.h"
|
#include "sway/config.h"
|
||||||
|
#include "sway/output.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include <strings.h>
|
||||||
|
|
||||||
struct cmd_results *output_cmd_dpms(int argc, char **argv) {
|
struct cmd_results *output_cmd_dpms(int argc, char **argv) {
|
||||||
if (!config->handler_context.output_config) {
|
if (!config->handler_context.output_config) {
|
||||||
|
|
@ -10,7 +12,28 @@ struct cmd_results *output_cmd_dpms(int argc, char **argv) {
|
||||||
return cmd_results_new(CMD_INVALID, "Missing dpms argument.");
|
return cmd_results_new(CMD_INVALID, "Missing dpms argument.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parse_boolean(argv[0], true)) {
|
enum config_dpms current_dpms = DPMS_ON;
|
||||||
|
|
||||||
|
if (strcasecmp(argv[0], "toggle") == 0) {
|
||||||
|
|
||||||
|
const char *oc_name = config->handler_context.output_config->name;
|
||||||
|
if (strcmp(oc_name, "*") == 0) {
|
||||||
|
return cmd_results_new(CMD_INVALID,
|
||||||
|
"Cannot apply toggle to all outputs.");
|
||||||
|
}
|
||||||
|
|
||||||
|
struct sway_output *sway_output = all_output_by_name_or_id(oc_name);
|
||||||
|
if (!sway_output || !sway_output->wlr_output) {
|
||||||
|
return cmd_results_new(CMD_FAILURE,
|
||||||
|
"Cannot apply toggle to unknown output %s", oc_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sway_output->enabled && !sway_output->wlr_output->enabled) {
|
||||||
|
current_dpms = DPMS_OFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parse_boolean(argv[0], current_dpms == DPMS_ON)) {
|
||||||
config->handler_context.output_config->dpms_state = DPMS_ON;
|
config->handler_context.output_config->dpms_state = DPMS_ON;
|
||||||
} else {
|
} else {
|
||||||
config->handler_context.output_config->dpms_state = DPMS_OFF;
|
config->handler_context.output_config->dpms_state = DPMS_OFF;
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@ struct cmd_results *output_cmd_mode(int argc, char **argv) {
|
||||||
output->custom_mode = 0;
|
output->custom_mode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset custom modeline, if any
|
||||||
|
output->drm_mode.type = 0;
|
||||||
|
|
||||||
char *end;
|
char *end;
|
||||||
output->width = strtol(*argv, &end, 10);
|
output->width = strtol(*argv, &end, 10);
|
||||||
if (*end) {
|
if (*end) {
|
||||||
|
|
@ -58,3 +61,58 @@ struct cmd_results *output_cmd_mode(int argc, char **argv) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool parse_modeline(char **argv, drmModeModeInfo *mode) {
|
||||||
|
mode->type = DRM_MODE_TYPE_USERDEF;
|
||||||
|
mode->clock = strtof(argv[0], NULL) * 1000;
|
||||||
|
mode->hdisplay = strtol(argv[1], NULL, 10);
|
||||||
|
mode->hsync_start = strtol(argv[2], NULL, 10);
|
||||||
|
mode->hsync_end = strtol(argv[3], NULL, 10);
|
||||||
|
mode->htotal = strtol(argv[4], NULL, 10);
|
||||||
|
mode->vdisplay = strtol(argv[5], NULL, 10);
|
||||||
|
mode->vsync_start = strtol(argv[6], NULL, 10);
|
||||||
|
mode->vsync_end = strtol(argv[7], NULL, 10);
|
||||||
|
mode->vtotal = strtol(argv[8], NULL, 10);
|
||||||
|
|
||||||
|
mode->vrefresh = mode->clock * 1000.0 * 1000.0
|
||||||
|
/ mode->htotal / mode->vtotal;
|
||||||
|
if (strcasecmp(argv[9], "+hsync") == 0) {
|
||||||
|
mode->flags |= DRM_MODE_FLAG_PHSYNC;
|
||||||
|
} else if (strcasecmp(argv[9], "-hsync") == 0) {
|
||||||
|
mode->flags |= DRM_MODE_FLAG_NHSYNC;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcasecmp(argv[10], "+vsync") == 0) {
|
||||||
|
mode->flags |= DRM_MODE_FLAG_PVSYNC;
|
||||||
|
} else if (strcasecmp(argv[10], "-vsync") == 0) {
|
||||||
|
mode->flags |= DRM_MODE_FLAG_NVSYNC;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
snprintf(mode->name, sizeof(mode->name), "%dx%d@%d",
|
||||||
|
mode->hdisplay, mode->vdisplay, mode->vrefresh / 1000);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct cmd_results *output_cmd_modeline(int argc, char **argv) {
|
||||||
|
if (!config->handler_context.output_config) {
|
||||||
|
return cmd_results_new(CMD_FAILURE, "Missing output config");
|
||||||
|
}
|
||||||
|
if (!argc) {
|
||||||
|
return cmd_results_new(CMD_INVALID, "Missing modeline argument.");
|
||||||
|
}
|
||||||
|
|
||||||
|
struct output_config *output = config->handler_context.output_config;
|
||||||
|
|
||||||
|
if (argc != 11 || !parse_modeline(argv, &output->drm_mode)) {
|
||||||
|
return cmd_results_new(CMD_INVALID, "Invalid modeline");
|
||||||
|
}
|
||||||
|
|
||||||
|
config->handler_context.leftovers.argc = argc - 12;
|
||||||
|
config->handler_context.leftovers.argv = argv + 12;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ static void do_reload(void *data) {
|
||||||
}
|
}
|
||||||
list_free_items_and_destroy(bar_ids);
|
list_free_items_and_destroy(bar_ids);
|
||||||
|
|
||||||
config_update_font_height(true);
|
|
||||||
root_for_each_container(rebuild_textures_iterator, NULL);
|
root_for_each_container(rebuild_textures_iterator, NULL);
|
||||||
|
|
||||||
arrange_root();
|
arrange_root();
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ struct sway_container *container_find_resize_parent(struct sway_container *con,
|
||||||
(allow_last || index < siblings->length - 1)) {
|
(allow_last || index < siblings->length - 1)) {
|
||||||
return con;
|
return con;
|
||||||
}
|
}
|
||||||
con = con->parent;
|
con = con->pending.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -115,13 +115,13 @@ void container_resize_tiled(struct sway_container *con,
|
||||||
int sibling_amount = prev ? ceil((double)amount / 2.0) : amount;
|
int sibling_amount = prev ? ceil((double)amount / 2.0) : amount;
|
||||||
|
|
||||||
if (is_horizontal(axis)) {
|
if (is_horizontal(axis)) {
|
||||||
if (con->width + amount < MIN_SANE_W) {
|
if (con->pending.width + amount < MIN_SANE_W) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (next->width - sibling_amount < MIN_SANE_W) {
|
if (next->pending.width - sibling_amount < MIN_SANE_W) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (prev && prev->width - sibling_amount < MIN_SANE_W) {
|
if (prev && prev->pending.width - sibling_amount < MIN_SANE_W) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (con->child_total_width <= 0) {
|
if (con->child_total_width <= 0) {
|
||||||
|
|
@ -133,7 +133,7 @@ void container_resize_tiled(struct sway_container *con,
|
||||||
list_t *siblings = container_get_siblings(con);
|
list_t *siblings = container_get_siblings(con);
|
||||||
for (int i = 0; i < siblings->length; ++i) {
|
for (int i = 0; i < siblings->length; ++i) {
|
||||||
struct sway_container *con = siblings->items[i];
|
struct sway_container *con = siblings->items[i];
|
||||||
con->width_fraction = con->width / con->child_total_width;
|
con->width_fraction = con->pending.width / con->child_total_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
double amount_fraction = (double)amount / con->child_total_width;
|
double amount_fraction = (double)amount / con->child_total_width;
|
||||||
|
|
@ -146,13 +146,13 @@ void container_resize_tiled(struct sway_container *con,
|
||||||
prev->width_fraction -= sibling_amount_fraction;
|
prev->width_fraction -= sibling_amount_fraction;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (con->height + amount < MIN_SANE_H) {
|
if (con->pending.height + amount < MIN_SANE_H) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (next->height - sibling_amount < MIN_SANE_H) {
|
if (next->pending.height - sibling_amount < MIN_SANE_H) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (prev && prev->height - sibling_amount < MIN_SANE_H) {
|
if (prev && prev->pending.height - sibling_amount < MIN_SANE_H) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (con->child_total_height <= 0) {
|
if (con->child_total_height <= 0) {
|
||||||
|
|
@ -164,7 +164,7 @@ void container_resize_tiled(struct sway_container *con,
|
||||||
list_t *siblings = container_get_siblings(con);
|
list_t *siblings = container_get_siblings(con);
|
||||||
for (int i = 0; i < siblings->length; ++i) {
|
for (int i = 0; i < siblings->length; ++i) {
|
||||||
struct sway_container *con = siblings->items[i];
|
struct sway_container *con = siblings->items[i];
|
||||||
con->height_fraction = con->height / con->child_total_height;
|
con->height_fraction = con->pending.height / con->child_total_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
double amount_fraction = (double)amount / con->child_total_height;
|
double amount_fraction = (double)amount / con->child_total_height;
|
||||||
|
|
@ -178,10 +178,10 @@ void container_resize_tiled(struct sway_container *con,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (con->parent) {
|
if (con->pending.parent) {
|
||||||
arrange_container(con->parent);
|
arrange_container(con->pending.parent);
|
||||||
} else {
|
} else {
|
||||||
arrange_workspace(con->workspace);
|
arrange_workspace(con->pending.workspace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -203,15 +203,15 @@ static struct cmd_results *resize_adjust_floating(uint32_t axis,
|
||||||
int min_width, max_width, min_height, max_height;
|
int min_width, max_width, min_height, max_height;
|
||||||
floating_calculate_constraints(&min_width, &max_width,
|
floating_calculate_constraints(&min_width, &max_width,
|
||||||
&min_height, &max_height);
|
&min_height, &max_height);
|
||||||
if (con->width + grow_width < min_width) {
|
if (con->pending.width + grow_width < min_width) {
|
||||||
grow_width = min_width - con->width;
|
grow_width = min_width - con->pending.width;
|
||||||
} else if (con->width + grow_width > max_width) {
|
} else if (con->pending.width + grow_width > max_width) {
|
||||||
grow_width = max_width - con->width;
|
grow_width = max_width - con->pending.width;
|
||||||
}
|
}
|
||||||
if (con->height + grow_height < min_height) {
|
if (con->pending.height + grow_height < min_height) {
|
||||||
grow_height = min_height - con->height;
|
grow_height = min_height - con->pending.height;
|
||||||
} else if (con->height + grow_height > max_height) {
|
} else if (con->pending.height + grow_height > max_height) {
|
||||||
grow_height = max_height - con->height;
|
grow_height = max_height - con->pending.height;
|
||||||
}
|
}
|
||||||
int grow_x = 0, grow_y = 0;
|
int grow_x = 0, grow_y = 0;
|
||||||
|
|
||||||
|
|
@ -224,18 +224,18 @@ static struct cmd_results *resize_adjust_floating(uint32_t axis,
|
||||||
} else if (axis == WLR_EDGE_LEFT) {
|
} else if (axis == WLR_EDGE_LEFT) {
|
||||||
grow_x = -grow_width;
|
grow_x = -grow_width;
|
||||||
}
|
}
|
||||||
if (grow_x == 0 && grow_y == 0) {
|
if (grow_width == 0 && grow_height == 0) {
|
||||||
return cmd_results_new(CMD_INVALID, "Cannot resize any further");
|
return cmd_results_new(CMD_INVALID, "Cannot resize any further");
|
||||||
}
|
}
|
||||||
con->x += grow_x;
|
con->pending.x += grow_x;
|
||||||
con->y += grow_y;
|
con->pending.y += grow_y;
|
||||||
con->width += grow_width;
|
con->pending.width += grow_width;
|
||||||
con->height += grow_height;
|
con->pending.height += grow_height;
|
||||||
|
|
||||||
con->content_x += grow_x;
|
con->pending.content_x += grow_x;
|
||||||
con->content_y += grow_y;
|
con->pending.content_y += grow_y;
|
||||||
con->content_width += grow_width;
|
con->pending.content_width += grow_width;
|
||||||
con->content_height += grow_height;
|
con->pending.content_height += grow_height;
|
||||||
|
|
||||||
arrange_container(con);
|
arrange_container(con);
|
||||||
|
|
||||||
|
|
@ -256,9 +256,9 @@ static struct cmd_results *resize_adjust_tiled(uint32_t axis,
|
||||||
float pct = amount->amount / 100.0f;
|
float pct = amount->amount / 100.0f;
|
||||||
|
|
||||||
if (is_horizontal(axis)) {
|
if (is_horizontal(axis)) {
|
||||||
amount->amount = (float)current->width * pct;
|
amount->amount = (float)current->pending.width * pct;
|
||||||
} else {
|
} else {
|
||||||
amount->amount = (float)current->height * pct;
|
amount->amount = (float)current->pending.height * pct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -281,20 +281,20 @@ static struct cmd_results *resize_set_tiled(struct sway_container *con,
|
||||||
if (width->unit == MOVEMENT_UNIT_PPT ||
|
if (width->unit == MOVEMENT_UNIT_PPT ||
|
||||||
width->unit == MOVEMENT_UNIT_DEFAULT) {
|
width->unit == MOVEMENT_UNIT_DEFAULT) {
|
||||||
// Convert to px
|
// Convert to px
|
||||||
struct sway_container *parent = con->parent;
|
struct sway_container *parent = con->pending.parent;
|
||||||
while (parent && parent->layout != L_HORIZ) {
|
while (parent && parent->pending.layout != L_HORIZ) {
|
||||||
parent = parent->parent;
|
parent = parent->pending.parent;
|
||||||
}
|
}
|
||||||
if (parent) {
|
if (parent) {
|
||||||
width->amount = parent->width * width->amount / 100;
|
width->amount = parent->pending.width * width->amount / 100;
|
||||||
} else {
|
} else {
|
||||||
width->amount = con->workspace->width * width->amount / 100;
|
width->amount = con->pending.workspace->width * width->amount / 100;
|
||||||
}
|
}
|
||||||
width->unit = MOVEMENT_UNIT_PX;
|
width->unit = MOVEMENT_UNIT_PX;
|
||||||
}
|
}
|
||||||
if (width->unit == MOVEMENT_UNIT_PX) {
|
if (width->unit == MOVEMENT_UNIT_PX) {
|
||||||
container_resize_tiled(con, AXIS_HORIZONTAL,
|
container_resize_tiled(con, AXIS_HORIZONTAL,
|
||||||
width->amount - con->width);
|
width->amount - con->pending.width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -302,20 +302,20 @@ static struct cmd_results *resize_set_tiled(struct sway_container *con,
|
||||||
if (height->unit == MOVEMENT_UNIT_PPT ||
|
if (height->unit == MOVEMENT_UNIT_PPT ||
|
||||||
height->unit == MOVEMENT_UNIT_DEFAULT) {
|
height->unit == MOVEMENT_UNIT_DEFAULT) {
|
||||||
// Convert to px
|
// Convert to px
|
||||||
struct sway_container *parent = con->parent;
|
struct sway_container *parent = con->pending.parent;
|
||||||
while (parent && parent->layout != L_VERT) {
|
while (parent && parent->pending.layout != L_VERT) {
|
||||||
parent = parent->parent;
|
parent = parent->pending.parent;
|
||||||
}
|
}
|
||||||
if (parent) {
|
if (parent) {
|
||||||
height->amount = parent->height * height->amount / 100;
|
height->amount = parent->pending.height * height->amount / 100;
|
||||||
} else {
|
} else {
|
||||||
height->amount = con->workspace->height * height->amount / 100;
|
height->amount = con->pending.workspace->height * height->amount / 100;
|
||||||
}
|
}
|
||||||
height->unit = MOVEMENT_UNIT_PX;
|
height->unit = MOVEMENT_UNIT_PX;
|
||||||
}
|
}
|
||||||
if (height->unit == MOVEMENT_UNIT_PX) {
|
if (height->unit == MOVEMENT_UNIT_PX) {
|
||||||
container_resize_tiled(con, AXIS_VERTICAL,
|
container_resize_tiled(con, AXIS_VERTICAL,
|
||||||
height->amount - con->height);
|
height->amount - con->pending.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -339,15 +339,15 @@ static struct cmd_results *resize_set_floating(struct sway_container *con,
|
||||||
"Cannot resize a hidden scratchpad container by ppt");
|
"Cannot resize a hidden scratchpad container by ppt");
|
||||||
}
|
}
|
||||||
// Convert to px
|
// Convert to px
|
||||||
width->amount = con->workspace->width * width->amount / 100;
|
width->amount = con->pending.workspace->width * width->amount / 100;
|
||||||
width->unit = MOVEMENT_UNIT_PX;
|
width->unit = MOVEMENT_UNIT_PX;
|
||||||
// Falls through
|
// Falls through
|
||||||
case MOVEMENT_UNIT_PX:
|
case MOVEMENT_UNIT_PX:
|
||||||
case MOVEMENT_UNIT_DEFAULT:
|
case MOVEMENT_UNIT_DEFAULT:
|
||||||
width->amount = fmax(min_width, fmin(width->amount, max_width));
|
width->amount = fmax(min_width, fmin(width->amount, max_width));
|
||||||
grow_width = width->amount - con->width;
|
grow_width = width->amount - con->pending.width;
|
||||||
con->x -= grow_width / 2;
|
con->pending.x -= grow_width / 2;
|
||||||
con->width = width->amount;
|
con->pending.width = width->amount;
|
||||||
break;
|
break;
|
||||||
case MOVEMENT_UNIT_INVALID:
|
case MOVEMENT_UNIT_INVALID:
|
||||||
sway_assert(false, "invalid width unit");
|
sway_assert(false, "invalid width unit");
|
||||||
|
|
@ -363,15 +363,15 @@ static struct cmd_results *resize_set_floating(struct sway_container *con,
|
||||||
"Cannot resize a hidden scratchpad container by ppt");
|
"Cannot resize a hidden scratchpad container by ppt");
|
||||||
}
|
}
|
||||||
// Convert to px
|
// Convert to px
|
||||||
height->amount = con->workspace->height * height->amount / 100;
|
height->amount = con->pending.workspace->height * height->amount / 100;
|
||||||
height->unit = MOVEMENT_UNIT_PX;
|
height->unit = MOVEMENT_UNIT_PX;
|
||||||
// Falls through
|
// Falls through
|
||||||
case MOVEMENT_UNIT_PX:
|
case MOVEMENT_UNIT_PX:
|
||||||
case MOVEMENT_UNIT_DEFAULT:
|
case MOVEMENT_UNIT_DEFAULT:
|
||||||
height->amount = fmax(min_height, fmin(height->amount, max_height));
|
height->amount = fmax(min_height, fmin(height->amount, max_height));
|
||||||
grow_height = height->amount - con->height;
|
grow_height = height->amount - con->pending.height;
|
||||||
con->y -= grow_height / 2;
|
con->pending.y -= grow_height / 2;
|
||||||
con->height = height->amount;
|
con->pending.height = height->amount;
|
||||||
break;
|
break;
|
||||||
case MOVEMENT_UNIT_INVALID:
|
case MOVEMENT_UNIT_INVALID:
|
||||||
sway_assert(false, "invalid height unit");
|
sway_assert(false, "invalid height unit");
|
||||||
|
|
@ -379,10 +379,10 @@ static struct cmd_results *resize_set_floating(struct sway_container *con,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
con->content_x -= grow_width / 2;
|
con->pending.content_x -= grow_width / 2;
|
||||||
con->content_y -= grow_height / 2;
|
con->pending.content_y -= grow_height / 2;
|
||||||
con->content_width += grow_width;
|
con->pending.content_width += grow_width;
|
||||||
con->content_height += grow_height;
|
con->pending.content_height += grow_height;
|
||||||
|
|
||||||
arrange_container(con);
|
arrange_container(con);
|
||||||
|
|
||||||
|
|
@ -437,10 +437,10 @@ static struct cmd_results *cmd_resize_set(int argc, char **argv) {
|
||||||
// If 0, don't resize that dimension
|
// If 0, don't resize that dimension
|
||||||
struct sway_container *con = config->handler_context.container;
|
struct sway_container *con = config->handler_context.container;
|
||||||
if (width.amount <= 0) {
|
if (width.amount <= 0) {
|
||||||
width.amount = con->width;
|
width.amount = con->pending.width;
|
||||||
}
|
}
|
||||||
if (height.amount <= 0) {
|
if (height.amount <= 0) {
|
||||||
height.amount = con->height;
|
height.amount = con->pending.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container_is_floating(con)) {
|
if (container_is_floating(con)) {
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ static void scratchpad_toggle_auto(void) {
|
||||||
// If the focus is in a floating split container,
|
// If the focus is in a floating split container,
|
||||||
// operate on the split container instead of the child.
|
// operate on the split container instead of the child.
|
||||||
if (focus && container_is_floating_or_child(focus)) {
|
if (focus && container_is_floating_or_child(focus)) {
|
||||||
while (focus->parent) {
|
while (focus->pending.parent) {
|
||||||
focus = focus->parent;
|
focus = focus->pending.parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,7 +52,7 @@ static void scratchpad_toggle_auto(void) {
|
||||||
// In this case we move it to the current workspace.
|
// In this case we move it to the current workspace.
|
||||||
for (int i = 0; i < root->scratchpad->length; ++i) {
|
for (int i = 0; i < root->scratchpad->length; ++i) {
|
||||||
struct sway_container *con = root->scratchpad->items[i];
|
struct sway_container *con = root->scratchpad->items[i];
|
||||||
if (con->parent) {
|
if (con->pending.parent) {
|
||||||
sway_log(SWAY_DEBUG,
|
sway_log(SWAY_DEBUG,
|
||||||
"Moving a visible scratchpad window (%s) to this workspace",
|
"Moving a visible scratchpad window (%s) to this workspace",
|
||||||
con->title);
|
con->title);
|
||||||
|
|
@ -80,7 +80,7 @@ static void scratchpad_toggle_container(struct sway_container *con) {
|
||||||
struct sway_seat *seat = input_manager_current_seat();
|
struct sway_seat *seat = input_manager_current_seat();
|
||||||
struct sway_workspace *ws = seat_get_focused_workspace(seat);
|
struct sway_workspace *ws = seat_get_focused_workspace(seat);
|
||||||
// Check if it matches a currently visible scratchpad window and hide it.
|
// Check if it matches a currently visible scratchpad window and hide it.
|
||||||
if (con->workspace && ws == con->workspace) {
|
if (con->pending.workspace && ws == con->pending.workspace) {
|
||||||
root_scratchpad_hide(con);
|
root_scratchpad_hide(con);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -105,21 +105,22 @@ struct cmd_results *cmd_scratchpad(int argc, char **argv) {
|
||||||
return cmd_results_new(CMD_INVALID, "Scratchpad is empty");
|
return cmd_results_new(CMD_INVALID, "Scratchpad is empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->handler_context.using_criteria) {
|
if (config->handler_context.node_overridden) {
|
||||||
struct sway_container *con = config->handler_context.container;
|
struct sway_container *con = config->handler_context.container;
|
||||||
|
|
||||||
// If the container is in a floating split container,
|
// If the container is in a floating split container,
|
||||||
// operate on the split container instead of the child.
|
// operate on the split container instead of the child.
|
||||||
if (container_is_floating_or_child(con)) {
|
if (con && container_is_floating_or_child(con)) {
|
||||||
while (con->parent) {
|
while (con->pending.parent) {
|
||||||
con = con->parent;
|
con = con->pending.parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If using criteria, this command is executed for every container which
|
// If using criteria, this command is executed for every container which
|
||||||
// matches the criteria. If this container isn't in the scratchpad,
|
// matches the criteria. If this container isn't in the scratchpad,
|
||||||
// we'll just silently return a success.
|
// we'll just silently return a success. The same is true if the
|
||||||
if (!con->scratchpad) {
|
// overridden node is not a container.
|
||||||
|
if (!con || !con->scratchpad) {
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
scratchpad_toggle_container(con);
|
scratchpad_toggle_container(con);
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,13 @@
|
||||||
|
|
||||||
// must be in order for the bsearch
|
// must be in order for the bsearch
|
||||||
// these handlers perform actions on the seat
|
// these handlers perform actions on the seat
|
||||||
static struct cmd_handler seat_action_handlers[] = {
|
static const struct cmd_handler seat_action_handlers[] = {
|
||||||
{ "cursor", seat_cmd_cursor },
|
{ "cursor", seat_cmd_cursor },
|
||||||
};
|
};
|
||||||
|
|
||||||
// must be in order for the bsearch
|
// must be in order for the bsearch
|
||||||
// these handlers alter the seat config
|
// these handlers alter the seat config
|
||||||
static struct cmd_handler seat_handlers[] = {
|
static const struct cmd_handler seat_handlers[] = {
|
||||||
{ "attach", seat_cmd_attach },
|
{ "attach", seat_cmd_attach },
|
||||||
{ "fallback", seat_cmd_fallback },
|
{ "fallback", seat_cmd_fallback },
|
||||||
{ "hide_cursor", seat_cmd_hide_cursor },
|
{ "hide_cursor", seat_cmd_hide_cursor },
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue