Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 285 additions & 0 deletions HomeKeyPlugInsFR.HC
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
// FKey by L0Wigh

asm
{
FN_KEY_SCAN_DECODE_TABLE::
DU8 0, CH_ESC, "&�\"'(-�_��)=", CH_BACKSPACE, '\t';
DU8 "azertyuiop^$$", '\n', "<", "qs";
DU8 "dfghjklm�*", 0, "*wxcv";
DU8 "bn,;:!", 0, '*', 0, CH_SPACE, 0, 0, 0, 0, 0, 0;
DU8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0;
FS_KEY_SCAN_DECODE_TABLE::
DU8 0, CH_SHIFT_ESC, "1234567890�+", CH_BACKSPACE, '\t';
DU8 "AZERTYUIOP??", '\n', 0, "QS";
DU8 "DFGHJKLM%\\", 0, "*WXCV";
DU8 "BN?./?", 0, '*', 0, CH_SPACE, 0, 0, 0, 0, 0, 0;
DU8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0;
FC_KEY_SCAN_DECODE_TABLE::
DU8 0, CH_ESC, "1234567890-=", CH_BACKSPACE, '\t';
DU8 CH_CTRLQ, CH_CTRLW, CH_CTRLE, CH_CTRLR, CH_CTRLT, CH_CTRLY, CH_CTRLU,
CH_CTRLI, CH_CTRLO, CH_CTRLP, "[]", '\n', 0, CH_CTRLA, CH_CTRLS;
DU8 CH_CTRLD, CH_CTRLF, CH_CTRLG, CH_CTRLH, CH_CTRLJ, CH_CTRLK, CH_CTRLL,
";'\`", 0, "\\", CH_CTRLZ, CH_CTRLX, CH_CTRLC, CH_CTRLV;
DU8 CH_CTRLB, CH_CTRLN, CH_CTRLM, ",./", 0, '*', 0, CH_SPACE, 0, 0, 0, 0, 0, 0;
DU8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0;
};

MemCpy(NORMAL_KEY_SCAN_DECODE_TABLE, FN_KEY_SCAN_DECODE_TABLE, 64);
MemCpy(SHIFT_KEY_SCAN_DECODE_TABLE, FS_KEY_SCAN_DECODE_TABLE, 64);
MemCpy(CTRL_KEY_SCAN_DECODE_TABLE, FC_KEY_SCAN_DECODE_TABLE, 64);
U0 TimeIns()
{
CDate cdt;
cdt = Now;
"$$IV,1$$----%D %T----$$IV,0$$\n", cdt, cdt;
}

Bool MyPutKey(I64 ch,I64 sc)
{//ch=ASCII; sc=scan_code

//See $LK,"Char",A="HI:Char"$ for definition of scan codes.
//See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.DD"$.
//See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$.

//You can customize keys. This routine
//is called before the main editor
//key hndlr $LK,"DocPutKey",A="MN:DocPutKey"$().
//You can intercept any key.

//Return TRUE if you completely
//handled the key.
I64 i;
U8 *st1,*st2;

// Adding support for ISO layout
if (sc&0x7F==0x56 && !(sc&SCF_CTRL||sc&SCF_KEY_DESC)){
if(sc&SCF_ALT)
'|';
else if(sc&SCF_SHIFT^^sc&SCF_CAPS)
'>';
else
'<';
return TRUE;
}

if (sc&SCF_ALT && !(sc&SCF_CTRL)) {
switch (ch) {
case 0:
switch (sc.u8[0]) {
case SC_F1:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Dol/LTPURPLE");
else
"$$LTPURPLE$$";
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Dol/PURPLE");
else
"$$PURPLE$$";
}
return TRUE;
case SC_F2:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Dol/LTRED");
else
"$$LTRED$$";
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Dol/RED");
else
"$$RED$$";
}
return TRUE;
case SC_F3:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Dol/LTGREEN");
else
"$$LTGREEN$$";
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Dol/GREEN");
else
"$$GREEN$$";
}
return TRUE;
case SC_F4:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Dol/Default Color");
else
"$$FG$$";
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Dol/BLUE");
else
"$$BLUE$$";
}
return TRUE;
case SC_F7:
if (!(sc&SCF_SHIFT)) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd/TimeIns");
else
TimeIns;
}
return TRUE;
}
break;
case 'a':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd/AutoComplete On");
else
AutoComplete(ON);
return TRUE;
case 'A':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd/AutoComplete Off");
else
AutoComplete;
return TRUE;
case 'h':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd/WinTileHorz");
else
WinTileHorz;
return TRUE;
case 'm':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd/WinMax");
else {
WinBorder;
WinMax;
}
return TRUE;
case 'v':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd/WinTileVert");
else
WinTileVert;
return TRUE;
case 'l':
if (sc&SCF_KEY_DESC)
KeyDescSet("Edit/Put Link to Cur Pos on Clip");
else {
ClipDel;
st1=FileNameAbs(BIBLE_FILENAME);
st2=FileNameAbs(DocPut->filename.name);
if (!StrCmp(st1,st2)) {
Free(st1);
st1=BibleLine2Verse(DocPut->cur_entry->y+1,',');
DocPrint(sys_clip_doc,"$$LK,\"BF:%s\"$$",st1);
} else
DocPrint(sys_clip_doc,"$$LK,\"FL:%s,%d\"$$",
st2,DocPut->cur_entry->y+1);
Free(st1);
Free(st2);
}
return TRUE;
case 'L':
if (sc&SCF_KEY_DESC)
KeyDescSet("Edit/Place Anchor, Put Link to Clip");
else {
i=RandU32;
ClipDel;
DocPrint(sys_clip_doc,"$$LK,\"<TODO>\",A=\"FA:%s,ANC%d\"$$",
DocPut->filename.name,i);
"$$AN,\"<TODO>\",A=\"ANC%d\"$$",i;
}
return TRUE;
//Ins your own ALT-key plug-ins
case '�':
if (!(sc&SCF_KEY_DESC))
'~';
return TRUE;
case '\"':
if (!(sc&SCF_KEY_DESC))
'#';
return TRUE;
case '\'':
if (!(sc&SCF_KEY_DESC))
'{';
return TRUE;
case '(':
if (!(sc&SCF_KEY_DESC))
'[';
return TRUE;
case '-':
if (!(sc&SCF_KEY_DESC))
'|';
return TRUE;
case '�':
if (!(sc&SCF_KEY_DESC))
'`';
return TRUE;
case '_':
if (!(sc&SCF_KEY_DESC))
'\\';
return TRUE;
case '�':
if (!(sc&SCF_KEY_DESC))
'^';
return TRUE;
case '�':
if (!(sc&SCF_KEY_DESC))
'@';
return TRUE;
case ')':
if (!(sc&SCF_KEY_DESC))
']';
return TRUE;
case '=':
if (!(sc&SCF_KEY_DESC))
'}';
return TRUE;
}
}
return FALSE;
}

Bool MyPutS(U8 *)
{
return FALSE;
}

KeyDevAdd(&MyPutKey,&MyPutS,0x20000000,TRUE);

// just in case of issues
// case '1':
// if (sc&SCF_KEY_DESC)
// KeyDescSet("Dol/�");
// else
// '�';
// return TRUE;
// case '2':
// if (sc&SCF_KEY_DESC)
// KeyDescSet("Dol/�");
// else
// '�';
// return TRUE;
// case '3':
// if (sc&SCF_KEY_DESC)
// KeyDescSet("Dol/�");
// else
// '�';
// return TRUE;
// case '4':
// if (sc&SCF_KEY_DESC)
// KeyDescSet("Dol/�");
// else
// '�';
// return TRUE;
// case '9':
// if (sc&SCF_KEY_DESC)
// KeyDescSet("Dol/Indent 5");
// else
// "$$ID,5$$";
// return TRUE;
// case '0':
// if (sc&SCF_KEY_DESC)
// KeyDescSet("Dol/Unindent 5");
// else
// "$$ID,-5$$";
// return TRUE;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


### Preface
TinkerOS is essentially TempleOS renamed with some changes that allow it to run bare metal on some more modern machines since it "only" requires real or emulated PS/2 keyboard and mouse input and legacy boot support, but does not require legacy / IDE disk support. Though some improvements and bug fixes are added to TinkerOS, 95% of the code is the same as TempleOS and TinkerOS can install and compile TempleOS. TempleOS on the other hand requires hardware which supports Terry's hard coded 640x480 video mode which has been deprecated on some newer machines. Also TempleOS requires an IDE drive interface or legacy ATA SATA support. TinkerOS supports AHCI SATA mode installation. It also has a "Live USB" version which runs from a RAM disk which allows it to be tried without installing or run on systems without supported drives. You can also use the USB version to install it on supported machines that do not have a CD/DVD drive. If your machine uses the newer EFI boot method, it will still need to support legacy booting (via CSM) which you may need to turn on in your BIOS.
VaticanTempleOS is essentially TinkerOS renamed focused on [Automation](https://en.wikipedia.org/wiki/Automation). It contains custom theme and fonts, among the many home-built features and improvements.

### Goals
- Keep a TempleOS like look and feel while attempting to keep a fully TempleOS compatible API to the maximum extent possible. TinkerOS should always be able to compile and install TempleOS.
Expand Down
25 changes: 25 additions & 0 deletions Setup.HC
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
DocClear;
"\nWould you like to install the French keyboard layout ";

if (YorN)
{
Copy("HomeKeyPlugInsFR.HC", "~/HomeKeyPlugIns.HC");
"\n\nReboot Now ";
if (YorN)
Reboot;
}
else
"\nSetup aborted !\n";

DocClear;

"\nWould you like to set Gruvbox theme ";

if (YorN)
{
#include "~/skins/Gruvbox/Gruvbox.HC"
}
else
"\nSetup aborted !\n";


23 changes: 23 additions & 0 deletions _tools/cleanup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/python3
import os
import sys
import shutil

import workspace.build

# Remove workspace folder
shutil.rmtree("workspace", ignore_errors = True)

# Remove tup database
shutil.rmtree(".tup", ignore_errors = True)

# Make build.py remove the stuff it built
workspace.build.clean()

# Remove files copied from _tools/workspace
tools = os.path.dirname(os.path.realpath(__file__))
tools_workspace = os.path.join(tools, "workspace")
for copied_script in os.listdir(tools_workspace):
if os.path.exists(copied_script):
os.remove(copied_script)

44 changes: 44 additions & 0 deletions _tools/get_started.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/python3
# Copyright Magomed Kostoev
# Published under MIT license

import os
import shutil

from lib.network import download
from lib.logging import log
from lib.constants import tools, tools_workspace, tools_cache, tools_cache_kolibri_img

def generate_script_executing_script(script_to_execute):
script_to_execute = script_to_execute.replace("\\", "\\\\")
contents = ""
contents += "from importlib.machinery import SourceFileLoader\n"
contents += f"SourceFileLoader('__main__', '{script_to_execute}').load_module()\n"
return contents

def create_workspace_script(name, script_to_execute):
log(f"Installing {name}... ", end = "")

script_contents = generate_script_executing_script(script_to_execute)
with open(name, "w") as f:
f.write(script_contents)

log("Done")

if __name__ == "__main__":
# Check if we have tup installed
if shutil.which("tup") == None:
print("Sorry, I haven't found tup")
print("Possible solutions:")
print("- Install tup")
print("- Add tup installation folder to PATH")
exit()
# Initalize tup here
os.system("tup init")
# Create (in current directory) scripts that execute
# the same named scripts from _tools/workspace
tools_workspace_run_py = os.path.join(tools_workspace, "run.py")
tools_workspace_build_py = os.path.join(tools_workspace, "build.py")
create_workspace_script("run.py", tools_workspace_run_py)
create_workspace_script("build.py", tools_workspace_build_py)

Loading