Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
dd26ad8b82 |
4 changed files with 11 additions and 21 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,4 +0,0 @@
|
||||||
pkg/
|
|
||||||
src/
|
|
||||||
sway-dynamic-*/
|
|
||||||
sway-dynamic-*.pkg.tar.zst
|
|
4
PKGBUILD
4
PKGBUILD
|
@ -1,13 +1,13 @@
|
||||||
# Maintainer redxef <redxef@redxef.at>
|
# Maintainer redxef <redxef@redxef.at>
|
||||||
pkgname=sway-dynamic
|
pkgname=sway-dynamic
|
||||||
pkgver=1.0.1
|
pkgver=1.0.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Helper files to dynamically launch sway for NVIDIA comaptibility or not"
|
pkgdesc="Helper files to dynamically launch sway for NVIDIA comaptibility or not"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://gitea.redxef.at/redxef/sway-dynamic"
|
url="https://gitea.redxef.at/redxef/sway-dynamic"
|
||||||
license=('MIT')
|
license=('MIT')
|
||||||
depends=('sway' 'sway-nvidia')
|
depends=('sway' 'sway-nvidia')
|
||||||
source=("$pkgname-$pkgver::git+$url.git#tag=v$pkgver")
|
source=("$pkgname-$pkgver::git+$url.git#tag=$pkgver")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
|
11
README.md
11
README.md
|
@ -4,6 +4,11 @@ Dynamically switch between sway and sway-nvidia based on active gpu.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Blacklist the module which should not be loaded on boot, the script
|
When booting a GPU set the environment variable `GPUMODE=<driver>` with something
|
||||||
detects if the `nvidia` or `nouveau` driver is loaded and either calls
|
like `systemd.setenv=GPUMODE=<driver>`. The script will decide how to
|
||||||
`sway-nvidia` or `sway`.
|
launch sway depending on this variable. Possible values:
|
||||||
|
|
||||||
|
- `nvidia`
|
||||||
|
- `nouveau`
|
||||||
|
|
||||||
|
|
||||||
|
|
13
sway-dynamic
13
sway-dynamic
|
@ -1,17 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
active_module() {
|
if [ "$GPUMODE" = 'nvidia' ]; then
|
||||||
if [ -n "$(lsmod | grep "nvidia")" ]; then
|
|
||||||
echo "nvidia"
|
|
||||||
elif [ -n "$(lsmod | grep "nouveau")" ]; then
|
|
||||||
echo nouveau
|
|
||||||
else
|
|
||||||
# no nvidia modules loaded
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$(active_module)" = 'nvidia' ]; then
|
|
||||||
exec sway-nvidia
|
exec sway-nvidia
|
||||||
else
|
else
|
||||||
exec sway
|
exec sway
|
||||||
|
|
Loading…
Add table
Reference in a new issue