Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Make the operating system version show in Steam #10

Merged
merged 2 commits into from
Aug 23, 2019

Conversation

sharkwouter
Copy link
Contributor

I created a script which pretends to be dpkg-query in a bin directory specific to this package. I also moved the set_hd_mode.sh script there, since directories have no place in /usr/bin.

To deploy this, I also made some changes to the PKGBUILD for steamos-compositor-plus. If you were to tag this release with version 1.3.0, then this patch should be all you need:

diff --git a/PKGBUILD b/PKGBUILD
index 0c33b57..740d0ce 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,19 +4,19 @@
 #              Christoph Haag <haagch@studi,informatik.uni-stuttgart.de>
 #              WorMzy Tykashi <wormzy.tykashi@gmail.com>
 pkgname=steamos-compositor-plus
-pkgver=1.2.0
+pkgver=1.3.0
 pkgrel=1
 pkgdesc="Compositor used by SteamOS with some added tweaks and fixes"
 arch=('i686' 'x86_64')
 url="https://github.com/gamer-os/steamos-compositor-plus"
 license=('custom')
-depends=('libxfixes' 'libxext' 'libxcomposite' 'libxdamage' 'libxrender' 'libxxf86vm' 'sdl_image' 'libgl' 'ttf-dejavu' 'xorg-xrandr' 'steam')
+depends=('libxfixes' 'libxext' 'libxcomposite' 'libxdamage' 'libxrender' 'libxxf86vm' 'sdl_image' 'libgl' 'lsb-release' 'ttf-dejavu' 'xorg-xrandr' 'steam')
 makedepends=('mesa')
 conflicts=('steamos-compositor')
 _msver=1.10
 source=("https://github.com/gamer-os/steamos-compositor-plus/archive/${pkgver}.tar.gz"
         "http://repo.steamstatic.com/steamos/pool/main/s/steamos-modeswitch-inhibitor/steamos-modeswitch-inhibitor_${_msver}.tar.xz")
-md5sums=('dbde2a6cf1dcb1862409f01e4c0c792a'
+md5sums=('423ba9e34f76f7e9bc02b660e9b92889'
          'ab8b731fb917aff183aa338bf3298495')
 
 prepare() {
@@ -40,8 +40,9 @@ package() {
   install -m 755 "usr/bin/steamos-session" "$pkgdir/usr/bin"
   sed -i "s|x86_64-linux-gnu/||g" "$pkgdir/usr/bin/steamos-session"
   sed -i "s|lib/i386-linux-gnu/|lib32/|g" "$pkgdir/usr/bin/steamos-session"
-  mkdir -p "$pkgdir/usr/bin/steamos" "$pkgdir/usr/share/xsessions" "$pkgdir/usr/share/icons/steam" "$pkgdir/usr/share/pixmaps"
-  install -m 755 "usr/bin/steamos/set_hd_mode.sh" "$pkgdir/usr/bin/steamos"
+  mkdir -p "$pkgdir/usr/share/steamos-compositor-plus/bin" "$pkgdir/usr/share/xsessions" "$pkgdir/usr/share/icons/steam" "$pkgdir/usr/share/pixmaps"
+  install -m 755 "usr/share/steamos-compositor-plus/bin/set_hd_mode.sh" "$pkgdir/usr/share/steamos-compositor-plus/bin/set_hd_mode.sh"
+  install -m 755 "usr/share/steamos-compositor-plus/bin/dpkg-query" "$pkgdir/usr/share/steamos-compositor-plus/bin/dpkg-query"
   install -m 644 "usr/share/xsessions/steamos.desktop" "$pkgdir/usr/share/xsessions"
   install -m 644 "usr/share/icons/steam/arrow.png" "$pkgdir/usr/share/icons/steam"
   install -m 644 "usr/share/pixmaps/steam-bootstrapper.jpg" "$pkgdir/usr/share/pixmaps"

Note that lsb-release is now a dependency.

@@ -0,0 +1,11 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But wouldn't the steam client call the original dpkg-query and not this script?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this I added a path export to the steamos-session script which put our bin directory first. This ensures that steam always execute our script. I added some safeguards into it in case Steam wants to use dpkg-query for anything else than getting the steamos-updatelevel version, then it will redirect to the original dpkg-query if it exists.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, nice approach.

Copy link
Contributor Author

@sharkwouter sharkwouter Aug 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some further testing, I concluded that the while loop in this script was causing some issues when a different command was used. I've pushed a fix for it into this pull request. See this commit

# Add our bin directory with the set_hd_mode and dpkg-query replacement scripts
export PATH=/usr/share/steamos-compositor-plus/bin:${PATH}

set_hd_mode.sh >> $HOME/set_hd_mode.log
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does moving set_hd_mode.sh break the debian packaging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Debian packaging is currently broken, but it doesn't have issues with the scripts. It currently can't put the binaries it builds in the correct place, but that was already the case before these changes. I'll look into that some other time

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I thought you had said you had managed to build it, but if it is already broken, no matter. Maybe we should just remove the debian directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it for now. It isn't that hard to fix. The rules file will need to be changed to put the files in the correct directory after compiling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the debian package in pull request #11

The while loop caused some errors. This is a better solution.
@alkazar alkazar merged commit bfa373e into ChimeraOS:master Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants