lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.28k stars 161 forks source link

Not reloading set configuration #194

Open quantumsized opened 9 years ago

quantumsized commented 9 years ago

For some unknown reason, each time I start my computer running PC-BSD 10.2 and go into KDE, it loads Tilda terminal fine but without using my configuration I'd set in previous session. This happens no matter whether I set it and restart Tilda or even just set it and restart the computer some time later. Any thoughts as to how to get it to reload my configuration I've set would be great.

lanoxx commented 9 years ago

Can you look if tilda prints any error message on the shell if you start it? If it prints nothing I would recommend you to compile from source and enable maintainerflags with: ./configure --enable-maintainer-flags and the tilda should print some more debug messages. You could also check if tilda is actually writing any config file into ~/.config/tilda/config_0

quantumsized commented 9 years ago

Looks like it writes a new config file each time it starts.

This is the output when starting from terminal >

[user@pcbsd] ~% tilda ps: illegal argument: tilda usage: ps [-aCcdefHhjlmrSTuvwXxZ] [-O fmt | -o fmt] [-G gid[,gid...]] [-J jid[,jid...]] [-M core] [-N system] [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]] ps [-L] Fontconfig warning: "local.conf", line 1093: saw number, expected matrix Tilda has started. Press F9 to pull down the window.

I'm not sure exactly sure where "local.conf" is located at present, tho I've not searched for it ether. I'm also not sure why it is trying to check on the process and there by spitting out the first error.

Thanks, /Tim

On 10/18/2015 02:14, Sebastian Geiger wrote:

Can you look if tilda prints any error message on the shell if you start it? If it prints nothing I would recommend you to compile from source and enable maintainerflags with: |./configure --enable-maintainer-flags| and the tilda should print some more debug messages. You could also check if tilda is actually writing any config file into ~/.config/tilda/config_0

— Reply to this email directly or view it on GitHub https://github.com/lanoxx/tilda/issues/194#issuecomment-148994511.

quantumsized commented 9 years ago

Ok, sorted the "local.conf" error and am yet to try again tho I suspect that it will not be any different. I have copy of the source so if this does not fix anything, I'll try that option.

quantumsized commented 9 years ago

Ah! perfect! that did it. There was one note in the local.conf tho, it said that it may make Firefox crash or freeze but tiz good I don't use it often. For anyone that may wish to know: I'm running PC-BSD 10.2 and the file was located in /usr/local/etc/fonts/local.conf

lanoxx commented 9 years ago

Tilda uses ps to lookup how many tilda processes are running. Maybe some of the options we rely on are not supported on BSD and that might explain your problem with the config.

In particular tilda runs:

ps -C tilda -o pid=

to get a list of all pid of tilda processes currently running. It then uses this information in order to cleanup old lock files. On the other hand, if the ps command cannot be executed then it might fail to remove stale lock file and as a result always write a new config file on restart. I recommend you to take a look into ~/.cache/tilda/locks, you probably already have server lock files lying around there.

quantumsized commented 9 years ago

Yeah, I have 5 at present. I can see spending a bit of time and maybe even making a contribution to this project if I succeed. I'll report back with my findings as I have the time to run through it. Thanks, /Tim

quantumsized commented 9 years ago

Ok, I've forked a copy and am using Git here to manage version and I seem to run into a snag with an error when I run autogen.sh It exits with saying ./configure: 1: not found I then looked and it does exist and when I run it, it gives the same exit status.

This happens shortly into the configuration process.

I have installed all dependencies I can find and there seems to be no other troubles at present with this part.

The last part of the section with the above message: ./configure: 1: not found

          tilda 1.3~rc1
          =============

    prefix:                        /usr/local
    datarootdir:                   ${prefix}/share
    datadir:                       ${datarootdir}
    pkgdatadir:                    ${datarootdir}/tilda
    source code location:          .
    compiler:                      cc
    cflags:                        -std=c99 
    Maintainer mode:               yes
    VTE:                           vte-2.90
    Use *_DISABLE_DEPRECATED:  

