I would like to create a hotkey to toggle between themes (namely austerity and Obsidian).
I thought it might be possible to create a hotkey in each them (not in hotkey.rc). In the austerity theme (in themevars.rc) i put this code...
*hotkey Ctrl S "C:\LiteStep\utilities\LSThemeInstaller.exe "/switch" "Obsidian-v1""
and i pit this code in the obsidian theme in theme.rc...
*hotkey Ctrl S "C:\LiteStep\utilities\LSThemeInstaller.exe "/switch" "austerity""
i get this error when i hit the hotkey...
ERROR: [/switch"] does not exist, exiting.
if you change theme using the 'run task' option in 'task manager' that code works but it obviously doesn't like it in the themes.
can i change it to get it to work or else can i write an IF..ENDIF in the hotkey.rc file which resembles something like this...
IF (austerity is loaded)
*hotkey Ctrl S "C:\LiteStep\utilities\LSThemeInstaller.exe "/switch" "Obsidian-v1""
ENDIF
IF (obsidian is loaded)
*hotkey Ctrl S "C:\LiteStep\utilities\LSThemeInstaller.exe "/switch" "austerity""
ENDIF
i checked lots of previous posts but couldnt find anything to help me.
any help you have would be appreciated.
Your quotes are messed up. The way you have it now, Litestep is probably seeing something like this:
*hotkey Ctrl S "C:\LiteStep\utilities\LSThemeInstaller.exe "" """
It should look like:
*hotkey Ctrl S "C:\LiteStep\utilities\LSThemeInstaller.exe" "/switch" "austerity"
cheers xcal.
i had a look at some docs on wiki.litestep and i figured out that i could do it this way as well...
*Hotkey WIN S !execute [C:\LiteStep\utilities\LSThemeInstaller.exe "/switch" "austerity"]
but what if i wanted to setup a !bang command in the hotkey.rc file so it was something like this
*Hotkey WIN S !ToggleTheme
what i don't know how to do is to create a bang command which detects which theme is currently loaded and based on that loads the other theme (i know i'll need an IF...ENDIF). Also i don't know where to put bang commands. There are over 500 pages on wiki when i search for bang that i feel lost in terms of a starting point for creating my own bang commands.
I know i can put a couple of comments in the evars.rc file like this...
Theme1 ""C:\LiteStep\utilities\LSThemeInstaller.exe" "/switch" "austerity""
Theme2 ""C:\LiteStep\utilities\LSThemeInstaller.exe" "/switch" "Obsidian-v1""
and then call them from a bang command using "$Theme1$" or "$Theme2$" so that i have an easy place to change the themes to toggle between in the future but i don't know much else.
You could just do it the way you had it setup in the first place, by putting the appropriate hotkeys in each theme's theme.rc file.
You could script it, but that would be kind of overkill for something so simple.
Btw, your !execute [command] setup is the exact same thing I have. The difference is, !execute is used when you want to fire a bunch of bangs in a row, like !execute [command1][command2][command3] etc. No point in having it for one command.
ok. cheers again xcal.
btw is there any docs or tutorials for !bangs?
something that explains it well?
i taught myself html, php, mysql and a bit of java through online docs and tutorials but i'm having a bit of a problem understanding litestep. i can se how things work and from reading module docs and config .rc files i am begining to understand how people have set up their themes, but the !bang commands are the one thing i am having some problems with. i'd rather read docs than bug you guys all day long :-)
i think it'll be along time before i ever try making my own theme ;-)
Well, bangs are defined by specific modules loaded. What the specific bangs do is outlined in the module's docs. Bangs, generally, need some kind of event to fire. Events are also defined by the modules loaded, as I'm sure you've seen inside the module docs. Like OnLeftClick !bang, OnEnter !bang, *Popup "Name" !bang (left click is automatically an event in that case), and so on.
In some cases, you don't need a bang. For example, if you want to open a web browser with a label button, you can have:
LabelNameOnLeftClick "$Browser$"
The same button to recycle Litestep:
LabelNameOnLeftClick !recycle
There are a bunch of predefined variables inside the \personal\evars.rc file.
Hold Shift+CTRL (edit - oops, wrong keys originally) and press F1. That will take you to some docs, which are outdated, but still contain useful information. You've already found the wiki, which is a *** to navigate (imo), but also has useful info.
Ah, thats probably what my problem was. i was thinking you could create your own bang commands when in fact they are only defined and used by modules.
the lsdocs.shellfront site looks very useful.
thanks again xcal.
With scripting modules like mzscript or lslua, you can create your own bangs. But still, that's usually for running a series of existing module bangs, after performing some kind of function/changes.
I wouldn't worry about that yet, though. You seem to be on the right path for now.
"i'd rather read docs than bug you guys all day long :-)"
I think I'm gonna cry... :D