GirkovArpa / temps-lite

A smart, good-looking little app which tries to speak your language the way you are used to.
MIT License
43 stars 2 forks source link

Start at login #22

Open GirkovArpa opened 3 years ago

GirkovArpa commented 3 years ago

the "Start at login" option doesn't seem to work on Linux

Originally posted by @logix2 in https://github.com/GirkovArpa/temps-lite/issues/17#issuecomment-785083651

This functionality hasn't been implemented for Windows either. I've tried with the lnk Rust crate but it appears to be broken and abandoned.

GirkovArpa commented 3 years ago

Added autostart capability via registry to temps-lite-rust with this commit. Will merge the repository with this one in the future.

4silvertooth commented 3 years ago

I've added the linux start on login functionality, I am not happy with where I had to write that (storage.tis) but overall code needs a bit restructuring.

papioara commented 3 years ago

It does work now, but the checkmark gets lost after quitting and relaunching temps-lite, at least on my Linux Mint 20

GirkovArpa commented 3 years ago

I fixed this for myself on Windows on the temps-lite-rust repo, can anyone confirm it solves the issue for Linux also? Part of the solution was correcting the typo "checcked" btw 😄

Note that the folder "locale" is no longer included in the executable and must be present alongside it when run.

My intent was to allow extending locale support without having to rebuild each time.

@4silvertooth @logix2

If everything works now for both Windows and Linux then I suppose I shall "merge" that repo into this one.

logix2 commented 3 years ago

I'm unable to build the latest https://github.com/GirkovArpa/temps-lite-rust from git. I get:

$ cargo build --release

   Compiling libc v0.2.86
   Compiling lazy_static v1.4.0
   Compiling temps-lite-rust v2.0.0 (/home/logix/Downloads/temps-latest)
error: failed to run custom build command for `temps-lite-rust v2.0.0 (/home/logix/Downloads/temps-latest)`

Caused by:
  process didn't exit successfully: `/home/logix/Downloads/temps-latest/target/release/build/temps-lite-rust-08b34542934009c2/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'Unable to run packfolder!: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:23:6
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
4silvertooth commented 3 years ago

I'm unable to build the latest https://github.com/GirkovArpa/temps-lite-rust from git. I get:

$ cargo build --release

   Compiling libc v0.2.86
   Compiling lazy_static v1.4.0
   Compiling temps-lite-rust v2.0.0 (/home/logix/Downloads/temps-latest)
error: failed to run custom build command for `temps-lite-rust v2.0.0 (/home/logix/Downloads/temps-latest)`

Caused by:
  process didn't exit successfully: `/home/logix/Downloads/temps-latest/target/release/build/temps-lite-rust-08b34542934009c2/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'Unable to run packfolder!: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:23:6
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

You should have https://github.com/c-smile/sciter-sdk/raw/master/bin.lnx/packfolder that inside the folder, its for pre build step to make a amalgamation of all resources.

logix2 commented 3 years ago

OK, I changed ./packfolder to packfolder to use the packfolder from PATH and it worked.

About the startup option:

./temps-lite-rust 

WARNING:CSS: in @font-face statement, failed to install font at (this://app/rubik.css(4))
WARNING:CSS: in @font-face statement, failed to install font at (this://app/rubik.css(9))
WARNING:CSS: in @font-face statement, failed to install font at (this://app/rubik.css(14))
ERROR:TIS: this://app/lang/load-translations.tis(16) : warning :'async' does not contain any 'await'
ERROR:TIS: Error: Wrong type - null
ERROR:TIS:  at loadLanguages (this://app/lang/load-translations.tis(5))
ERROR:TIS:  at undefined
terminate called after throwing an instance of 'tis::script_exception'
Aborted (core dumped)
4silvertooth commented 3 years ago

Interesting, What OS are you on, I had to do the opposite I mean add ./ for it to work and that's why it's landed there.

logix2 commented 3 years ago

Interesting, What OS are you on, I had to do the opposite I mean add ./ for it to work and that's why it's landed there.

That's only in the terminal, and probably because you're using Zsh.

Edit: check any startup file from ~/.config/autostart and /etc/xdg/autostart.

papioara commented 3 years ago

I also just did a test run. I cloned the temps-lite-rust repository, put packfolder in the temps-lite-rust folder, and the build process seems to work. Here's what my Terminal said:

cargo build --release Updating crates.io index Downloaded libc v0.2.86 Downloaded sciter-rs v0.5.54 Downloaded 2 crates (664.5 KB) in 2.52s Compiling libc v0.2.86 Compiling lazy_static v1.4.0 Compiling temps-lite-rust v2.0.0 (/home/falter/temps-lite-rust) Compiling sciter-rs v0.5.54 warning: unused #[macro_use] import --> src/main.rs:3:1 3 #[macro_use] extern crate sciter; ^^^^^^^^^^^^

= note: #[warn(unused_imports)] on by default

warning: 1 warning emitted

Finished release [optimized] target(s) in 3m 25s

I do not know what to do with the resulting stuff, but except for that little warning (maybe harmless) everything seems to be in order. I am on Linux Mint 20.

GirkovArpa commented 3 years ago

ERROR:TIS: at loadLanguages (this://app/lang/load-translations.tis(5))

Do you have the folder locale with the executable? I deliberately prevented it from being packed into it, so it has to be included alongside it when running.

papioara commented 3 years ago

Success! When I move the locale folder and libsciter-gtk.so into the /target/release folder, make temps-lite-rust executable and just do 'temps-lite-rust' in Terminal, it fires up with everything, and the famous check mark for the startup at login is persistent, too, and survives closing and relaunching temps-lite-rust. At least on Linux Mint 20 this works, and may do so (tongue in cheek, though and fingers crossed) on other Ubuntu-based distros, too.

papioara commented 3 years ago

Unfortunately there are still some flaws which I only noticed at a second glance. The good news: it's up and running, but:

1) The autostart entry which is created in /.config/autostart has to be edited manually, since it does not work with the command entered there. It says: Exec=/HOME/USER/TEMPS-LITE-FOLDER/./temps-lite-rust. This command launches it, but although the libsciter-gtk.so file and the locale folder are also present, it launches, but does not seem to recognize them. If you modify the command to Exec=cd /HOME/USER/TEMPS-LITE-FOLDER && ./temps-lite-rust, temps-lite-rust works, but I do not know why this makes any difference, because syntaxwise the former version should be fine. I have copied the release folder from the build and placed it in different locations/places on my machine, but what I described above was always the same. I also tried both commands in a Terminal, and the results were also the same.

2) There are errors on launch with the second command. The first one is an old acquaintance about the rubik font, but the second one may be of interest - I do not know if it is important, because the app is running fine. Here it is:

ERROR:TIS: this://app/lang/load-translations.tis(16) : warning :'async' does not contain any 'await'

And there, too, is the complaint about GLibc already familiar, too.