Any ideas?

I am running this from /opt/tilda dir and keeping my Git copy in /src/tilda so as I can refresh if/as needed.

/Tim

lanoxx commented 9 years ago

If it prints the summary it should actually be successful. Not sure where the not found error comes from. Did you try to run make and make install

lanoxx commented 9 years ago

Not sure what you mean with /opt/tilda but your prefix is set to /usr/local. If you want to install into /opt/tilda you should invoke autogen.sh with --prefix=/opt/tilda --enable-maintainer-mode

quantumsized commented 9 years ago

The /opt/tilda is just the place I am compiling from. I don't really have any need to install there but thanks anyway. ... But, would you recommend the --enable-maintainer-mode ?

Output from make: [user@pcbsd] /opt/tilda% make make all-recursive Making all in po CC src/src_tilda-callback_func.o CC src/src_tilda-configsys.o src/configsys.c:356:13: warning: implicit declaration of function 'fsync' is invalid in C99 [-Wimplicit-function-declaration] if (fsync (fileno(fp))) ^ 1 warning generated. CC src/src_tilda-eggaccelerators.o CC src/src_tilda-key_grabber.o src/key_grabber.c:159:47: warning: 'gtk_widget_get_root_window' is deprecated [-Wdeprecated-declarations] Window x11_root_window = GDK_WINDOW_XID ( gtk_widget_get_root_window (tw->window) ); ^ /usr/local/include/gtk-3.0/gdk/x11/gdkx11window.h:108:64: note: expanded from macro 'GDK_WINDOW_XID'

define GDK_WINDOW_XID(win) (gdk_x11_window_get_xid (win))

                                                           ^

/usr/local/include/gtk-3.0/gtk/gtkwidget.h:1025:15: note: 'gtk_widget_get_root_window' declared here GdkWindow * gtk_widget_get_root_window (GtkWidget _widget); ^ src/key_grabber.c:321:9: warning: implicit declaration of function 'tilda_window_set_fullscreen' is invalid in C99 [-Wimplicit-function-declaration] tilda_window_set_fullscreen(tw); ^ 2 warnings generated. CC src/src_tilda-tilda.o In file included from src/tilda.c:53: /usr/include/sys/file.h:209:2: error: unknown type name 'u_int' u_int xfflag; / flags (see fcntl.h) _/ ^ In file included from src/tilda.c:55: /usr/include/sys/dir.h:39:2: warning: "The information in this file should be obtained from

" [-W#warnings] #warning "The information in this file should be obtained from " ^ /usr/include/sys/dir.h:40:2: warning: "and is provided solely (and temporarily) for backward compatibility." [-W#warnings] #warning "and is provided solely (and temporarily) for backward compatibility." ^ src/tilda.c:237:22: warning: implicit declaration of function 'popen' is invalid in C99 [-Wimplicit-function-declaration] if ((ps_output = popen (ps_command, "r")) == NULL) { ^ src/tilda.c:237:20: warning: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] if ((ps_output = popen (ps_command, "r")) == NULL) { ^ ~~~~~~~~~~~~~~~~~~~~~~~ src/tilda.c:247:5: warning: implicit declaration of function 'pclose' is invalid in C99 [-Wimplicit-function-declaration] pclose (ps_output); ^ src/tilda.c:427:13: warning: 'gdk_color_parse' is deprecated [-Wdeprecated-declarations] if (gdk_color_parse(background_color, &col)) { ^ /usr/local/include/gtk-3.0/gdk/deprecated/gdkcolor.h:79:11: note: 'gdk_color_parse' declared here gboolean gdk_color_parse (const gchar *spec, ^ src/tilda.c:681:5: warning: implicit declaration of function 'flock' is invalid in C99 [-Wimplicit-function-declaration] flock(global_lock.file_descriptor, LOCK_EX); ^ src/tilda.c:681:40: error: use of undeclared identifier 'LOCK_EX' flock(global_lock.file_descriptor, LOCK_EX); ^ src/tilda.c:690:40: error: use of undeclared identifier 'LOCK_UN' flock(global_lock.file_descriptor, LOCK_UN); ^ 7 warnings and 3 errors generated. *_\* Error code 1 Stop. make[2]: stopped in /opt/tilda **\* Error code 1 Stop. make[1]: stopped in /opt/tilda **\* Error code 1 Stop. make: stopped in /opt/tilda Bit long but that is the output. I do wonder if this is cause I'm running this from a tilda terminal... I'll also try without tilda running but I expect the same result given things. /Tim
quantumsized commented 9 years ago

