-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Save and restore jgmenu csv files #4
Comments
Also, if there is a way to edit it to add this functionality let me know. I was a bit overwhelmed by the size of the codes. |
Hi @clemencyworld1 thank you for your interest in improving BunsenLabs! I am transferring your issue to that repository, so let's continue the discussion there. |
Sorry to be so late in returning to this. The basic concept of BLOB is to be able to save and restore a graphics setup. That includes the jgmenu appearance set in jgmenurc, but not the actual menu content set in prepend.csv and append.csv. If BLOB were to start saving program configurations affecting things other than appearance, then there would be no end to what files could be saved. But there is a grey area - for example ~/.bashrc can be saved, containing settings other than appearance - so I could imagine people wanting to save different menus for different desktop setups. I'm now not sure if BLOB should go down this road or not, but meanwhile can offer some hints if you want to try extending the script yourself. Agreed, at 3,000 lines it is a bit overwhelming. Saving/restoring a single, or two, files should be relatively simple. Relatively...
(now line numbers have shifted by 2)
before the existing "$pickterm" entry, so the line count has gone up by 2 now.
|
Thanks. I will try it out in my spare time. Currently preparing for exams
…On Fri, 5 Apr 2024, 9:12 am John Crawley, ***@***.***> wrote:
Sorry to be so late in returning to this.
The basic concept of BLOB is to be able to save and restore a *graphics*
setup. That includes the jgmenu appearance set in jgmenurc, but not the
actual menu *content* set in prepend.csv and append.csv. If BLOB were to
start saving program configurations affecting things other than appearance,
then there would be no end to what files could be saved.
But there is a grey area - for example ~/.bashrc can be saved, containing
settings other than appearance - so I could imagine people wanting to save
different menus for different desktop setups. I'm now not sure if BLOB
should go down this road or not, but meanwhile can offer some hints if you
want to try extending the script yourself. Agreed, at 3,000 lines it is a
bit overwhelming.
Saving/restoring a single, or two, files should be relatively simple.
Relatively...
1. At line 182, add:
JGMENUCONT1=".config/jgmenu/append.csv" # jgmenu content
JGMENUCONT2=".config/jgmenu/prepend.csv" # jgmenu content
(now line numbers have shifted by 2)
2.
At line 340, add PICKJGMENUCONT="jgmenu content"
3.
At line 1644, extend the configs array with "$PICKJGMENUCONT"
4.
At line 1674 add this block:
"$PICKJGMENUCONT") getJgmenuContent
;;
before the existing "$pickterm" entry, so the line count has gone up by 2
now.
5. Now we need a new function getJgmenuContent(), it can go anywhere,
but just after getJgmenu at line 1470 paste in this:
function getJgmenuContent(){
local file txt
[[ -r $HOME/$JGMENUCONT1 || -r $HOME/$JGMENUCONT2 ]] || {
debug "No jgmenu contents files, not saving"
return 0
}
for file in "$HOME/$JGMENUCONT1" "$HOME/$JGMENUCONT2"
do
[[ -r $file ]] && { saveFiles "$file" || {
echo "$0: Failed to save jgmenu contents file $file" >&2
return 1
}}
done
txt="jgmenu contents: ~/$JGMENUCONT1 and/or ~/$JGMENUCONT2\n"
debug "\n Saved $txt"
echo "[JGMENUCONT]" >> "$SETTINGS"
echo -e "$txt" >> "$LISTMSG"
}
6. Sorry, I'm out of time now, so the restore section will have to
wait, but you could have a look starting around 2798 adding something with
$PICKJGMENUCONT
Also the above code hasn't been tested at all.
—
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKBRKH64IXSXPGF4TUONEDTY3ZMIRAVCNFSM6AAAAABFEIX7ZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZZGIYTQMRQGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I've tested the "save" function and edited the above code a bit. I think it now saves append.csv and prepend.csv (if they exist) to the BLOB folder, and adds an entry to the settings file. Since we're both a bit busy right now, I'll add the "restore" functionality in a couple of days. If it worked OK for you we could consider adding it to the BunsenLabs package. |
To be able to restore saved jgmenu content (prepend.csv and append.csv) from a saved BLOB config, add this code to bl-obthemes:
From line 2808, after the "$PICKJGMENU" block, add this:
That should enable you to save and restore the append and prepend files. |
I still feel a bit reluctant to add this functionality to the default script, though, because a careless user trying out a different theme style might accidentally wipe out their carefully customized menu contents! We would need to add some more checks and warnings to make sure that didn't happen. |
Thanks for this wonderful tool. I use it a lot.
I will plead that if possible let the script be able to save append.csv and prepend.csv in jgmenu folder to enable complete restoration of jgmenu configuration.
Thanks
The text was updated successfully, but these errors were encountered: