kostoskistefan / hoverclock-qt

A simple floating clock for Linux
GNU General Public License v3.0
21 stars 3 forks source link

Hoverclock for SteamOS (Arch distro)? #25

Closed zohozer closed 1 year ago

zohozer commented 1 year ago

Hi. I am searching for a good desktop clock with always on top feature for my SteamOS 3.4 (Arch distro) and I found this Hoverclock project.

Any chance to add Hoverclock to the Pacman repositories ?

If I run:

> sudo pacman -S Hoverclock

I do get:

error: target not found: Hoverclock

kostoskistefan commented 1 year ago

Hello there!

Hoverclock is not in the official Arch Linux repositories, but it is present in the AUR (Arch User Repository). I haven't used SteamOS, but since it's Arch based, you have 2 options:

With AUR helper

If you use an AUR helper like yay for example, you can install hoverclock using the following command: yay -S hoverclock-bin

Without AUR helper

You can firstly clone the package from the AUR and install it manually with the following commands:

git clone https://aur.archlinux.org/hoverclock-bin.git
cd hoverclock-bin
makepkg -si

I hope that helps!

zohozer commented 1 year ago

Hi. Thank you for the reply and explanation.

I do managed to install Hoverclock using the method provided, however I can't find a way to launch-it. It simply dosn't apear anywhere.

This is the output from Konsole:

> makepkg -si
==> Making package: hoverclock-bin 1.0.0-1 (Thu Mar 30 20:15:20 2023)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading Hoverclock.zip...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 21.8M  100 21.8M    0     0  3386k      0  0:00:06  0:00:06 --:--:-- 4402k
  -> Downloading LICENSE...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 35149  100 35149    0     0  73931      0 --:--:-- --:--:-- --:--:-- 73997
==> Validating source files with md5sums...
    Hoverclock.zip ... Passed
    LICENSE ... Passed
==> Extracting sources...
  -> Extracting Hoverclock.zip with bsdtar
bsdtar: Failed to set default locale
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "hoverclock-bin"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
bsdtar: Failed to set default locale
  -> Compressing package...
bsdtar: Failed to set default locale
==> Leaving fakeroot environment.
==> Finished making: hoverclock-bin 1.0.0-1 (Thu Mar 30 20:15:31 2023)
==> Installing package hoverclock-bin with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) hoverclock-bin-1.0.0-1

