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

:source doesn't seem to load my ~/.tridactylrc right? Something outdated in there? I just got back to the normal version finally, from an old, frozen, slightly tweaked version of tridactyl (someone else set up) #3902

Open
OwenAR opened this issue Sep 5, 2021 · 13 comments

Comments

@OwenAR
Copy link

OwenAR commented Sep 5, 2021

Tridactyl version: 1.21.1
Firefox version:
- Mozilla Firefox 91.0.2 on Ubuntu 20.04.3 LTS
- Mozilla Firefox 75.0 on awkwardly mostly-frozen Gentoo Base System release 2.7 (it's complicated)
Operating system: linux

I'm slogging through this very long process of updating my system,
which has been awkwardly mostly-frozen for ages with a bunch of tweaks someone else set up and which I don't fully understand,
which I'm slowly disentangling
(mixed in with my own, relatively minor tweaks and configs)...

And just now, I finally updated my tridactyl to the latest normal version
(ie installed from the standard mozilla addons page)

But now when I :source,
it doesn't seem to load my ~/.tridactylrc right?

(I tried restarted firefox a few times, since the documentation suggested it might be finnicky about that.)

So my first guess is that maybe there's something outdated in my rc file?
(Probably the "csp clobbering" stuff, but I don't understand what that is...?)

(
And btw, could I do some sort of equivalent to putting a debug feedback message for myself into the rc file like
echo 'finished reading up to here'
?

Also, I don't think it's relevant to this (?),
but I also did the native install thing and it's telling me that's fine (# Native messenger is correctly installed, version 0.3.4 ) on both systems already.
)

Thanks if you can help!


~/.tridactylrc:

(
To be clear, I don't use everything that's mentioned in here
(eg I don't use the vlc/youtube stuff, or the "comment toggler", and don't really remember what's up with them)
-- it's mostly just the simple hint bits that I rely on
)

" run :source to get it in the browser, or just restart."

" make sure that unsetting an option here also resets it in the running session"
sanitise tridactyllocal tridactylsync

" hinting"
set hintchars nrtdeaiuhcglmpfvsokwbzjyqx
    " set hintchars eaiouclvwxzpnrtsdhgfkbmy"
set hintnames short

" newtab"
set newtab about:blank

" make tridactyl work on more sites at the expense of some security"
set csp clobber
fixamo_quiet

" unbind basic keys"
unbind <c-u>
unbind <c-d>
unbind <c-f>
unbind <c-b>
unbind <esc>
unbind <escape>
unbind /
unbind <F1>

" unbind dangerous keys i don't use [don't remember why 'dangerous' but whatever]"
unbind d
unbind w
" unbind youtube hotkeys i want to use"
unbind k
unbind f
unbind N
unbind >>
unbind <<
unbind .
unbind ,

" but make sure i can always get into the console"
bind : fillcmdline_notrail

" open new tab next to current one"
bind <a-T> tabopen about:blank

" vimfx keys"
bind r hint
bind t hint -b
bind d hint -qb
bind a hint -y
bind A hint -p
bind n hint -;
bind v hint -h
bind D tabduplicate

" video download"
" bind <a-e>    hint -W        exclaim_quiet /usr/bin/konsole --name yt-dl -e yt-dl.sh"
" bind <c-E>    current_url    exclaim_quiet /usr/bin/konsole --name yt-dl -e yt-dl.sh"

" video playing"
bind ;v hint -W        exclaim_quiet vlc-yt
bind ;V current_url    exclaim_quiet vlc-yt
bind m hint -W         exclaim_quiet vlc-yt
bind M current_url     exclaim_quiet vlc-yt

" next/prev page"
bind x tabprev
bind * tabnext

" next/prev page"
bind ]] followpage next
bind [[ followpage prev
bind [c urlincrement -1
bind ]c urlincrement 1

" comment toggler for Reddit and Hacker News"
bind ;c hint -c [class*="expand"],[class="togg"]
@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

I think I got it fixed by commenting out all the junk that seemed "probably old?".

But I couldn't really find a simple guide in the documentation for what the syntax for comments actually is,
or how you escape special characters, ect?

" run :source to get it in the browser, or just restart.

	" does this work?
		" unbind all

	" make sure that unsetting an option here also resets it in the running session
		sanitise tridactyllocal tridactylsync

	" hinting
		set hintchars nrtdeaiuhcglmpfvsokwbzjyqx
			" set hintchars eaiouclvwxzpnrtsdhgfkbmy
		set hintnames short

	" newtab
		set newtab about:blank

	" make tridactyl work on more sites at the expense of some security
		" set csp clobber	" #offmr
		" fixamo_quiet   	" #offmr

	" unbind basic keys
		unbind <c-u>
		unbind <c-d>
		unbind <c-f>
		unbind <c-b>
		unbind <esc>
		unbind <escape>
		unbind /
		unbind <F1>

	" unbind dangerous keys i don't use [don't remember why 'dangerous' but whatever]
		unbind d
		unbind w
	" unbind youtube hotkeys i want to use
		unbind k
		unbind f
		unbind N
		unbind >>
		unbind <<
		unbind .
		unbind ,
		unbind P
		unbind N
	" FUCK
		" unbind :
		" unbind \;
		" unbind ;
		" unbind ;;
		" unbind -;

	" but make sure i can always get into the console
		" bind : fillcmdline_notrail
		bind <c-:> fillcmdline_notrail source

	" open new tab next to current one
		bind <a-T> tabopen about:blank

	" vimfx keys
		bind r hint
		bind t hint -b
		bind d hint -qb
		bind a hint -y
		bind A hint -p
		bind n hint -;
		bind v hint -h
		bind D tabduplicate

	" video download
		" bind <a-e>    hint -W        exclaim_quiet /usr/bin/konsole --name yt-dl -e yt-dl.sh
		" bind <c-E>    current_url    exclaim_quiet /usr/bin/konsole --name yt-dl -e yt-dl.sh

	" video playing
		" bind ;v hint -W        exclaim_quiet vlc-yt	" #offmr
		" bind ;V current_url    exclaim_quiet vlc-yt	" #offmr
		" bind m hint -W         exclaim_quiet vlc-yt	" #offmr
		" bind M current_url     exclaim_quiet vlc-yt	" #offmr

	" next/prev page
		bind x tabprev
		bind * tabnext

	" next/prev page
		" bind ]] followpage next	" #offmr
		" bind [[ followpage prev	" #offmr
		" bind [c urlincrement -1	" #offmr
		" bind ]c urlincrement 1 	" #offmr

	" comment toggler for Reddit and Hacker News
		" bind ;c hint -c [class*="expand"],[class="togg"]	" #offmr

@bovine3dom
Copy link
Member

  1. look at :viewconfig --user in Tridactyl to see what your config currently is - that should tell you what's going on if anything

  2. we only support " comments at the start of each line. You can't have an inline " comment

  3. Tridactyl reads ~/.config/tridactyl/tridactylrc preferentially to ~/.tridactylrc. If you have both, the second is ignored

  4. you can make alerts with fillcmdline_tmp 3000 [your message here] but they'll only come through if you are on a tab that Tridactyl can access

@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

Ah, thanks @bovine3dom.

3. Tridactyl reads `~/.config/tridactyl/tridactylrc` preferentially to `~/.tridactylrc`. If you have both, the second is ignored

I actually had managed to find that in the docs already
("If no argument given, it will try to open ~/.tridactylrc, ~/.config/tridactyl/tridactylrc or $XDG_CONFIG_HOME/tridactyl/tridactylrc in reverse order")
but I checked and I only have ~/.tridactylrc

2. we only support `"` comments at the start of each line. You can't have an inline `"` comment

Where in the documentation would I find that?

@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

... Although actually, now that I think about it,
I would interpret the "in reverse order" part of:

If no argument given, it will try to open ~/.tridactylrc, ~/.config/tridactyl/tridactylrc or $XDG_CONFIG_HOME/tridactyl/tridactylrc in reverse order

as meaning that, since ~/.tridactylrc would be read last,
anything in it that conflicted with the other sources would be applied last,
and therefore overwrite the conflicting bits from the other sources??

@bovine3dom
Copy link
Member

Re overwriting: I agree, the docs should be improved. It does not overwrite.

I can't find anywhere where we describe " comments in the docs. I guess it's an Easter egg? ;)

We should maybe add a page to :tutor on RC files and improve the docs on :source and :mkt

@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

Ah, ok good, glad to hear I wasn't just bad at finding it.

So, a timing issue I noticed with :source:

I unbound : to open the commandline,
and bound it to c-: instead,
but I notice that,
after I run :source
: works for a second or two to open the commandline,
before getting unbound again.

So that was really confusing for a bit, since what I was doing to test if the rc had actually taken affect was immediately pressing : to see if it had gotten unbound.

@bovine3dom
Copy link
Member

Generally deleting settings doesn't work very well in RC files and we've never worked out why - see #1409.

There's a speed limit on RC files to try to fix it - IIRC we wait 1/3s between each line - so you could be seeing that too.

@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

Ah. Well anyway, I guess the practical conclusion is:
wait a few seconds before testing whether a sourcing has taken affect, eh?

(
Separately, I note that in the linked post, the poster says:

bind g1 tab 1
bind g3 tab 3 "*

[...]
[...] only starred lines get executed

which implies that the "* there is meant to be interpreted as an inline comment.
)

@bovine3dom
Copy link
Member

Yeah.

I spotted that too #1409 (comment) : )

@OwenAR
Copy link
Author

OwenAR commented Sep 5, 2021

... oh, ha!

Yeah, you should definitely make sure that anywhere in the documentation from which the user might learn "oh, I should put stuff in an rc file" also tells the user what the syntax of the rc file and comments is...

That is... not a fun easter egg to have to discover yourself. xD

@JBlocklove
Copy link

I just came across this and it seems I'm having a similar issue to not being able to source. I used mkt to create a config file from my laptop and I've put that config in ~/.config/tridactyl/tridactylrc with no changes on my desktop, but Tridactyl doesn't seem to source the config at all. I've used the :source command both with and without arguments to try to point to the file and there doesn't seem to be any luck.

@bovine3dom
Copy link
Member

Does :native work for you @JBlocklove?

@JBlocklove
Copy link

Ah, that was it, I had to run :nativeinstall. Not sure how I missed that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants