diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/android/.config/nvim/init.lua b/android/.config/nvim/init.lua new file mode 100644 index 0000000..4679e3b --- /dev/null +++ b/android/.config/nvim/init.lua @@ -0,0 +1,24 @@ +vim.g.mapleader = ' ' +vim.o.wrap = true +vim.g.maplocalleader = ' ' +vim.o.number = true +vim.o.relativenumber = true +vim.o.mouse = 'a' +vim.schedule(function() + vim.o.clipboard = 'unnamedplus' + +end ) +vim.o.breakindent = true +vim.o.undofile = true +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.signcolumn = 'yes' +vim.o.splitright = true +vim.o.splitbelow = true +vim.olist = true +vim.o.inccommand = 'split' +vim.o.scrolloff = 10 +vim.o.autoindent = true +vim.o.hlsearch = true +vim.keymap.set('n', '', 'nohlsearch') + diff --git a/android/.config/termux/termux.properties b/android/.config/termux/termux.properties new file mode 100644 index 0000000..53dfd34 --- /dev/null +++ b/android/.config/termux/termux.properties @@ -0,0 +1,93 @@ +### This is a `.properties` [https://en.wikipedia.org/wiki/.properties] file +### for termux app properties and is loaded with the `java.util.Properties.load()` +### [https://developer.android.com/reference/java/util/Properties#load(java.io.Reader)] +### call by the termux app and must be formatted as per its spec. +### To make changes to a property value, uncomment the property line by removing +### any hash `#` characters at the start of the line. +### After making required changes, save the file and run `termux-reload-settings` +### in the terminal for changes to take effect. Some properties require app +### process to be restarted to be updated which can be done by force stopping +### the app from Android app settings. +### All information here can also be found on the +### wiki: https://wiki.termux.com/wiki/Terminal_Settings + +############### +# Extra keys +############### + +### Settings for choosing which set of symbols to use for illustrating keys. +### Choose between default, arrows-only, arrows-all, all and none +# extra-keys-style = default + +### Force capitalize all text in extra keys row button labels. +# extra-keys-text-all-caps = true + +### Default extra-key configuration +# extra-keys = [[ESC, TAB, CTRL, ALT, {key: '-', popup: '|'}, DOWN, UP]] + +### Two rows with more keys +# extra-keys = [['ESC','/','-','HOME','UP','END','PGUP'], \ +# ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']] + +### Configuration with additional popup keys (swipe up from an extra key) +# extra-keys = [[ \ +# {key: ESC, popup: {macro: "CTRL f d", display: "tmux exit"}}, \ +# {key: CTRL, popup: {macro: "CTRL f BKSP", display: "tmux ←"}}, \ +# {key: ALT, popup: {macro: "CTRL f TAB", display: "tmux →"}}, \ +# {key: TAB, popup: {macro: "ALT a", display: A-a}}, \ +# {key: LEFT, popup: HOME}, \ +# {key: DOWN, popup: PGDN}, \ +# {key: UP, popup: PGUP}, \ +# {key: RIGHT, popup: END}, \ +# {macro: "ALT j", display: A-j, popup: {macro: "ALT g", display: A-g}}, \ +# {key: KEYBOARD, popup: {macro: "CTRL d", display: exit}} \ +# ]] + +### Another configuration with advanced popup key usage designed for more +### specific use-cases. In this case, it is designed for working with Vim-like +### editors for faster navigation +#extra-keys = [ \ +# [ \ +# { key: ESC, popup: { macro: ":q\n", display: "QuickExit" } }, \ +# { key: '/', popup: '\\\\' }, \ +# { key: '-', popup: '_' }, \ +# { key: HOME, popup: { macro: "CTRL HOME", display: "Top" } }, \ +# { key: UP, popup: { macro: "CTRL UP", display: "UP" } }, \ +# { key: END, popup: { macro: "CTRL END", display: "End" } }, \ +# { key: ":", popup: ";" }, \ +# { key: "(", popup: "{" } \ +# ], \ +# [ \ +# { key: TAB, popup: { macro: ":wq\n", display: "Write And Exit" } }, \ +# { key: CTRL, popup: { macro: ":w\n", display: "Write" } }, \ +# ALT, \ +# { key: LEFT, popup: { macro: "CTRL LEFT", display: "Left" } }, \ +# { key: DOWN, popup: { macro: "CTRL DOWN", display: "Bottom" } }, \ +# { key: RIGHT, popup: { macro: "CTRL RIGHT", display: "Right" } }, \ +# { key: "#", popup: "$" }, \ +# { key: ")", popup: "}" } \ +# ] \ +#] + +############### +# Bell key +############### + +### Vibrate device (default). +# bell-character = vibrate + +### Beep with a sound. +# bell-character = beep + +### Ignore bell character. +# bell-character = ignore + +############### +# Back key +############### + +### Send the Escape key. +# back-key=escape + +### Hide keyboard or leave app (default). +# back-key=back diff --git a/android/.shortcuts/1sshd.sh b/android/.shortcuts/1sshd.sh new file mode 100644 index 0000000..d188a88 --- /dev/null +++ b/android/.shortcuts/1sshd.sh @@ -0,0 +1,5 @@ +#!/data/data/com.termux/files/usr/bin/bash + +/data/data/com.termux/files/usr/bin/sshd +echo "We need to pause this or the sshd will be killed with Termux." +read -p "press enter to continue" diff --git a/android/.shortcuts/pull-graph.sh b/android/.shortcuts/2pull-graph.sh similarity index 100% rename from android/.shortcuts/pull-graph.sh rename to android/.shortcuts/2pull-graph.sh diff --git a/android/.shortcuts/stash.sh b/android/.shortcuts/3stash-graph.sh similarity index 59% rename from android/.shortcuts/stash.sh rename to android/.shortcuts/3stash-graph.sh index 7a05a82..8baa20d 100644 --- a/android/.shortcuts/stash.sh +++ b/android/.shortcuts/3stash-graph.sh @@ -1,5 +1,7 @@ #!/data/data/com.termux/files/usr/bin/bash +targetpath=/data/data/com.termux/files/home/storage/documents/ + cd ${targetpath}logseq-gitea/logseq git stash diff --git a/android/.shortcuts/push-graph.sh b/android/.shortcuts/4push-graph.sh similarity index 100% rename from android/.shortcuts/push-graph.sh rename to android/.shortcuts/4push-graph.sh diff --git a/android/.shortcuts/5it-status.sh b/android/.shortcuts/5it-status.sh new file mode 100644 index 0000000..507a27e --- /dev/null +++ b/android/.shortcuts/5it-status.sh @@ -0,0 +1,37 @@ +#/data/data/com.termux/files/usr/bin/bash + +data=`/data/data/com.termux/files/usr/bin/curl -s -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/status` + + +echo +echo +echo + +air_conditioner_mode=`echo ${data} | /data/data/com.termux/files/usr/bin/jq .components.main.airConditionerMode.airConditionerMode.value` +echo "Air conditioner mode: ${air_conditioner_mode}" +echo + + +cooling_setpoint=`echo ${data} | /data/data/com.termux/files/usr/bin/jq .components.main.thermostatCoolingSetpoint.coolingSetpoint.value` +echo "Cooling setpoint: ${cooling_setpoint}" +echo + + +switch=`echo ${data} | /data/data/com.termux/files/usr/bin/jq .components.main.switch.switch.value` +echo "Switch (power): ${switch}" +echo + + +current_temperature=`echo ${data} | /data/data/com.termux/files/usr/bin/jq .components.main.temperatureMeasurement.temperature.value` +echo "Current temperature: ${current_temperature}" +echo + + + + +echo +echo +echo + +read -p "Press enter to continue" throwaway + diff --git a/android/.shortcuts/6it-on.sh b/android/.shortcuts/6it-on.sh new file mode 100644 index 0000000..0cdbc63 --- /dev/null +++ b/android/.shortcuts/6it-on.sh @@ -0,0 +1,4 @@ +#/data/data/com.termux/files/usr/bin/bash + +data=`/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"switch","command":"on","arguments":[]}]}'` + diff --git a/android/.shortcuts/7it-off.sh b/android/.shortcuts/7it-off.sh new file mode 100644 index 0000000..32a267a --- /dev/null +++ b/android/.shortcuts/7it-off.sh @@ -0,0 +1,4 @@ +#/data/data/com.termux/files/usr/bin/bash + +data=`/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"switch","command":"off","arguments":[]}]}'` + diff --git a/android/.shortcuts/8it-config-auto.sh b/android/.shortcuts/8it-config-auto.sh new file mode 100644 index 0000000..de5e171 --- /dev/null +++ b/android/.shortcuts/8it-config-auto.sh @@ -0,0 +1,8 @@ +#/data/data/com.termux/files/usr/bin/bash + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"thermostatCoolingSetpoint","command":"setCoolingSetpoint","arguments":[24]}]}' + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"airConditionerFanMode","command":"setFanMode","arguments":["low"]}]}' + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"airConditionerMode","command":"setAirConditionerMode","arguments":["cool"]}]}' + diff --git a/android/.shortcuts/8it-config-max.sh b/android/.shortcuts/8it-config-max.sh new file mode 100644 index 0000000..f85b3cd --- /dev/null +++ b/android/.shortcuts/8it-config-max.sh @@ -0,0 +1,8 @@ +#/data/data/com.termux/files/usr/bin/bash + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"thermostatCoolingSetpoint","command":"setCoolingSetpoint","arguments":[18]}]}' + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"airConditionerFanMode","command":"setFanMode","arguments":["turbo"]}]}' + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"airConditionerMode","command":"setAirConditionerMode","arguments":["cool"]}]}' + diff --git a/android/.shortcuts/8it-config-stepan.sh b/android/.shortcuts/8it-config-stepan.sh new file mode 100644 index 0000000..de5e171 --- /dev/null +++ b/android/.shortcuts/8it-config-stepan.sh @@ -0,0 +1,8 @@ +#/data/data/com.termux/files/usr/bin/bash + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"thermostatCoolingSetpoint","command":"setCoolingSetpoint","arguments":[24]}]}' + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"airConditionerFanMode","command":"setFanMode","arguments":["low"]}]}' + +/data/data/com.termux/files/usr/bin/curl -s -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d '{"commands":[{"component":"main","capability":"airConditionerMode","command":"setAirConditionerMode","arguments":["cool"]}]}' + diff --git a/android/.shortcuts/9it-set-temp.sh b/android/.shortcuts/9it-set-temp.sh new file mode 100644 index 0000000..4fd469a --- /dev/null +++ b/android/.shortcuts/9it-set-temp.sh @@ -0,0 +1,22 @@ +#/data/data/com.termux/files/usr/bin/bash + +read -p "Enter desired temperature and press enter: " temperature + +echo +echo "Temperature set to: ${temperature}" + +begging='{"commands":[{"component":"main","capability":"thermostatCoolingSetpoint","command":"setCoolingSetpoint","arguments":[' +rest="]}]}" +command=${begging}${temperature}${rest} + +echo +echo +echo "Command is:" +echo ${command} +echo +echo + +/data/data/com.termux/files/usr/bin/curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/commands -d ${command} | /data/data/com.termux/files/usr/bin/jq + +read -p "press enter to continue" throwaway + diff --git a/android/.shortcuts/termux-bck.sh b/android/.shortcuts/termux-bck.sh new file mode 100644 index 0000000..7bf9aaa --- /dev/null +++ b/android/.shortcuts/termux-bck.sh @@ -0,0 +1,4 @@ +#!/data/data/com.termux/files/usr/bin/bash +tar -zcf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files ./home ./usr + + diff --git a/android/.shortcuts/termux-restore.sh b/android/.shortcuts/termux-restore.sh new file mode 100644 index 0000000..5388466 --- /dev/null +++ b/android/.shortcuts/termux-restore.sh @@ -0,0 +1,7 @@ +#!/data/data/com.termux/files/usr/bin/bash +termux-setup-storage + +tar -zxf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files --recursive-unlink --preserve-permissions + + + diff --git a/android/.ssh/authorized_keys b/android/.ssh/authorized_keys new file mode 100644 index 0000000..0d0d1e6 --- /dev/null +++ b/android/.ssh/authorized_keys @@ -0,0 +1,2 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDW3/GxmjErPWJp0KIEyY2rC0yQI2urrmf3Y/4NIyF++Ap3iad5FzfK09ZgCIAPKYvwnibOQL93k2OBKCARRQBH5dyiBJf/J6oqCCWuyn7oY05MMGTkFaRijC3qUNeH9lZpzZMK+aaM1RS2geqR+9xYR9RmgPweAfxL8OYYXjPY5nl1jAEbUg4BrWQ61MBxzPYTyYhI8sN1H4kqRAXlzm4TQZq3bvLT5bxLskZCG9NEuk06zrNpOJDaIgN22JdT1KqgQbH6pejm6NP1KVLz59iZ66IXpj1utBuSuDORzdCEi67Q1tq1WXk8aU07MkbHCkWU70GolR0oZNYukB1Ti6Dx+St0UpGhjL3UVtm51SuebbW3u99vTJShavbD5uW3M6HEFbwI2y+MbRUHp6MTjgsjpg88XF7o8gZZ3qYTLpLXkGwdIsfO262E6b8KSeaAQ+CvpI1YVY9A0tC7Iiwn5Wi9wpZB/EaLMvYk89B+eTZWO0bwW2RvJZ58Orhodavgr19xYQEAU7M7C2QNVYWWXSdsp132qHBn0Q4KaHTlrc1fikXh7630FHHTLSuVWFpfpSLaPZa/Vl2P3nzviWlqoIPvI0pThMTDlXsAB0WLM/qR9AqCx76FOGaZnJZbdIyRbqgiJli/mOCzCzmeSfxZj5FVHcmWI7MQJEkt5ADhqqzHew== StepanKuklis@github/122190469 # ssh-import-id gh:StepanKuklis + diff --git a/android/.ssh/known_hosts b/android/.ssh/known_hosts new file mode 100644 index 0000000..51487bf --- /dev/null +++ b/android/.ssh/known_hosts @@ -0,0 +1,3 @@ +[gitea.panpanika.eu]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICgQxm9EvJBr9CkbX6WQUXTD+AHqmIRjQjcweYxerRt0 +[gitea.panpanika.eu]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzuObGHAqs0KACpfw1WSqz68x8svgSH1xQ4z2thG9+YyBwAfQI4Tukj6/fSFV0mNR5QHixJq0wIP3LuLtMxUo6GQFjsXLV0XOMVWVUcVnOlI6WELFUepzqniZXBFrVMbWOA1V2O5jRaqCP8mqrhfUT9pI4WrrGbhyaeP5eYBUU8uHug4PBDHW8M8Kz1Xqk6+LFfCjzFSxXny6GMszvQPtE3V+bck0zH48xS4r239MixwEfsxdzTcq2u6KRkNCizaQK+GQpc1T6rfNqgekmvfbOQqRIUfQwDSzWle8k4vUPf/Qkt/idf1J9bICXzk+FLnfmBC5bavePTTa+jDTEXorB +[gitea.panpanika.eu]:2222 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEcofL0HJSjZ9esJMj9emO/wfE/nmlNc9xViVlETorAmJUKZE/Sob9tfDfJJv7ftsfRzwBrPbKygb4R7pMcODNY= diff --git a/android/.termux/colors.properties b/android/.termux/colors.properties new file mode 100644 index 0000000..0849f22 --- /dev/null +++ b/android/.termux/colors.properties @@ -0,0 +1,33 @@ +## Name: TokyoNight + +# Special +foreground = #c0caf5 +background = #1a1b26 +cursor = #c0caf5 +# Black/Grey +color0 = #15161e +color8 = #414868 +# Red +color1 = #f7768e +color9 = #f7768e +# Green +color2 = #9ece6a +color10 = #9ece6a +# Yellow +color3 = #e0af68 +color11 = #e0af68 +# Blue +color4 = #7aa2f7 +color12 = #7aa2f7 +# Magenta +color5 = #bb9af7 +color13 = #bb9af7 +# Cyan +color6 = #7dcfff +color14 = #7dcfff +# White/Grey +color7 = #a9b1d6 +color15 = #c0caf5 +# Other +color16 = #ff9e64 +color17 = #db4b4b diff --git a/android/.termux/font.ttf b/android/.termux/font.ttf new file mode 100644 index 0000000..b8910ab Binary files /dev/null and b/android/.termux/font.ttf differ diff --git a/android/.termux/termux.properties b/android/.termux/termux.properties new file mode 100644 index 0000000..b1b4cf9 --- /dev/null +++ b/android/.termux/termux.properties @@ -0,0 +1,3 @@ +bell-character = vibrate +terminal-margin-horizontal = 3 +terminal-margin-vertical = 1 diff --git a/android/README.md b/android/README.md new file mode 100644 index 0000000..aba7e25 --- /dev/null +++ b/android/README.md @@ -0,0 +1,35 @@ +# Logseq on adnroid +# Also how to setup busybox +- We must install termux from f-droid + - Google play version is somehow flawed + - https://github.com/termux/termux-app#f-droid + - https://f-droid.org/en/packages/com.termux/ + - https://f-droid.org/en/packages/com.termux.styling + - for JetBrains font + - https://f-droid.org/en/packages/com.termux.widget + - https://f-droid.org/en/packages/com.termux.api + - not sure if it does something or is needed at all + +## Restore +- We restore former settings from backup + - https://wiki.termux.com/wiki/Backing_up_Termux + - nextcloud / backup / termux-backup.tar.gz + - ```termux-setup-storage``` + - ```tar -zxf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files --recursive-unlink --preserve-permissions``` + +## Fresh install +- for fresh install we can use ```logseq-gitea-init.sh``` +- copy files from this repo to the home + + +## Useful links for reference and further exploration +- https://termux.dev/en/ +- https://github.com/termux/termux-widget +- https://wiki.termux.com/wiki/Hardware_Keyboard +- https://wiki.termux.com/wiki/Terminal_Settings +- https://f-droid.org/en/packages/juloo.keyboard2 + + +- https://f-droid.org/en/packages/com.termux.nix +- https://f-droid.org/en/packages/com.termux.boot +