Total Installed Size:  54.41 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                              [################################] 100%
(1/1) checking package integrity                            [################################] 100%
(1/1) loading package files                                 [################################] 100%
(1/1) checking for file conflicts                           [################################] 100%
(1/1) checking available disk space                         [################################] 100%
:: Processing package changes...
(1/1) installing hoverclock-bin                             [################################] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...
zohozer commented 1 year ago

And this is how looks the directory structure:

hoverclock-bin_230330 202645

If I press the Hoverclock.desktop file it is asking me if I want to run, I do say yes and nothing happens.

zohozer commented 1 year ago

Ok, I managed to start the Howerclock app with the following command: /home/deck/Downloads/Linux_Arch/Howerclock/hoverclock-bin/pkg/hoverclock-bin/opt/hoverclock/hoverclock.sh

It is appearing on my screen but looks like have some glitchies, more exacly looks like the numbers are not refresed on the screen but instead they are just drawn on top of the old ones. Like when it is changing the minutes from, lets say, 48 to 49, 50, etc, I can read the old numbers on the screen.

y0330 205131

kostoskistefan commented 1 year ago

You should be able to start hoverclock just by running the command hoverclock in a terminal. The makepkg -si command should've taken care of installing all the necessary files in the correct location. After the installation, the .desktop file is added to /usr/share/applications/ and it should be present in the application launcher that you use.

About the drawing bug, I have no idea why that happened. I will look into it and update you when I know more. Meanwhile, you can try deleting the ~/.config/hoverclock/hoverclock.conf file, or just rename it if you want to revert your custom settings later. Afterwards, launch the clock by running the hoverclock command in a terminal. If it still doesn't work, try changing the position of the clock in the settings dialog and experiment with the settings in general. If you do manage to fix it, please let me know so I can try and fix the problem in the code itself.

Quick note

Since I haven't used SteamOS, I'm not sure if it uses X or Wayland and I haven't really tested Hoverclock on Wayland, but it should work if you have XWayland installed.

zohozer commented 1 year ago

Hi. Indeed seems that the files are in the right places but the system can find them only after a system restart.

I do deleted the hoverclock.conf file but unfortunately it didn't solves the overlapping problem.

I launched the Hoverclock from the .desktop file and it works. I do launched from the terminal app and I do get this messages:

~> hoverclock

qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize 0, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)
No XVisualInfo for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize 0, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)
Falling back to using screens root_visual.

Hopefully this can be usefull to debug the overlapping issue.

kostoskistefan commented 1 year ago

Could you try launching hoverclock with the following command and see if that fixes the problem: LIBGL_ALWAYS_SOFTWARE=1 QT_XCB_FORCE_SOFTWARE_OPENGL=1 QT_OPENGL=software hoverclock

If it does, then QT cannot get an accelerated OpenGL surface and I'm not sure why it is doing that by default. I will look into disabling hardware acceleration for hoverclock, since it's not a graphic intensive application.

Although, I'm currently working on a new, lightweight version of hoverclock, which completely avoids QT and other major frameworks/libraries and directly interacts with the display server. So, if hardware acceleration is indeed the problem with this version and a fix can be implemented quickly, I will do it right away. Otherwise, I will continue working on the new version.

zohozer commented 1 year ago

Here it is the requested terminal output:

~> LIBGL_ALWAYS_SOFTWARE=1 QT_XCB_FORCE_SOFTWARE_OPENGL=1 QT_OPENGL=software hoverclock qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize 0, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile) No XVisualInfo for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize 0, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile) Falling back to using screens root_visual.

zohozer commented 1 year ago

If it does, then QT cannot get an accelerated OpenGL surface and I'm not sure why it is doing that by default. I will look into disabling hardware acceleration for hoverclock, since it's not a graphic intensive application.

I do disabled OpenGL acceleration of the interface. Looks more stable the system without acceleration.

kostoskistefan commented 1 year ago

I'm still not sure why this happens. I'll try to install SteamOS tomorrow and I'll test it out. Meanwhile, doing a google search lead me to 2 more possible fixes:

  1. Try launching hoverclock with this command: QT_XCB_GL_INTEGRATION=none hoverclock.
  2. If that doesn't work, make sure to install the mesa package, available in the official Arch repository (by using pacman -S mesa).

If that doesn't fix it, I'll have to do some extensive tests on SteamOS, try to reproduce it and then figure it out.

Alternatively, you can try hoverclock-gtk, but you'll have to build it from source. Additionally, this version doesn't have a system tray icon, nor a settings dialog. All the settings are configured from a file located at ~/.config/hoverclock-gtk/hoverclock.conf, which should't be hard to edit to your liking.

zohozer commented 1 year ago

Hi. Looks like the QT_XCB_GL_INTEGRATION=none hoverclock command it is working as expected. The text it's clear without overlappings.

I do have also a request feature: It is possible to create a transparent background instead of the black one?

Best regards.

kostoskistefan commented 1 year ago

I'm glad to hear that you got it working. As suspected, the problem lies in the fact that QT was trying to use hardware acceleration, but it couldn't. I will try to disable it, since it's not really needed. Thanks for opening up the issue!

The transparent background is entirely dependant on a compositor that supports transparency. I'm currently using KDE with its built in compositor and I have a transparent background (which can be seen on an image in the README file of this repository). I'm not sure what SteamOS uses, but you can probably find some more information on the internet. Another alternative is to install the picom/compiz compositor, which does support transparency.

zohozer commented 1 year ago

Thanks for the answer. I do learn something new every day.

Still I do have a small issue actually with the .desktop shortcut to launch the Hoverclock.

I want to pass the QT_XCB_GL_INTEGRATION=none into the .desktop shortcut, but looks like when I launch Hoverclock through this shorcut but looks like the shortcut it is not reading the Arguments:

y0403 194643

Do you know how I can pass this arguments into the .desktop shortcut to launch the app?

zohozer commented 1 year ago

About the compositor, I do think that this one looks more modern: Wayfire

kostoskistefan commented 1 year ago

To add the fix to the .desktop file, just open it up with your favorite text editor and replace the line Exec=hoverclock with Exec=QT_XCB_GL_INTEGRATION=none hoverclock. That should do the trick.

About the compositor, I do think that this one looks more modern: Wayfire

Wayfire is a Wayland compositor (you can look at it as a whole window manager and a compositor with transparency built in). What you are looking for is a X11 compositor (since you are currently using X11). One of the most popular ones is picom and that's why I recommended it. On Xorg, you have a window manager and a compositor separately. You might or might not want to use a compositor, but you will have a window manager regardless. On Wayland, both of those things are merged into one thing and it is called a compositor (which is why the confusion arose). If you want to, you can of course switch from X11 to Wayland, but many people still steer away from it because it's still pretty new, plus hoverclock is not really tested on Wayland, but it should work if the XWayland package is installed (which still runs an X server on top of wayland).

I'll mention again, I've never used SteamOS, so I might be wrong about some of things I stated.

zohozer commented 1 year ago

Thank you for the replay. Now it is working properly, launched from the .desktop file.