|
|
Command Line OptionsThere are a few command line options that you may find interesting for if you want to change behavior, modify an existing instance of XChat, or figure out where a problem is. This page is intended to help you in the use of these lovely command line options. Sections:
Command Line Help OutputFrom the Command Line, you can obtain options for how you want to run XChat. You can always see this list by typing xchat --help, but they are included on this page for your information. On Linux$ xchat --help Usage: xchat [OPTION...] Help Options: -?, --help Show help options --help-all Show all help options --help-gtk Show GTK+ Options Application Options: -a, --no-auto Don't auto connect to servers -d, --cfgdir=PATH Use a different config directory -n, --no-plugins Don't auto load any plugins -p, --plugindir Show plugin auto-load directory -u, --configdir Show user config directory --url=URL Open an irc://server:port/channel URL -c, --command=COMMAND Execute command: -e, --existing Open URL or execute command in an existing XChat --minimize=level Begin minimized. Level 0=Normal 1=Iconified 2=Tray -v, --version Show version information --display=DISPLAY X display to use On WindowsIn order to have xchat --help work on Windows, you need to be inside of the XChat application directory (C:\Program Files\xchat\). This is because the directory is not part of the PATH environment. You will also need to be inside this directory any time you wish to write xchat in the Command Prompt, rather than "C:\Program Files\xchat\xchat". However, the following is the output from the --help or %-? option. Usage: xchat.exe [OPTION...] Options: -?, --help Show help options -a, --no-auto Don't auto connect to servers --command=COMMAND Send a command to existing xchat -d, --cfgdir=PATH Use a different config directory -n, --no-plugins Don't auto load any plugins -p, --plugindir Show plugin auto-load directory -u, --configdir Show user config directory --existing Try to open URL in existing xchat --url=URL Open an irc://server:port/channel URL --minimize=level Begin minimized. Level 0=Normal 1=Iconified 2=Tray -v, --version Show version information Changing the Default Open BehaviorUsing the above information, you can change what XChat does when it opens up by clicking on the Icon. Using the --minimize=2 option, you could start XChat up, and immediately have it minimized to the system tray, but it would be a pain to have to type xchat --minimize=2 or "c:\Program Files\xchat\xchat.exe" --minimize=2 each time you want to run XChat, so instead, you would want to modify the shortcut you launch. Modifying XChat shortcut in GNOME
![]() Press Close two times, and XChat will now start minimized to the System Tray Modifying XChat shortcut in KDE4
![]() Modifying XChat shortcut in Xfce and LXDEFor Desktop Environments other than those with a graphical way to configure the menu, but follow the freedesktop.org specifications (such as Xfce and LXDE), use the following method:
Modifying XChat shortcut on Windows
If you wanted to start minimized to the application bar instead, then you would use --minimize=1. Isolating a problem in XChatSometimes, XChat will stop behaving the way you remember it. While it is possible this is a bug, it may be a problem with your profile. You can experiment with a few of the command line options to see if the behavior clears itself up. Don't Load Plugins and ScriptsThere are times when a script you recently loaded will now cause problems for XChat, perhaps crashing. XChat allows for a lot of flexibility in scripts, and does not do much in terms of forcing these scripts to play "nice". Because of that, you may have a script that is not releasing itself, or looping, causing XChat to be unusable. Perhaps the simplest way to check for this is using the -n or --no-plugins option. xchat -n
This may be enough, or it may not, you have other options as well. Don't Auto Connect to ServersSometimes, while debugging XChat, you don't want to repeatedly join the servers that you normally Auto Connect? to, because you will continually be opening and closing XChat. You could modify each of your Servers and disable the Auto Connect option, or you could simply use the -a or --no-auto option: xchat -a
You can combine this with the -n flag in a variety of ways:
Using a Different ProfileSometimes, you may want a clean or separate profile from your main XChat profile. You could run a separate set of scripts, different configurations, or just check to see what default behavior is. xchat -d /tmp/bob
-or-
"C:\Program Files\xchat\xchat.exe" -d %TEMP%\bob
On Linux/BSD, the above would start a new instance of XChat, and save the Profile Directory information in /tmp/bob. This directory would be created if it doesn't exist already (but only if the parent directory already exists, so if you do xchat -d /tmp/george/man, and /tmp/george doesn't already exist, it will not be created). This can be extremely useful if you want to make sure that a clean instance of XChat works, since the /set Variables will be at their defaults, and there won't be any other configuration changes. You can also see what the default value of Text Events are using this option. Saving the profile in /tmp is not a good idea if you may want to use this profile again, or if you use it regularly, as it may be deleted at any time. You may want one of the following options in this case:
You could either run one of these from the command line, or create a shortcut for it, since you will be using it regularly. Running a command on an Existing InstanceYou can also issue commands from the command line to an existing instance of XChat, however you cannot specify which instance of XChat will run the command! It is important that you understand this bit of information before we continue, but this does not apply to you if you only run XChat one at a time. If you do run multiple profiles or instances, the --command option will just pick one of the instances, and it may not be the same one every time. With that out of the way, you may find an important use for the --command option. In the most basic form, you can see the use by doing: xchat --command="echo george was here"
This will echo the text george was here in the active XChat context window, which isn't necessarily the front window (but many times is). Simply printing text the screen isn't very useful, but you can run any XChat Command rather than just "echo", so you could connect to a new server using: xchat --command="newserver freenode"
You can only run one command per line, but if you need to, you could run multiple xchat command lines in row. On Linux (or when built from source), this option only works if XChat is built with DBus support. Joining a channel on an Existing InstanceIf you want to join a server and a channel, you can use the --exisiting option, but just like for --command, this may give you odd behavior if you run more than one instance of XChat. The syntax is explained in the help output, but is summarized as: xchat --existing --url=IRC://irc.freenode.net/xchat
You could use this for a URL handler for the IRC protocol links within your browser if you like. Just as with --command, --exisitng only works on Linux machines that have XChat compiled with DBus support |


