9/19
i've been playing around with nano, micro, and mcedit and have developed a distinct preference for micro. i'm more used to its built in shortcuts (typical word processor copy paste select all, etc) and with a few tweaks it's getting to be almost as useful as geany. with the github colorscheme (ctrl+e > set colorscheme github) on an android box running termux/tmux, you get that tv is off aesthetic while still having a powerful text editor that does in fact offer to reload when you've changed your synced files elsewhere on the system (apologies for an earlier post down at murga-linux that claimed otherwise--i must've been thinking of nano). the pinstall script for microdocs1.1 can explain a little further why this pet exists
#!/bin/sh
mkdir -p /root/.config/rox.sourceforge.net/Templates/microdocs
cd /root/.config/rox.sourceforge.net/Templates/microdocs
microdoc
cd /root/.config/rox.sourceforge.net/Templates/microdocs/10110/
#(10 of 1-10)
mbatch10
cd /root/.config/rox.sourceforge.net/Templates/microdocs/az10/
mbatchaz
cd /root/.config/rox.sourceforge.net/Templates/microdocs/azaz/
mbatchaz
cd /root/.config/rox.sourceforge.net/Templates/microdocs/10az/
mbatch10
#microdoc00 produces considerably more files and is better done through the terminal than right click menu (feels instantaneous compared to watching rox display the names as they move). both versions cat (combine) all to micro with the callm callm2 scripts. pet fixes the ctrl+b conflict with tmux (shell mode for micro is tmux's command prefix). code for batch launching a directory's so short the launchers don't really save too much time relative to the space they take up (one per directory), so none for the 100s and an option for 10s (26x26 gets made by both microdoc and microdoc00)
#update to 1.1. adds microdoc0, which calls both to a directory (backtick, microdoc0) and tmuxm, which is set to enable mouse control on tmux vintage tahr and older. (comment out what's there and uncomment (or manage to remember) tmux set -g mouse for xenial and newer. not sure about which version to use for what slacko or unicorn)
#cat ./az100/{a..z}/* ./azaz2/{a..z}/* ./100az/{1..100}/* ./100/{1..100}/* | micro
#cat ./N/* | micro
#micro ./N/*
#added many of the non tc (true color) colorschemes from micros website
#new keycuts are f6 close all, f7 shell mode, f8 save all, f9 save as, alt t tab switch (enter name or number in status bar)
#microdoc and microdoc00 can be called to the same directory without overwriting one another. default for right click is microdocs (ten versus 100 version) with the mini batch scripts included in the subdirectories.
#p. dogfellow 9/29/19
#see micro's website for more
https://micro-editor.github.io/
though it would take some rationale of the logic behind androido and tnux.1_ to see what's being improved and why. basically, this pet makes it easy to call, navigate, and collect the text from batches of files using micro and the cat utility. here's the tree -sa output of the pet:
root# tree -sa
.
├── [ 140] pet.specs
├── [ 1971] pinstall.sh
└── [ 80] root
├── [ 60] .config
│ └── [ 80] micro
│ ├── [ 112] bindings.json
│ └── [ 440] colorschemes
│ ├── [ 802] bubblegum.micro
│ ├── [ 1374] cmc16.micro
│ ├── [ 1316] cmcpaper.micro
│ ├── [ 770] codeblocks.micro
│ ├── [ 824] codeblocks-paper.micro
│ ├── [ 1073] darcula.micro
│ ├── [ 1057] default.micro
│ ├── [ 678] geany.micro
│ ├── [ 810] github.micro
│ ├── [ 591] gruvbox.micro
│ ├── [ 1057] monokai.micro
│ ├── [ 1038] nano.micro
│ ├── [ 1031] railscast.micro
│ ├── [ 817] simple2.micro
│ ├── [ 811] simple.micro
│ ├── [ 807] solarized2.micro
│ ├── [ 814] solarized3.micro
│ ├── [ 941] solarized.micro
│ ├── [ 1067] twilight.micro
│ └── [ 722] zenburn.micro
└── [ 60] my-applications
└── [ 180] bin
├── [ 113] getmicro
├── [ 408] mbatch10
├── [ 1012] mbatchaz
├── [ 1402] microdoc
├── [ 29] microdoc0
├── [ 1394] microdoc00
└── [ 215] tmuxm
6 directories, 30 files
_____
here's microdoc:
(sorry, but i don't have the energy to mimic geany's syntax highlighting like i did with the pinstall script (plus it's also got orange and really green is for numbers there and code on forums (generally), and i'd have to change most of the non commented text back to black...):
#!/bin/sh
mkdir -p ./10110/{1..10}/
touch ./10110/{1..10}/{1..10}
mkdir -p ./10az/{1..10}/
touch ./10az/{1..10}/{a..z}
mkdir -p ./az10/{a..z}/
touch ./az10/{a..z}/{1..10}
mkdir -p ./azaz/{a..z}/
touch ./azaz/{a..z}/{a..z}
#./10110/m110 ##10X10
#./az10/m110 ##26X10
#./azaz/maz ##26X26
#./10az/maz ##10X26
echo $'#!/bin/sh
cat ./{1..10}/* >> ./10.txt
micro ./10.txt
' > ./10110/m110
chmod 755 ./10110/m110
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
micro ./az.txt
' > ./az10/maz
chmod 755 ./az10/maz
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
micro ./az.txt
' > ./azaz/maz
chmod 755 ./azaz/maz
echo $'#!/bin/sh
cat ./{1..10}/* >> ./10.txt
micro ./10.txt
' > ./10az/m110
chmod 755 ./10az/m110
#cat only version plus open the 4 catted directories as 4 files in micro:
echo $'#!/bin/sh
cat ./{1..10}/* >> ./10.txt
' > ./10110/m110c
chmod 755 ./10110/m110c
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
micro ./az.txt
' > ./az10/maz
chmod 755 ./az10/maz
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
' > ./azaz/mazc
chmod 755 ./azaz/mazc
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
micro ./az.txt
' > ./az10/mazc
chmod 755 ./az10/mazc
echo $'#!/bin/sh
cat ./{1..10}/* >> ./10.txt
' > ./10az/m110c
chmod 755 ./10az/m110c
echo $'#!/bin/sh
#callm
#cat the four directories and open them up with micro
cat ./az10/{a..z}/* ./azaz/{a..z}/* ./10az/{1..10}/* ./10110/{1..10}/* | micro
' > ./callm
chmod 755 ./callm
here's microdoc00, which makes and can call/cat even more files (as with the above set, you add, rename, remove contents to/of/from the subdirectories without affecting the efficacy of the tips or scripts):
#!/bin/sh
mkdir -p ./100/{1..100}/
touch ./100/{1..100}/{1..100}
mkdir -p ./100az/{1..100}/
touch ./100az/{1..100}/{a..z}
mkdir -p ./az100/{a..z}/
touch ./az100/{a..z}/{1..100}
mkdir -p ./azaz2/{a..z}/
touch ./azaz2/{a..z}/{a..z}
#./100/m110 ##100X100
#./az100/m110 ##26X100
#./azaz2/maz ##26X26
#./100az/maz ##100X26
echo $'#!/bin/sh
cat ./{1..100}/* >> ./100.txt
micro ./100.txt
' > ./100/m110
chmod 755 ./100/m110
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
micro ./az.txt
' > ./az100/maz
chmod 755 ./az100/maz
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
micro ./az.txt
' > ./azaz2/maz
chmod 755 ./azaz2/maz
echo $'#!/bin/sh
cat ./{1..100}/* >> ./100.txt
micro ./100.txt
' > ./100az/m110
chmod 755 ./100az/m110
#cat only version
echo $'#!/bin/sh
cat ./{1..100}/* >> ./100.txt
' > ./100/m110c
chmod 755 ./100/m110c
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
micro ./az.txt
' > ./az100/maz
chmod 755 ./az100/maz
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
' > ./azaz2/mazc
chmod 755 ./azaz2/mazc
echo $'#!/bin/sh
cat ./{a..z}/* >> ./az.txt
micro ./az.txt
' > ./az100/mazc
chmod 755 ./az100/mazc
echo $'#!/bin/sh
cat ./{1..100}/* >> ./100.txt
' > ./100az/m110c
chmod 755 ./100az/m110c
echo $'#!/bin/sh
#m100azcall
#callm2
#cat the four directories and open them up with micro
cat ./az100/{a..z}/* ./azaz2/{a..z}/* ./100az/{1..100}/* ./100/{1..100}/* | micro
' > ./callm2
chmod 755 ./callm2
____
that's basically it. the getmicro script is on the path like in the tnux scripts: i consider this more or less an improvement of those pets (minus the provisions for the other terminal text editors).
...here's the config file for the keys that gets added to /root/.config/micro:
{
"F6": "QuitAll",
"F7": "ShellMode",
"F8": "SaveAll",
"F9": "SaveAs",
"Alt-t": "command-edit:tabswitch "
}
F6 comes in handy because the batches take a while to close even at .12 seconds per (hold down ctrl plus q otherwise). alt+t comes in handy for a similar reason--entering 85 or 13 (m) or the name is faster than holding down alt+ , or .
this version makes almost no txt files for the catting by default. the scripts in the subdirectories do, but when you call callm or callm2, the buffer is opened in micro but not officially saved anywhere unless you decide to save what you see (which is a sense is a potential back up of either main batch of batches (4 directories are made by each microdoc or microdoc00, 8 are made by microdoc0, which calls both to your current directory (if you call it from the terminal) or your chosen directory (if used in a script of with cd /chosen/path; microdoc0)).
--p.dogfellow, 9/29/19
***
(fwiw, i thought i remembered reading typical delay between repeats is about .12 seconds on most keyboards but now that i think about it some more, i think it may be xdotool's default repeat rate).
____
here's the mouse fix for the newer tmuxes (if you need it, dump it in a terminal and it'll overwrite the previous one for the older tmuxes):
echo $'#!/bin/sh
#older than xenial:
#tmux set -g mouse-select-pane on
#tmux set -g mouse-resize-pane on
#xenial and newer: set -g mouse
tmux set -g mouse
' > /root/my-applications/bin/tmuxm
chmod 755 /root/my-applications/bin/tmuxm
****
dump this into a terminal to update the microdoc0 script:
#!/bin/sh
echo $'#!/bin/sh
microdoc
microdoc00
echo $\'#!/bin/sh
#callm0
#all 8, numbers first. #callm,callm2:
#cat ./az10/{a..z}/* ./azaz/{a..z}/* ./10az/{1..10}/* ./10110/{1..10}/* | micro
#cat ./az100/{a..z}/* ./azaz2/{a..z}/* ./100az/{1..100}/* ./100/{1..100}/* | micro
cat ./10az/{1..10}/* ./100/{1..100}/* ./100az/{1..100}/* ./10110/{1..10}/* ./az10/{a..z}/* ./az100/{a..z}/* ./azaz/{a..z}/* ./azaz2/{a..z}/* | micro
\' > ./callm0
chmod 755 ./callm0
' > /root/my-applications/bin/microdoc0
chmod 755 /root/my-applications/bin/microdoc0
#callm and callm2 get made with the first two commands and cat the a* directories first. if you call either of these scripts while already in micro, it opens another "layer" you can add other tabs/files to or must close to get back to your original set or file. if you call both from shell mode, you have two other layers (which may not be what you want)
(^not as tedious to mimic as the earlier script, which bounced back and forth from color to color a lot more. micro's version of geany doesn't look like geany on my terminals, and many are arguably prettier (see
http://zbyedidia.webfactional.com/micro ... shots.html for some), but
https://youtu.be/C2ApUj96wOg?t=930
has me sitting at the machine when i intended to get up, so...i went back on my word and...continued to put effort into the wrong aspects of the is file.
enjoy!
(syntax highlighting aside, the github theme on a black t.v. is mostly black (no white bars for contrast or messages) with gray, grayed or white text (tab names and micro's ui text is slightly brighter than your text, line numbers are gray))
[...]
(looking at the color config file, my old eyes appear to be seeing light blue as gray..
***
9/30/19:
excerpt of changes/tree -sa for 1.2:
└── [ 60] my-applications
└── [ 260] bin
├── [ 362] echocat
├── [ 310] echomicro
├── [ 113] getmicro
├── [ 408] mbatch10
├── [ 1012] mbatchaz
├── [ 1678] microcatters
├── [ 1402] microdoc
├── [ 442] microdoc0
├── [ 1394] microdoc00
├── [ 444] mkcallm0
└── [ 215] tmuxm
microdoc.1.2/root/my-applications/bin/mkcallm0
microdoc.1.2/root/my-applications/bin/microdoc0
microdoc.1.2/root/my-applications/bin/microcatters
microdoc.1.2/root/my-applications/bin/echomicro
microdoc.1.2/root/my-applications/bin/echocat
are new for 1.2 or changed. microcatters makes cuscat, medcat, and largecat.
largecat:
#!/bin/sh
#largecat
#cat ./{A..Z}/* ./{AA..ZZ}/* ./{a..z}/* ./{aa..zz}/* ./{0..1000}/* | micro
#cat ./{0..1000}/* ./{a..z}/* ./{aa..zz}/* ./{A..Z}/* ./{AA..ZZ}/* | micro
#cat ./{A..Z}/* ./{AA..ZZ}/* ./{a..z}/* ./{aa..zz}/* ./{0..1000}/* | micro
#cat ./{0..1000}/* ./{a..z}/* ./{aa..zz}/* ./{A..Z}/* ./{AA..ZZ}/* | micro
#cat ./{a..z}/* ./{0..110}/* | micro
cat ./{0..110}/* ./{a..z}/* | micro
medcat:
#!/bin/sh
#medcat
#callm0
#all 8, numbers first. #callm,callm2:
#cat ./az10/{a..z}/* ./azaz/{a..z}/* ./10az/{1..10}/* ./10110/{1..10}/* | micro
#cat ./az100/{a..z}/* ./azaz2/{a..z}/* ./100az/{1..100}/* ./100/{1..100}/* | micro
#cat ./10az/{1..10}/* ./100/{1..100}/* ./100az/{1..100}/* ./10110/{1..10}/* ./az10/{a..z}/* ./az100/{a..z}/* ./azaz/{a..z}/* ./azaz2/{a..z}/* | micro
#cat ./{A..Z}/* ./{AA..ZZ}/* ./{a..z}/* ./{aa..zz}/* ./{0..1000}/* | micro
#cat ./{0..1000}/* ./{a..z}/* ./{aa..zz}/* ./{A..Z}/* ./{AA..ZZ}/* | micro
cat ./{0..10}/* ./{a..z}/* | micro
cuscat:
#!/bin/sh
#cuscat
#callm0
#all 8, numbers first. #callm,callm2:
#cat ./az10/{a..z}/* ./azaz/{a..z}/* ./10az/{1..10}/* ./10110/{1..10}/* | micro
#cat ./az100/{a..z}/* ./azaz2/{a..z}/* ./100az/{1..100}/* ./100/{1..100}/* | micro
#cat ./10az/{1..10}/* ./100/{1..100}/* ./100az/{1..100}/* ./10110/{1..10}/* ./az10/{a..z}/* ./az100/{a..z}/* ./azaz/{a..z}/* ./azaz2/{a..z}/* | micro
#cat ./{A..Z}/* ./{AA..ZZ}/* ./{a..z}/* ./{aa..zz}/* ./{0..1000}/* | micro
#cat ./{0..1000}/* ./{a..z}/* ./{aa..zz}/* ./{A..Z}/* ./{AA..ZZ}/* | micro
cat ./{0..4}/* ./{a..e}/* | micro
microdocs0 now adds the callm0 micro cat code for all the directories (call it from the terminal (back tick) and it will make both the 26 and 10s set and the 26 and 100s set.
echo cat is helper code for catting/combining the directory sets and opening the results in micro
microcat is helper code for opening the subdirectories as batches in micro
mkcallm0 makes the callm0 script in the directory it's called from.
you can see a lot of commented out code in the three -cat files--use that to include or exclude directories or further customize your cat calls. one of the ways i discovered i had a preference for micro was i found i kept changing the nano and mcedit codes in the 0n4n and 0mce folders to micro. all of them also wound up going to e and 4, so that's what the custom version of the cat2micro scripts shows. if you go above and possibly below (00.. or 0001 to where you start and a few beyond the last directory you've got (set to 105 in your directory of 100 az's for example), you can symlink in directories from other sources and they'll get picked up so long as you rename the symlink to follow the convention you're calling (though you don't have to worry about it if you call all the numbers and letters together). if you want to give yourself a buffer in that regard (use the 100s script in a directory with subdirectories of 10 to 26), the error messages from cat saying the directories don't (maybe yet) exist fly by instantly--i'm only aware they happened after i close micro and see what messages the terminal gave. if you want to be able to call the micro scripts without first opening the terminal, either right click run in terminal or make a version that prepends terminal (rxvt, urxvt, lxterminal, roxterm, and sakura all are standard or attainable--use sc0ttman's pkg utility if the package manager in your pup fails) -e to the code. that is, micro blah becomes sakura -e micro blah (which would open a file called blah in micro in the sakura terminal). use that on scripts or desktop files.
___
in a somewhat related matter, i'm porting all these scripts over to my android by making three folders (in addition to a micro folder, since i know the locations of the config files for it on both the pups and android boxes. updating that's even simpler than what i'm about to describe (copy contents of folder by clicking a script set up to send the stuff over).
for general use, i have a script folder and two file folders. script folder takes into account setting permissions in puppy might not mean anything to android, so in a synced folder, i copy the scripts over the paths after chmod 755 ./* -ing the thing. androido (see notes 3) has path2 listed, which is on the android $PATH. copied that over and added some copy to ./ (copy to here) scripts to the android system--installing updates and overwriting older files and adding scripts is pretty painless now. added more scripts to open the bashrc file since some of the cd /path scripts only work on that file and not as scripts (not sure why but i'm going to give up trying to get it to use those scripts. stuff >> bash.bashrc is the way to go with that sort of thing. adding to the path makes you prefix with bash, even if your shebang is #!/bin/bash.
guess i should up this thing before i end up updating it again.
--puppus dogfellow, 9/30/19