Initial implementation.
This commit is contained in:
parent
bc6d6815b7
commit
dd26ad8b82
4 changed files with 41 additions and 1 deletions
17
PKGBUILD
Normal file
17
PKGBUILD
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Maintainer redxef <redxef@redxef.at>
|
||||||
|
pkgname=sway-dynamic
|
||||||
|
pkgver=1.0.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="Helper files to dynamically launch sway for NVIDIA comaptibility or not"
|
||||||
|
arch=('any')
|
||||||
|
url="https://gitea.redxef.at/redxef/sway-dynamic"
|
||||||
|
license=('MIT')
|
||||||
|
depends=('sway' 'sway-nvidia')
|
||||||
|
source=("$pkgname-$pkgver::git+$url.git#tag=$pkgver")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
install -Dm755 sway-dynamic "$pkgdir/usr/bin/sway-dynamic"
|
||||||
|
install -Dm644 sway-dynamic.desktop "$pkgdir/usr/share/wayland-sessions/sway-dynamic.desktop"
|
||||||
|
}
|
13
README.md
13
README.md
|
@ -1,3 +1,14 @@
|
||||||
# sway-dynamic
|
# sway-dynamic
|
||||||
|
|
||||||
Dynamically switch between sway and sway-nvidia based on active gpu.
|
Dynamically switch between sway and sway-nvidia based on active gpu.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
When booting a GPU set the environment variable `GPUMODE=<driver>` with something
|
||||||
|
like `systemd.setenv=GPUMODE=<driver>`. The script will decide how to
|
||||||
|
launch sway depending on this variable. Possible values:
|
||||||
|
|
||||||
|
- `nvidia`
|
||||||
|
- `nouveau`
|
||||||
|
|
||||||
|
|
||||||
|
|
7
sway-dynamic
Executable file
7
sway-dynamic
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$GPUMODE" = 'nvidia' ]; then
|
||||||
|
exec sway-nvidia
|
||||||
|
else
|
||||||
|
exec sway
|
||||||
|
fi
|
5
sway-dynamic.desktop
Normal file
5
sway-dynamic.desktop
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=Sway (Dynamic)
|
||||||
|
Comment=An i3-compatible Wayland compositor (NVIDIA Fixes or Standard)
|
||||||
|
Exec=sway-dynamic
|
||||||
|
Type=Application
|
Loading…
Reference in a new issue