- Set a custom date format for the panel's clock e.g. %a %e %b %H:%M
- Show week numbers in calendar
- Change the menu icon
Bash commands for editing date format and menu icon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
- Chris Tinacan
- Level 1
- Posts: 4
- Joined: Sat Mar 13, 2021 5:53 am
- Location: Ireland
Bash commands for editing date format and menu icon
I'm using Mint 20.1 Cinnamon and I'm trying to create a script that'll set the appearance of new installations automatically. However, I'm having difficulty finding bash commands to make the following changes:
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Bash commands for editing date format and menu icon
One way to somewhat easily find where these are stored is the following:
For the first two on my system that shows the setting is stored in file
As an example let's change the menu icon. First see if you also have the file
It looks like a long command but that's because of the long paths. Let's break it down:
Oh and to change the menu icon back to the default replace "cinnamon-symbolic" in the command with "linuxmint-logo-ring-symbolic".
For the changes to the calender, your number 1 and 2, use the same command but replace the filename with
- Create a test file/update its modified time with command
touch a
(or use whatever name you want in place of 'a') - Then change a single setting
- And on the command line run
find ~ -newer a
which will find any file in your home directory that was modified more recently than the test file from step 1
For the first two on my system that shows the setting is stored in file
~/.cinnamon/configs/calendar@cinnamon.org/13.json
and for the third in ~/.cinnamon/configs/menu@cinnamon.org/0.json
. So you'll need a tool to modify JSON files. That's not installed by default. One option is to use jq (apt install jq) which is a command line tool to run queries on JSON files. You can also modify values with it.As an example let's change the menu icon. First see if you also have the file
~/.cinnamon/configs/menu@cinnamon.org/0.json
on your system (in Nemo press Ctrl+H to toggle showing hidden files so you can see the .cinnamon directory in your home directory). Then let's change the menu icon to the Cinnamon logo which this command would do:
Code: Select all
jq '."menu-icon"."value" = "cinnamon-symbolic"' ~/.cinnamon/configs/menu@cinnamon.org/0.json > tmp && mv tmp ~/.cinnamon/configs/menu@cinnamon.org/0.json
jq '."menu-icon"."value" = "cinnamon-symbolic"'
this says to find the object "menu-icon" in the JSON root, and the object "value" in that and change it to "cinnamon-symbolic". If you open the~/.cinnamon/configs/menu@cinnamon.org/0.json
file I think you can follow along with that.~/.cinnamon/configs/menu@cinnamon.org/0.json > tmp && mv tmp ~/.cinnamon/configs/menu@cinnamon.org/0.json
is the rest of command and that just says which JSON file to work on, to output the result to the file tmp and if the jq succeeds to move that tmp file back to overwrite the JSON file.
Oh and to change the menu icon back to the default replace "cinnamon-symbolic" in the command with "linuxmint-logo-ring-symbolic".
For the changes to the calender, your number 1 and 2, use the same command but replace the filename with
~/.cinnamon/configs/calendar@cinnamon.org/13.json
(and check your system has that file!). Then replace the query '."menu-icon"."value" = "cinnamon-symbolic"'
with:
'."custom-format"."value" = "%a %e %b %H:%M"'
(and you'll want use-custom-format set to true)'."show-week-numbers"."value" = true'