LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-05-2016, 08:13 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
Need to restore gnome-terminal to cinnamon desktop


OK - I give up! I somehow managed to permanently delete the gnome-terminal app from one user's desktop. I've tried using the search box, but it doesn't find it. I've edited the $HOME/.config/menus/cinnamon-applications.menu file to Include it in various menus, but no luck. The gnome-terminal.desktop does exist in /usr/share/applications/ and other users can access the terminal without problem.

Ubuntu 15.10, Cinnamon desktop.
 
Old 02-05-2016, 08:33 AM   #2
Hasek39
Member
 
Registered: Jul 2015
Location: Pittsburgh, PA, US
Distribution: Slackware
Posts: 120

Rep: Reputation: Disabled
Can you launch GNOME Terminal for this user from Xterm?
 
Old 02-06-2016, 06:04 AM   #3
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Install the Dconf editor:
Code:
sudo apt-get install dconf-tools
When logged in as that user, open the editor: Menu > Administration > dconf Editor
Navigate to: > org > cinnamon > desktop > applications > terminal
Set to Default at the bottom of the window.

Alternatively, you can use a different terminal emulator. I use roxterm.
Code:
sudo apt-get install roxterm
In > org > cinnamon > desktop > applications > terminal, change "gnome-terminal" to "roxterm"

Another alternative, if that user has sudo rights, you can use the brute force method to regenerate the menu item:
Code:
sudo apt-get install --reinstall gnome-terminal

Last edited by TxLonghorn; 02-06-2016 at 06:40 AM.
 
Old 02-07-2016, 02:50 PM   #4
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by Hasek39 View Post
Can you launch GNOME Terminal for this user from Xterm?
Yes, and it even retains all my profile settings.

Quote:
Originally Posted by TxLonghorn View Post
When logged in as that user, open the editor: Menu > Administration > dconf Editor
Navigate to: > org > cinnamon > desktop > applications > terminal
Set to Default at the bottom of the window.
Did that, set it to default. It still doesn't show up on any alacarte menu editor entry. I logged off and back on.

The really odd thing is that it shows as Included under both the Administration and Accessories menus in $HOME/.config/menus/cinnamon-applications.menu.
 
Old 02-08-2016, 06:12 AM   #5
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Copy the .config/menus/cinnamon-applications.menu file from a good user's /home to the non-working user's /home
 
Old 04-01-2016, 12:58 PM   #6
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
The "bad" user does have a .config/menus/cinnamon-applications.menu, but none of the "good" users have such a file, even if using Cinnamon. I suppose that is because they have done no menu customizations?

I've solved-ish the problem by deleting all this user's home dot-files (.cinnamon, .config, ...), then re-logging in and resetting Cinnamon as the default desktop. Now, gnome-terminal is back! I just have to reconfigure all desktop settings, colors, etc., but that's better than re-installing Ubuntu!

My ultimate objective in this exercise was to create a standard menu configuration for "normal" users that did not have administrative (Software Center, System Log, ...) and superfluous (Games, Amazon, ...) menu items.

Before I mark this as solved, can you/someone recommend a better way of doing this than using the Menu Editor and hiding/removing entries one-by-one (which is how I got myself into trouble in the first place). And, whether or not there is a better way, once I complete that mission, what "template" files would I then use to copy to new users' directories? I assume the cinnamon-applications.menu would be one. Others?
 
Old 04-02-2016, 05:56 AM   #7
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
The default way that linux prevents "normal" users from using programs they shouldn't is to require "sudo" (administrative) authority.
Trying to edit the menu is a losing battle. Even if you created the limited menu you want, it would have to be re-edited every time you installed another program that you want to limit.
I have tried to create a menu that made better sense to me, simply because so many programs are in "illogical" places, in my opinion. I finally gave up on the effort and accepted the default. If you want to try it, the cinnamon-applications.menu is the file you want to preserve.

There is a trick you can use to prevent other users from starting any program. Create a directory named "bin" in your HOME
Code:
mkdir $HOME/bin
When that directory exists, it is automatically added to your $PATH on login, and functions just like /usr/bin or /sbin
The you move the launcher for the program to your bin directory.
You discover the location of the launcher with the command "which"
Code:
which gparted
tells me that gparted is started by /usr/sbin/gparted
So I move that launcher to my bin folder.
Gparted will still appear in normal users' menus but will not run for them, only for me.

That won't help clean up your menus, but might be useful.

Last edited by TxLonghorn; 04-02-2016 at 06:03 AM.
 
1 members found this post helpful.
Old 04-03-2016, 12:24 AM   #8
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Interesting tip, but I'd still like to play with the clean-up idea. There's a lot of clutter there for e.g. a receptionist, or a lawyer. Ubuntu still focuses primarily on I.T. or tech-hobbists as users, not so much ordinary business users.

I not so concerned about installing new programs as that would be rare.

So, if I mess up again, can I just delete the cinnamon-applications.menu file and I'll be back to default?

Last edited by mfoley; 04-03-2016 at 12:25 AM.
 
Old 04-03-2016, 09:12 AM   #9
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Yes, you can just delete the cinnamon-applications.menu file.
Here is how to accomplish what you want:
Log in as one of the normal users.
Delete the cinnamon-applications.menu file (if it exists).
Right-click on the Main Menu > Configure > Open Menu Editor
Un-check all the programs that you do not want to appear in that person's menu. That will automatically create a new cinnamon-applications.menu file.
After you make all your changes, save a copy of the cinnamon-applications.menu file in your backup drive or some other safe location.
To apply your changes to a different user, you have to log in as that user (so that the file gets the correct ownership) and copy the cinnamon-applications.menu file to that user's $HOME/.config/menus/ folder. If they have an existing cinnamon-applications.menu file - delete it first.
After copying, you might have to log out and log back in to see the effect.

