ORCUS Logo
Datenschutz Impressum Kontakt
Referenzen News Externe Links
email

externer Anbieter: translate.google.com

Datenschutz-Hinweis: Durch Auswahl von "OK":

OK

externer Anbieter: validator.w3.org

Datenschutz-Hinweis: Durch Auswahl von "OK":

OK

externer Anbieter: validator.w3.jigsaw.w3.org

Datenschutz-Hinweis: Durch Auswahl von "OK":

OK
prev. page next page / HOME / IRC - LM support / ot-snippet - simple IRC-helper /[symbolic links]

symlink custom files

In case you want to keep an identical version of snippets for both parameter or stream mode there is no need for two copies of the same file. Its enough to keep one real custom file and add a symbolic link, matching the expected custom file name.

Assuming there exists ot-snippet-strm.txt which shall be used for editing, its enough to add a symbolic link matching the expected naming of the parameter mode to get the (shared) custom file used:


ln -s ~/bin/ot-snippet-strm.txt ~/bin/ot-snippet-para.txt
			

Multiple custom files

(since ot-snippet Version >= 001-#56:) As the name of the custom files is derived from the command name used to run ot-snippet, its sufficient to create a different named symbolic link pointing to ot-snippet-002.sh to use a new custom file:


# add a symlink - to make use of another custom-file (e.g. ubuntu)
# the symlink has to end with an ".sh" file-extension:
cd ~/bin
ln -s ot-snippet-002.sh ot-snippet-strm-ubu
ln -s ot-snippet-002.sh ot-snippet-para-ubu
			

To call ot-snippet with a different name you just add another user-command/alias using the symbolic link.

Running ot-snippet via its symlink takes care on creating a matching named custom file:


ot-snippet-para-ubu --new-custom
			
ot-snippet V. 001#66 2019-12-05
custom = /home/demo/bin/ot-snippet-para-ubu.txt
created new custom-file



press Shift+PgUp to scroll back
press RETURN to close window

			

Using a shared custom file with the stream and param version:


# add a symlink using the expected naming to share the custom file
cd ~/bin
ln -s ot-snippet-para-ubu.txt ot-snippet-strm-ubu.txt
			

The custom file will contain a copy of current snippet definitions as given with ot-snippet-002.sh. The header of the --help info output will show the expected path for the custom file and if its available.


ots-ubu.sh --help
			
ot-snippet V. 001#66 2019-12-05 - usage:
/home/demo/bin/ots-ubu.sh <snippet-name> | :|--sel | _|--show | ?|--list | --help | --new-custom

setup-info:
term   = /usr/bin/mate-terminal  available - used 
 version: MATE-Terminal 1.16.3
zenity = /usr/bin/zenity available - used 
 version: 3.28.1
log    = /home/demo/bin/ots-ubu.log missing or empty = no warnings/errors 
custom = /home/demo/bin/ots-ubu.txt available - used

fixes-info:
dbind-warning : inactive - not used
zenity-38-bug : inactive - not used
log-filters   : inactive - not used


press Shift+PgUp to scroll back
press RETURN to close window

			

Besides adding a symlink, you have to add another user-command/alias to your IRC client - using the new symbolic link.

stream mode symlinks

ot-snippet evaluates the name used to call it on startup. If the name matches the pattern ot-snippet-strm* , regular input parameters are read from stdin instead of being expected on the command line.

The only additional command line parameter evaluated in stream mode is the --timeout option, all other options are ignored.

To use several custom files in stream mode means typically to add a matching symbolic link pointing to ot-snippet and to add another user command/alias to make use of that symbolic link.

Abusing the name of the called instance to turn stream mode on and off has the advantage that the required custom commands/aliases can be kept simple - without any additional parameters.

Adding snippets meant for a devuan channel for example:


ln -s ~/bin/ot-snippet-002.sh ~/bin/ot-snippet-strm-devuan

ot-snippet-strm-devuan --new-custom

Editing ~/.config/hexchat/commands.conf manually - appending a new command at the end of the file (using d like devuan here) - the result should look similar to that (leading lines are stripped away):

NAME WII
CMD quote WHOIS %2 %2

NAME S
CMD exec -o ot-snippet-strm

NAME S
CMD execwrite &2

NAME P
CMD exec -o ot-snippet-para &2

NAME D
CMD exec -o ot-snippet-strm-devuan

NAME D
CMD execwrite &2



prev. page next page / HOME / IRC - LM support / ot-snippet - simple IRC-helper /[symbolic links]