Zren / material-decoration

Material-ish window decoration theme for KWin, with LIM, based on zzag's original design.
GNU General Public License v2.0
199 stars 17 forks source link

AUR Package #14

Open lucazade opened 4 years ago

lucazade commented 4 years ago

I would be nice to have an AUR package for ArchLinux and Manjaro

Zren commented 4 years ago

I've modified an existing AUR package, but never created one before. So this will be a learning experience.

https://wiki.archlinux.org/index.php/AUR_submission_guidelines#Creating_package_repositories

For the package name, I'll probably use material-decoration-git or kwin-decoration-material-git. Searching for decoration finds:

fluent-decoration-git changed the namespace from com.github.zzag.material to com.github.sunnjek.fluent. I should probably do that too, and maybe rename the project to differentiate from @zzag's (archived) project. That'll break the existing install base though.

zzag commented 4 years ago

I should probably do that too, and maybe rename the project to differentiate from @zzag's (archived) project.

Yeah, it's a good idea. I wonder if it's possible to move the ownership of a repo to somebody else so the fork becomes "a new upstream."

Feel free to change the plugin id and keep the existing name.

Zren commented 4 years ago

I was reluctant to change the id without changing the name as existing users may end up with 2 installed versions of it, requiring notifying everyone to do this:

git checkout v0
cd build
sudo make uninstall
git checkout master
# build + install...

However since the .so file is overwriten, that not a problem.


It doesn't look like the Id matters for the installation, as it's installed to:

/usr/lib/qt/plugins/org.kde.kdecoration2/materialdecoration.so

Other's don't use the Id in the filename either.

$ ls /usr/lib/qt/plugins/org.kde.kdecoration2
breezedecoration.so  breezeenhanced.so  kwin5_aurorae.so  materialdecoration.so  sierrabreezeenhanced.so

So changing the Id will overwrite the existing *.so file. So the user will not end up with 2 installed version of the kdecoration (I need to confirm this after supper).

The main issue with existing users is the need to switch to Breeze first, then reinstall Material, then select Material again. As they currently have:

# ~/.config/kwinrc
[org.kde.kdecoration2]
library=com.github.zzag.material
theme=Material

I'm not sure if Plastic or Breeze is used if kwinrc has an invalid library.

zzag commented 4 years ago

I'm not sure if Plastic or Breeze is used if kwinrc has an invalid library.

It depends on whether Breeze is available at compile-time. If it is, kwin will fallback to breeze; otherwise it will fallback to plastik.

lucazade commented 4 years ago

thanks for the ongoing work.. any update on this? :)

Zren commented 4 years ago

https://aur.archlinux.org/packages/material-kwin-decoration-git/ Tell me if there's any issue.

I used gnome-shell-git as a base for creating a pretty pkgver. Used a few other tricks from fluent-decoration-git too.

zzag commented 4 years ago

You don't need to specify -DCMAKE_BUILD_TYPE and -DCMAKE_INSTALL_PREFIX, makepkg will pick up the right ones.

You could also get rid of prepare() by specifying the build directory in the cmake command, e.g. cmake -B builddir -S sourcedir -Dfoobar, see https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=plasma5-wallpapers-dynamic

Zren commented 4 years ago

Needed to add extra-cmake-modules (mentioned in a comment on AUR). I've removed prepare() to use cmake -B "build" and make -C "build". I'll keep cmake --build and cmake --install in mind, as this is the first I've heard of them.

lucazade commented 4 years ago

Thanks for the package.. works great! I just add the prepare section in order to fix some params in src (please make them configurable!)

prepare() {
  cd "${srcdir}/${_pkgname}"
  git submodule init
  git submodule update

  sed -i 's/s_titleBarOpacityActive = 0.75/s_titleBarOpacityActive = 1.0/g' ${srcdir}/material-kwin-decoration/src/Decoration.cc
  sed -i 's/s_titleBarOpacityInactive = 0.85/s_titleBarOpacityInactive = 1.0/g' ${srcdir}/material-kwin-decoration/src/Decoration.cc
  sed -i 's/"blur": true/"blur": false/g' ${srcdir}/material-kwin-decoration/src/material.json
}