Last edited by TxLonghorn; 04-03-2016 at 09:19 AM.
 
Old 04-03-2016, 03:01 PM   #10
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by TxLonghorn View Post
Yes, you can just delete the cinnamon-applications.menu file.
Here is how to accomplish what you want: ...
Yes, that's exactly what I was doing until I totally screwed up with the gnome-terminal and couldn't get it back. I wish I had figured out the simple ideal of deleting the cinnamon-applications.menu file before wiping that user's entire home directory.

I'm not going to mark this as solved yet because I'm going to try some things and post back results for your expert guidance!
 
Old 04-05-2016, 01:11 AM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by TxLonghorn View Post
Trying to edit the menu is a losing battle.
this.

it makes much more sense to get your head around how sudo works, then make the appropriate adjustments to your /etc/sudoers (only with visudo of course).

that is, if your requirements are what you said they are.

but somehow i suspect you actually just want to customize the menu, no?
 
Old 04-05-2016, 01:13 AM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by TxLonghorn View Post
Trying to edit the menu is a losing battle.
this.

it makes much more sense to get your head around how sudo works, then make the appropriate adjustments to your /etc/sudoers (only with visudo of course).

but i can see the clutter argument; creating a very minimal menu, e.g. just office and browser, would make sense in certain scenarios.

it also makes sense that the gnome-terminal is hidden from
Quote:
Originally Posted by mfoley View Post
e.g. a receptionist
seems you just shot yourself in the foot by not first creating a seperate user for that?

Last edited by ondoho; 04-05-2016 at 01:16 AM.
 
Old 04-08-2016, 01:22 AM   #13
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Yes, this exercise has nothing to do with sudo-required programs. It's all about clutter and removing useless menu items (programming, games, education) and even menu items that do require sudo (Administration > Users and Groups; Preferences > Date and time [we use ntp]) and, as you say, "creating a very minimal menu" for office staff use.

So, experimentation so far ... more complex than just cinnamon-applications.menu.

When a menu entry is un-checked in alacart, it creates (or adds-to) the file $HOME/.config/menus/cinnamon-applications.menu an entry of the form:

Code:
<Menu>
        <Name>Applications</Name>
        <MergeFile type="parent">/etc/xdg/menus/cinnamon-applications.menu</MergeFile>
        <Menu>
                <Name>Education</Name>
                <DirectoryDir>/home/HPRS/mark/.local/share/desktop-directories</DirectoryDir>
        </Menu>
</Menu>
Where, it seems, <Name> is the Menu Name appearing in the Main Menu (left-column) of the alacart dialog and <MergeFile> appears to be the original/default list of Items (right-column) for that Menu Name.

the 2nd level <Menu> lists overrides to the default. So, for Item "Education", the override directory is in the location shown in <DirectoryDir> and the specific override file is named cinnamon-education.directory. In this case that file contains a bazillion words for "Education" in different languages and, at the end:

Type=Directory
NoDisplay=true

which is what apparently disables "Education" from being display on the cinnamon menu.

Excluding Items from a Main Menu entry is a bit different. That has the form:

Code:
        <Menu>
                <Name>Preferences</Name>
                <Exclude>
                        <Filename>deja-dup-preferences.desktop</Filename>
                </Exclude>
                <AppDir>/home/HPRS/mark/.local/share/applications</AppDir>
        </Menu>
This resulted from my un-checking 'Backups' in the 'Preferences' menu. Note the <Exclude> block. But we have a new directory: /home/HPRS/mark/.local/share/applications. This directory is currently empty.

Yet to try is adding a new Item to a Main Menu entry, and adding a sub-menu. I expect something will appear in the /home/HPRS/mark/.local/share/applications directory in the former case and not sure what will happen in the latter case as I see no submenus in the default setting. I also had big trouble with "moving" Items from one Menu to another -- it actually ended up doing a copy, but if I deleted the source Item the copied Item also disappeared. Probably a bug in alacart.

In any case, if I want to "clone" a stripped-down menu, I'll have to pick up $HOME/.config/menus/cinnamon-applications.menu file as well as at least the $HOME/.local/share/desktop-directories and $HOME/.local/share/applications directories.

More later.

Last edited by mfoley; 04-08-2016 at 01:30 AM.
 
Old 04-09-2016, 12:57 AM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
well it should be possible to tell the application generating the menu (your panel plugin) to use a user-generated file, and nothing else.
i know xfce4 has that option.
i do not know how these gnome-forks/user-friendlies decided to treat configurability. maybe they didn't deem it important.
maybe there's different menu plugins for the cinnamon panel?
 
  


Reply

Tags
alacarte, cinnamon



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Cinnamon Desktop: Breaks with GNOME, finds beefed-up Nemo LXer Syndicated Linux News 0 10-30-2013 07:11 PM
LXer: Cinnamon Desktop: Breaks with GNOME, finds beefed-up Nemo LXer Syndicated Linux News 0 10-29-2013 02:21 PM
Disable close and restore buttons in gnome-terminal srinivas1224 Linux - Desktop 0 11-05-2008 09:41 AM
Gnome Desktop restore dyrer Linux - Newbie 1 11-23-2005 04:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration