Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings can't be accessed using v1.1.3 Linux binary #17

Closed
logix2 opened this issue Feb 16, 2021 · 23 comments
Closed

Settings can't be accessed using v1.1.3 Linux binary #17

logix2 opened this issue Feb 16, 2021 · 23 comments
Assignees
Labels
bug Something isn't working

Comments

@logix2
Copy link
Collaborator

logix2 commented Feb 16, 2021

Using the v1.1.3 Linux binary, I can't access settings like temperature scale, time format, etc., as you can see in this screenshot:

image

I assume I'd have to make the window larger or scroll horizontally to access these settings, but this doesn't seem to be possible.

Edit: I'm using the app on Ubuntu 20.10 with the Gnome desktop, in case it matters.

@GirkovArpa GirkovArpa self-assigned this Feb 16, 2021
@GirkovArpa
Copy link
Owner

GirkovArpa commented Feb 16, 2021

Thanks for bringing this up. I've removed the Linux binaries from Releases until I can upload some confirmed-to-be-working ones. In the meantime, these instructions about scapp.exe should work on Ubuntu.

@GirkovArpa GirkovArpa added the bug Something isn't working label Feb 17, 2021
@GirkovArpa
Copy link
Owner

GirkovArpa commented Feb 23, 2021

@logix2 Would you be able to compile temps-lite as a Rust project, if provided with the source? It would not be a monumental task to convert this into something that could be compiled via Rust.

@logix2
Copy link
Collaborator Author

logix2 commented Feb 24, 2021

Yes, I can do that. However, I'm interested in this not for me but for my blog (https://www.linuxuprising.com). For that I'll wait for the binary, users usually expect that.

@GirkovArpa
Copy link
Owner

GirkovArpa commented Feb 24, 2021

Great! Here is the "port". I hope we can figure out how to overcome those little roadbumps listed in the readme. If you manage to build it perhaps you can share the binary so we can add it to the Releases. I will add you as a collaborator and I encourage you to add a link to your blog in the readme (this repo; the other will be merged into this one if it works out).

@logix2
Copy link
Collaborator Author

logix2 commented Feb 24, 2021

Thank you! I'll try to build it right now.

@logix2
Copy link
Collaborator Author

logix2 commented Feb 24, 2021

Hmmm I have no idea how to convert this code to work on Linux:

#![allow(unused)]
use std::process::Command;
use std::io;
#[cfg(windows)] use winres::WindowsResource;

fn main() {
  if cfg!(target_os = "windows") {
    Command::new("./packfolder")
      .args(&["app", "target/assets.rc", "-binary"])
      .output()
      .expect("Unable to run packfolder.exe!");
      WindowsResource::new()
        .set_icon("icon.ico")
        .compile();
    }
}

I know my way around Linux, but I'm not a programmer.

I tried this:

#![allow(unused)]
use std::process::Command;
use std::io;

fn main() {
  if cfg!(target_os = "linux") {
    Command::new("packfolder")
      .args(&["app", "target/assets.rc", "-binary"])
      .output()
      .expect("Unable to run packfolder.exe!");
    }
}

And I was able to create a binary. But it doesn't have an icon.

@logix2
Copy link
Collaborator Author

logix2 commented Feb 24, 2021

A workaround for this would be to ship a .desktop file for Linux and install the icon. This way the application has an icon (and an applications menu entry). I can create a script to install everything in the right place if you're ok with using this.

The app would then have an icon and integrate with the applications menu:

image

@logix2
Copy link
Collaborator Author

logix2 commented Feb 24, 2021

2 more things:

  • the "Start at login" option doesn't seem to work on Linux
  • "Show weather in the menu bar" - what is this supposed to do? Show the weather in a tray icon? This option doesn't seem to do anything on Linux

@GirkovArpa
Copy link
Owner

I'm glad to here you were able to compile it, I've little experience with Linux and had no idea how close the code was to "just works".

The "Start at login" option doesn't do anything on Windows either, yet. I'll try to make the app copy a shortcut of itself to %appdata%\Microsoft\Windows\Start Menu\Programs\Startup on Windows. Would you happen to know the Linux equivalent?

On Windows the "Show weather in the menu bar" option does display/hide the tray icon, set to the current weather icon with a tooltip on mouse-over describing the weather and temperature. Will have to investigate why this doesn't do anything on Linux.

@papioara Would you be interested in testing this binary just to confirm it also works on your Linux distribution?

@logix2
Copy link
Collaborator Author

logix2 commented Feb 25, 2021

The "Start at login" option doesn't do anything on Windows either, yet. I'll try to make the app copy a shortcut of itself to %appdata%\Microsoft\Windows\Start Menu\Programs\Startup on Windows. Would you happen to know the Linux equivalent?

For the current user, you need to add a temps-lite.desktop file in ~/.config/autostart with the following contents, editing the Exec and Icon values:

[Desktop Entry]
Type=Application
Name=Temps Lite
Name[en_US]=Temps Lite
GenericName=Temps Lite
Exec=</path/to/executable>
Icon=<icon_name_if_installed_in_correct_location_or_exact_icon_path>
Hidden=false
NoDisplay=false
Terminal=false
X-GNOME-Autostart-enabled=true
Comment[en_US]=Temps Lite (Rust) weather widget
Comment=Temps Lite (Rust) weather widget

@papioara
Copy link
Collaborator

Yes, of course! Where again can I find that binary?

@logix2
Copy link
Collaborator Author

logix2 commented Feb 25, 2021

Yes, of course! Where again can I find that binary?

You can get it using:

wget https://transfer.sh/AJjVO/temps-lite-rust

The binary is built on Ubuntu 20.10. If it doesn't work, I may need to build it on an older Ubuntu version. I can do that, just let me know (it will take a while since I'm a bit busy right now).

@papioara
Copy link
Collaborator

I have downloaded it, but I do not know what to do with it ;-/ Maybe this is a stupid question, but my system just 'shrugs' as well asking me with what it should open the file or run it.

@papioara
Copy link
Collaborator

Talking about 'Start at login': the temps-lite on my computer does not seem to care about it. If I check the option and click 'Apply:, the check mark is there. If I close temps-lite and launch it again, the check mark is gone. No wonder I never see it after logging in. It seems that on 'Quit' the check mark is 'forgotten'.
I also have created the temps-lite.desktop file mentioned already above before myself, and this works. The little icon in the task bar is there, and I can call the temps-lite window, too.
Should I update the Readme for the Linux users? Making the temps-lite autostart work is not complicated with concise instructions, but at the moment the option in the settings is useless, at least on Linux. At least there is a good workaround.

@logix2
Copy link
Collaborator Author

logix2 commented Feb 25, 2021

I have downloaded it, but I do not know what to do with it

Open a terminal, navigate to the folder where temps-lite-rust is located, then make it executable:

chmod +x temps-lite-rust

Then run it:

./temps-lite-rust

@papioara
Copy link
Collaborator

Ah, this is just a shell script?

@papioara
Copy link
Collaborator

Ran it and got the following error:
./temps-lite-rust: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./temps-lite-rust)

@logix2
Copy link
Collaborator Author

logix2 commented Feb 25, 2021

It's not a shell script, but you probably tried to run the binary without making it executable. It should also work to double click it once it's executable... when it works.

It looks like you're using a Linux distribution with older libraries, that's why it didn't work for you. I'll build it on an older Ubuntu and it will hopefully work for you. I'll do it probably tomorrow or on Monday.

@papioara
Copy link
Collaborator

Ok, that was just a guess that it might be a shell script, because in Terminal you run a shell script by typing '/.' before the name of the file. I did make it executable before, so the error has nothing to do with that, and I am on Linux Mint 20.1 Cinnamon which is LTS, but otherwise the most recent version. Or do you know how to get that library? At least the package management does not offer it when you look for it. But if you could build it, that would be great, of course. Which Ubuntu do you use? I could also try and boot from a live DVD with that Ubuntu version for instance and try again. What would you think?

@GirkovArpa
Copy link
Owner

GirkovArpa commented Feb 26, 2021

Should I update the Readme for the Linux users? Making the temps-lite autostart work is not complicated with concise instructions, but at the moment the option in the settings is useless, at least on Linux. At least there is a good workaround.

Well, I did have "autostart" in the "Todo" section 😄

https://github.com/GirkovArpa/temps-lite#todo-

But @4silvertooth has added Linux autostart functionality with this commit. I've also added it for Windows here but that is a different repository slightly reworked that can only be compiled with Rust, because I'm using native code to modify the Windows Registry.

I need to merge the two repositories but first I should ask, are you okay with having to run the program via Rust like cargo run (requiring the installation of Rust and whatever difficulties that may entail), or would you prefer that I try to restructure the program so that it can be tested both via Rust and via plain old scapp.exe (with limited functionality in the latter case)?

Of course the compiled binary will not require scapp or Rust. I just don't want to introduce excessive complications when testing.

@logix2
Copy link
Collaborator Author

logix2 commented Feb 26, 2021

I couldn't build the latest git, I got an error saying that "winreg is only supported on Windows". So I had to pull a previous commit to build it. This build was done on Ubuntu 20.04. Since Linux Mint 20.* is based on Ubuntu 20.04, it should work now.

Get it with (make sure you don't have the old version still saved in the same place):

wget http://transfer.sh/9WoSJ/temps-lite-rust

Then make it executable:

chmod +x temps-lite-rust

And run it:

./temps-lite-rust

@papioara
Copy link
Collaborator

This one works flawlessly...

@papioara
Copy link
Collaborator

I am using this one to tell me about the weather at the moment ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants