how to manage userscripts - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120) +--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121) +---- Forum: Sxmo on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=161) +---- Thread: how to manage userscripts (/showthread.php?tid=14350) |
how to manage userscripts - Uturn - 07-04-2021 hello, I need a beginners help or a tutorial, to learn sxmo's user scripts, please 1) I am too stupid to be able to ssh to my pinephone (from OSX) 2) installed Thunar and found my empty unserscripts folder 3) would like to locate userscripts and copy them to my userscropts folder 4) on edit userscripts and ../ I get a list of contacts.tsv, hooks/, userscripts/, xinit of course, none of these menus does anything, probably because my userscripts folder is empty. Now if I could locate some scripts in the internet, download them, and copy them into the userscripts folder (with firefox and thunar), I imagine that might be a first step. Later do the same via ssh. Are there any helpful links for shell scripting and sxmo scripts? On https://git.sr.ht/~mil/ I see much about scripting but very few that I can understand ;( There seems to exist a script to sleep the phone after a while. I would like to install it and see what it does. RE: how to manage userscripts - rbrewer123 - 07-06-2021 The userscripts can do anything you want from the command line. Here's mine that just provides a way to run my backup script from the userscripts menu. /home/user/.config/sxmo/userscripts/backup: Code: #!/usr/bin/env sh My backup script calls rsync to copy /home/user to my linux PC over ssh. It also saves a list of installed packages. /home/user/ph_backup/backup: Code: #!/usr/bin/env sh Here is backup.exclude: Code: .cache/** RE: how to manage userscripts - Uturn - 07-10-2021 thank you! Now do I understand correct I can copy such a script to /home/user/.config/sxmo/userscripts/ so it will appear in the menu and I can trigger it from there? RE: how to manage userscripts - KavusKazian - 07-13-2021 Userscripts I figured out, but I'd like to know how the apps hook works. RE: how to manage userscripts - TRS-80 - 02-12-2022 Unfortunately, I think that some familiarity in one or more scripting language(s) would almost be a prerequisite to using something like SXMO (or dwm it's based on, or other similar tools following Unix and/or Suckless philosophy). That's going to be a step learning curve for any newcomer, however the more you learn the more control you will be able to take back over your computing. Not just on phone, but anywhere GNU/Linux runs (desktop, server, Single Board Computer, etc. If you want to learn about bash, I can recommend just hanging out in #bash (on Libera IRC network), and studying the Wooledge FAQ they have linked in the MoTD. Python is another candidate, but usually this is for more involved things, as you are potentially getting into Object Oriented (OO) paradigm which may really be confusing to a newcomer. Probably best to stick to simple, imperative languages like shell scripting at first. RE: how to manage userscripts - magdesign - 07-15-2022 (07-13-2021, 03:03 PM)KavusKazian Wrote: ... but I'd like to know how the apps hook works. anyone? RE: how to manage userscripts - magdesign - 07-19-2022 To create your own app hook in sxmo (edit app menu entry): Code: cp /usr/share/sxmo/default_hooks/sxmo_hook_apps.sh ~/.config/sxmo/hooks/ in there Code: nano ~/.config/sxmo/hooks/sxmo_hook_apps.sh you can edit entries, for example adding osmin to the menu: Code: write_line_app osmin "$icon_glb osmin" "osmin" to search for icon names you can run: Code: nano /usr/share/sxmo/default_hooks/sxmo_hook_icons.sh RE: how to manage userscripts - TRS-80 - 08-01-2022 Thanks for sharing solution! The "built-in" app selection is somewhat limited, if you think the app you added might be generally useful, please consider submitting a patch to the SXMO project! Cheers! |