huh... yep, tiz the same. Can I ask your timezone? May help my timing of discussion on the topic.

/Tim

quantumsized commented 9 years ago

Thoughts are: using pgrep for getting pids of tilda in this sequence.

lanoxx commented 9 years ago

Hi,

just some quick comments:

  1. I do not think any of the problems are caused by the fact that you executed these commands from a tilda terminal. It should be the same no matter what terminal you use since in the end they all use the same shell (e.g. bash)
  2. I am on UTC+1
  3. It looks like configure completed to produce a Makefile since you can run make, so the warning from configure can probably be ignored for now. However it seems Make fails because it is missing some some functions that are not present on BSD or behave differently (e.g. flock, fsync). I am not an expert for BSD so maybe we need to provide alternative implementations in order to make it work on BSD.

Using pgrep looks like a good alternative, I am just not sure this is always available on all systems or would it add another dependency on some additional package?

quantumsized commented 9 years ago

Ok, so that is interesting > pgrep is widely available in Linux and on all BSD machines. Interesting... pgrep may work different on Linux. Here on BSD it requires that I use "pgrep -a tilda" and shows only the pid. I'm UTC-7 PDT here in the beautiful Pacific northwest. I hope to have a few more minutes to stare at the output and dissect it to figure what corse of action is next.

lanoxx commented 9 years ago

I made some changes to locking and file writing during a the development of 1.3 you can try to checkout version 1.2.4 and see if it builds any better.

quantumsized commented 9 years ago

I'll give that a shot. Thanks.

lanoxx commented 8 years ago

How did it go? Did you have more success with 1.2.4?

quantumsized commented 8 years ago

Interestingly, even without doing anything, it does work to reload the previous config file some of the time. So all I have to do is figure out why or what is making it not work at just some points and I'll have it made. It could simply be another program that starts that should start after Tilda in order to resolve this.

I'll keep you posted.

/Tim

On 11/17/2015 8:36 AM, Sebastian Geiger wrote:

How did it go? Did you have more success with 1.2.4?

— Reply to this email directly or view it on GitHub https://github.com/lanoxx/tilda/issues/194#issuecomment-157424498.

TacKoH commented 8 years ago

Not sure if that helps, but I also have a similar problem. If Tilda is not exited by typing exit at the command prompt, a file remains in [home dir]/.cache/locks . Upon the next reboot, Tilda recreates a new config if anything remains in the locks. I get around it by having a script that delete all files in the lock before launching Tilda. Tilda 1.2.4 FreeBSD 10.2.

quantumsized commented 8 years ago

It actually dose but I'll have to find some time to get back to this one.

lanoxx commented 8 years ago

Actually tilda has a routine that cleans up stale lock file on the next start. But i think that might not work properly on BSD.

quantumsized commented 8 years ago

As is why I think this is the starting direction. I reckon that there is a simple reason, maybe even due to an error, that stops this from working in just this way.

jpph commented 2 years ago

bug still present in freebsd. I did a shell script like this to fix my autostart:

! /bin/sh

rm -f ~/.cache/tilda/locks/* tilda&