SliTaz SliTaz Forum

You are not logged in.

#1 2013-07-08 12:51:39

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Terminal/console applications in menu

I am always surprised when I see how people are not willing to follow the standards and instead reinvent the wheel. Let's follow the standards?

SliTaz have very few number of Application menu items that invoke the terminal and "text user interface" application in that terminal. System-wide applications are described in the /usr/share/applications/*.desktop files. And what we can see in the vi.desktop file?

[c]____________________
. . .
Exec=xterm -e vi
Terminal=false
. . .
____________________[/c]
Why? Don't know. Maybe it was made for some programs that do not support the standards. But official SliTaz based on Openbox, LXpanel and its menu applet. And menu applet supports Freedesktop standards, not fully but enough in this case.

Go to Desktop Entry specification: http://standards.freedesktop.org/desktop-entry-spec/

Let's open specification v. 1.1: http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html

Read Recognized desktop entry keys topic:

Terminal        Whether the program runs in a terminal window.

So we can use Standard way, and write in vi.desktop this:

[c]____________________
. . .
Exec=vi
Terminal=true
. . .
____________________[/c]
Why I pay so many attention to this? Because two items. At first, In My Opinion (IMO) xterm is ugly, and I don't like it. I prefere Sakura terminal emulator. And, at second, hard-coding of any terminal into *.desktop file is evil. Some people likes xterm, other — sakura, or urxvt, or lxterminal, or anything else. What to do? Everything has been done.

Right click on your Openbox desktop, click "Favorite applications" menu item, click "Configure favorites". You'll see configuration dialog where you can choose your favorite file manager, web browser, text editor, terminal emulator. Write command line for your favorite terminal emulator and press button "Change". How to use favorite terminal emulator instead of hard-coded xterm? It's very simple, just use [c]terminal[/c] command instead of [c]xterm[/c] command.

So, if you want, you can change vi.desktop to this variant:

[c]____________________
. . .
Exec=terminal -e vi
Terminal=false
. . .
____________________[/c]
But, please, never hard-code xterm. (I want to tell you a secret: I want to remove xterm on my machine.)

Ok, but let's back to first example, where Terminal=true. Is it works for you? Yes, its works in the Openbox environment with LXpanel with Menu applet. Read from the LXDE wiki:

http://wiki.lxde.org/en/LXPanel

(or Google cached page because link above is not accessible for me):

Main Config File

The main config file is named "config", and its format is like this:

[Command]

FileManager=pcmanfm %s

Terminal=xterm -e

LogoutCommand=

FileManager

. . . . . . . . file manager used when an applet in lxpanel need to open a folder.

Terminal

. . . . . . . . terminal emulator used when an applet needs to popup a terminal window.

So, LXpanel Menu applet is standard compliant, and you can configure your favorite terminal emulator in [c]~/.config/lxpanel/<Profile Name>/config[/c] file. Here is my working example:

[c]____________________
[Command]
FileManager=pcmanfm %s
Terminal=terminal
Logout=tazbox logout
____________________[/c]
I want just only feedback, does it work in non-standart (not Openbox/LXpanel) environments? Some other, like JWM, or Enlightenment? Any tips?

Offline

#2 2013-07-08 13:12:16

sixofeight
Member
Registered: 2013-07-02
Posts: 234

Re: Terminal/console applications in menu

Which Slitaz-version are you talking about?

my file looks like that:

[Desktop Entry]

Encoding=UTF-8

Name=Vi Text Editor

Name[fr]=Editeur de texte Vi

Exec=terminal vi

Icon=text-editor

Type=Application

Categories=Application;Development;

Offline

#3 2013-07-08 14:33:58

sixofeight
Member
Registered: 2013-07-02
Posts: 234

Re: Terminal/console applications in menu

Oh...sorry...that wasn't your question..

sometimes I read a little to fast.

Offline

#4 2013-07-08 15:58:28

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Terminal/console applications in menu

@Aleksej

This is not a war!

I test all menu items running cooking core.

You broke alsamixer,vi,and dialog desktop shortcuts on cooking with this commit:

http://hg.slitaz.org/wok/rev/0e3938010c36

Why not test changes before you make a commit?

Don't assume because you follow a standard it will work.

I promise to use [c]terminal[/c] ;^)

Offline

#5 2013-07-08 16:28:33

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo, big_smile

No war anymore from my side. If anyone don't listen me then I'll walk alone.

Please, tell me how I broke Core? Why? I tested it before commit, and it works right now in my current customized SliTaz 4.0 :-$

Offline

#6 2013-07-08 16:53:00

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Terminal/console applications in menu

You can't do a valid test in a customized environment.

Build a clean iso using the tazpkgs which are on the mirror.

Yesterday:

[c]tazpkg recharge[/c]

[c]tazlito clean-distro[/c]

[c]tazlito get-flavor core[/c]

[c]tazlito gen-distro[/c]

Boot into new iso using virtual-box

alsamixer doesn't launch,test every menu shortcut.

You broke alsamixer,vi,and dialog desktop shortcuts on cooking with your commit:

http://hg.slitaz.org/wok/rev/0e3938010c36

http://hg.slitaz.org/wok/file/0e3938010c36/alsa-utils/stuff/applications/alsamixer.desktop

http://hg.slitaz.org/wok/file/0e3938010c36/busybox/stuff/applications/vi.desktop

http://hg.slitaz.org/wok/file/0e3938010c36/dialog/stuff/dialog.desktop

I fixed it with my commits:

http://hg.slitaz.org/wok/rev/dbf3ebba62ae

http://hg.slitaz.org/wok/rev/0a4ecaae336c

http://hg.slitaz.org/wok/rev/2cb5636c1d2d

You changed xterm to terminal in this commit:

http://hg.slitaz.org/wok/rev/5f700fbba05c

Not sure why you didn't change xterm to terminal the dialog.desktop

I generate new iso with new build tazpkgs alsa-utils,busybox,dialog and web-applications.

Run in virtual-box,all shortcuts launch.

That problem is fixed.

Offline

#7 2013-07-08 17:15:06

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

Strange, but seems it fact. Tell me please, can I use this ISO file for testing future Rolling release instead of your four commands above?

http://mirror.slitaz.org/iso/rolling/slitaz-rolling.iso

I can check it as two-file frugal installation, or as direct ISO booting in my grub4dos. Will it enough?

Offline

#8 2013-07-08 17:22:26

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

Not sure why you didn't change xterm to terminal the dialog.desktop

At least xterm and sakura have its own point of view to multi-word -e option. I can't find universal command line for both. Only can move dialog example to its own script and point desktop file to run this script.

Offline

#9 2013-07-09 15:52:59

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

I wait for your reaction, for your answer, but you are silent.

Today is my day-off. I tried to boot yesterday's Rolling ISO. I downloaded it yesterday, and md5sum is correct. Unfortunately, something went wrong and I can't boot ISO directly. Then I extracted kernel and RAM disk using ISOmaster, and merged rootfs*.gz into one rootfs.gz. I added menu entry for my Grub4dos and reboot.

Mojo, sad but all works. And without your "fixes". With "Terminal=true" vi opens in the Sakura. And I not break three menu items.

Offline

#10 2013-07-09 17:01:41

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Terminal/console applications in menu

With "Terminal=true" vi opens in the Sakura.

Your not testing with a clean cooking-rolling iso from mirror because TERMINAL="xterm" in

/etc/slitaz/applications.conf and /home/tux/.config/slitaz/applications.conf

Mojo, sad but all works. And without your "fixes". With "Terminal=true" vi opens in the Sakura. And I not break three menu items.

You made 2 changes either one alone stops vi alsamixer and dialog shortcuts from working.

Exec=vi <== removing terminal or xterm -e from Exec=

or

Terminal=true

Pasted from your commit:

http://hg.slitaz.org/wok/raw-rev/0e3938010c36

diff -r fbc8a4625f8a -r 0e3938010c36 busybox/stuff/applications/vi.desktop

--- a/busybox/stuff/applications/vi.desktop    Sun Jan 06 21:18:32 2013 +0100

+++ b/busybox/stuff/applications/vi.desktop    Mon Jan 07 01:07:44 2013 +0000

@@ -1,8 +1,9 @@

[Desktop Entry]

-Encoding=UTF-8

+Type=Application

Name=Vi Text Editor

Name[fr]=Editeur de texte Vi

-Exec=terminal vi

+Name[ru]=Текстовый редактор Vi

+Exec=vi          <===Error

+Terminal=true    <===Error

Icon=text-editor

-Type=Application

-Categories=Application;Development;

+Categories=Development;

diff -r fbc8a4625f8a -r 0e3938010c36 alsa-utils/stuff/applications/alsamixer.desktop

--- a/alsa-utils/stuff/applications/alsamixer.desktop    Sun Jan 06 21:18:32 2013 +0100

+++ b/alsa-utils/stuff/applications/alsamixer.desktop    Mon Jan 07 01:07:44 2013 +0000

@@ -1,9 +1,10 @@

[Desktop Entry]

-Encoding=UTF-8

+Type=Application

Name=Alsamixer Volume mixer

Name[fr]=Mixer de volumes Alsamixer

+Name[ru]=Микшер громкости Alsamixer

Name[zh_CN]=Alsamixer 音量控制

-Type=Application

-Exec=xterm -e alsamixer

+Exec=alsamixer        <=====Error

+Terminal=true         <=====Error

Icon=audio-x-generic

Categories=AudioVideo;Audio;

diff -r fbc8a4625f8a -r 0e3938010c36 dialog/stuff/dialog.desktop

--- a/dialog/stuff/dialog.desktop    Sun Jan 06 21:18:32 2013 +0100

+++ b/dialog/stuff/dialog.desktop    Mon Jan 07 01:07:44 2013 +0000

@@ -1,9 +1,10 @@

[Desktop Entry]

-Encoding=UTF-8

+Type=Application

Name=Dialog Example

Name[pt]=Exemplos do Dialog

+Name[ru]=Пример диалога

Name[zh_CN]=对话框示例

-Exec=xterm -e dialog --title " Title " --msgbox "Message box" 8 60

+Exec=dialog --title " Title " --msgbox "Message box" 8 60 <===Error

+Terminal=true      <===Error

Icon=utilities-terminal

-Type=Application

Categories=Development;

Offline

#11 2013-07-09 18:12:24

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

I tell you too, this is NOT a war.

Your not testing with a clean cooking-rolling iso from mirror because TERMINAL="xterm" in

/etc/slitaz/applications.conf and /home/tux/.config/slitaz/applications.conf

Please, don't mix two ways:

1. When you use "Exec=terminal vi" then terminal is configured in the applications.conf

2. When you use "Exec=vi; Terminal=true" then you use LXPanel settings from ~/.config/lxpanel/<Profile Name>/config file

Really I TESTED CLEAN COOKING-ROLLING ISO from mirror: download it here: http://mirror.slitaz.org/iso/rolling/slitaz-rolling.iso

Yesterday's Clean Cooking-Roolling ISO have this file /usr/share/applications/vi.desktop:

[c][Desktop Entry]
Type=Application
Name=Vi Text Editor
Name[fr]=Editeur de texte Vi
Name[ru]=Текстовый редактор Vi
Exec=vi
Terminal=true
Icon=text-editor
Categories=Development;[/c]
And it worked out-of-the-box smile

<===Error

. . .

<===Error

. . .

<===Error

. . .

mojo, I doubt that this is an errors. Please, recheck it. It works in my notebook using vanilla Rolling ISO in frugal installation.

It is strange that the same things does not work for you.

Guys! Who is here? Please, check this file in the latest Rolling. Please! I don't know why it not worked for mojo.

If you want to help:

1. Download latest ISO from here: http://mirror.slitaz.org/iso/rolling/slitaz-rolling.iso (about 41MB), or go to folder: http://mirror.slitaz.org/iso/rolling and click slitaz-rolling.iso and md5sum

2. Install this ISO as you want, boot it installation.

3. Edit (as root user) file /usr/share/applications/vi.desktop to this view:

[c][Desktop Entry]
Type=Application
Name=Vi Text Editor
Name[fr]=Editeur de texte Vi
Name[ru]=Текстовый редактор Vi
Exec=vi
Terminal=true
Icon=text-editor
Categories=Development;[/c]
Click Application menu → Development → Vi Text Editor

4. Write here type of your installation and is it work/not work for you.

Seems like it not works for direct ISO boot for VirtualBox.

And it works for Frugal installation.

You can confirm or disprove this two ways, and offer your own versions of the installation and tell us is it works or not.

Please do not pass by! This is not war. I'm really interested to know what the thing is.

Offline

#12 2013-07-09 19:23:46

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Terminal/console applications in menu

Aleksej your right,with rolling-core-4in1.iso,core flavor selection vi opens with sakura after editing vi.desktop

Vi doesn't work after editing when booted in gtkonly selection.

Editing alsamixer.desktop

Exec=alsamixer

Terminal=true

Doesn't work when booted into core selection,I installed sound when booted into gtkonly the alsamixer.desktop edit fails as in core flavor.

I burn/boot the iso to cdrw on celeron 400 with 512MB ram to do these tests.

Tab menu flavor selection,add sound=noconf screen=1024x768 to reach desktop.

Ati mach64 rage2c on board graphics with 4MB memory using vesa driver according to /var/log/Xorg.0.log

Dmesg reports snd-ymfpci firmware failure to load.

In order to bring up yamaha on board audio:

# modprobe -r snd-ymfpci

# modprobe snd-ymfpci

# setmixer

# lxpanelctl restart

Offline

#13 2013-07-09 20:54:44

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

Sorry, I not tried nothing but only full, "core" (the biggest russian doll).

Seems like I need to leave my CD-less netbook, take my son's desktop, burn ISO, and try gtkonly flavor.

Or,

Seems like I know why it not works in gtkonly! wink

1. See latest packages list, line 211: http://hg.slitaz.org/flavors/file/8d41f6ff686f/core/packages.list#l211

It is list of packages that exists in "core" flavor, but absent in "gtkonly" flavor. Do you see sakura?

2. LXPanel config file require Sakura as terminal emulator:

http://hg.slitaz.org/slitaz-configs/file/ef41c332c3fb/rootfs/etc/lxpanel/slitaz/config#l3

Maybe, better to move Sakura from "core" to "gtkonly" flavor? Don't know. I just like it, and will not use anything but only "core".

Ok, now I don't need to burn disk wink

Offline

#14 2013-07-09 21:13:37

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Terminal/console applications in menu

Sakura is not on gtkonly package.list  http://hg.slitaz.org/flavors/file/8d41f6ff686f/gtkonly/packages.list

I will boot into gtkonly,install sakura, edit vi.desktop and see if vi launches.

Still not working.

Offline

#15 2013-07-09 21:50:43

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

Try to edit [c]/home/[/c]tux[c]/.config/lxpanel/[/c]slitaz[c]/config[/c] (if your user is tux, and LXPanel uses slitaz profile (its by default).

Open this file in the text editor and change

[c]Terminal=sakura[/c]

to

[c]Terminal=xterm[/c]

Do this all in clean vanilla gtkonly flavor. Maybe, you need to restart LXPanel using this command:

[c]lxpanelctl restart[/c]

Offline

#16 2013-07-09 22:45:33

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Terminal/console applications in menu

gtkonly flavor has a different /etc/lxpanel/slitaz/config than core

http://hg.slitaz.org/flavors/file/8d41f6ff686f/gtkonly/rootfs/etc/lxpanel/slitaz/config

I edited both (/etc,/home/tux/.config) to Terminal=xterm logged out/in to tux but still not working.

Offline

#17 2013-07-10 01:08:14

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

Thank you for note about different config.

I'll try tomorrow to run lxpanel in terminal, maybe here will be some errors/tips. Or will use strace.

Now I'm go to sleep (4 a.m. here). See ya. Zzz

Offline

#18 2013-07-10 08:52:51

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: Terminal/console applications in menu

Are you guys taking rolling bug reports here at this time ?

Offline

#19 2013-07-10 10:12:05

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

christophe,

I'm not sure what are you asking.

Bug report is a message from user to developer (or maybe, dialog). Here the dialog between two developers.

Or, maybe you want us to pay attention to bugs.slitaz.org? I take a quick look there and not found rolling bugs. Execuse in advance for misunderstanding.

I'll back here in few hours, now I should to go to bank and pay for services/credits...

Offline

#20 2013-07-10 16:22:22

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: Terminal/console applications in menu

Since you are talking about problems appearing in rolling here, I am asking whether rolling is in a state where its problems should be reported here (in this forum) (and will be taken care of), or not.

If yes, I could mention what I found when playing with it, otherwise, or if it is in a too early stage still for that, then it is not necessary or usefull for me (or others) to do so, and waste my and others time (including yours). Nothing more wink

Offline

#21 2013-07-10 17:19:37

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

christophe,

You can post your problems here, in the forum, as usually. I think this topic is not for global Rolling problems, so better open new topic or pick sticky topic on the top of forum.

mojo,

How fair is your play?

You broke alsamixer,vi,and dialog desktop shortcuts on cooking with your commit:

You made 2 changes either one alone stops vi alsamixer and dialog shortcuts from working.

. . .

+Exec=vi <===Error

+Terminal=true <===Error

. . .

+Exec=alsamixer <=====Error

+Terminal=true <=====Error

Aleksej your right,with rolling-core-4in1.iso,core flavor selection vi opens with sakura after editing vi.desktop

Vi doesn't work after editing when booted in gtkonly selection.

So, seems like I broke vi, alsamixer and dialog example for gtkonly flavor.

While all this not broken and worked well on core flavor?

I understand you correctly?

alsamixer doesn't launch,test every menu shortcut.

But, mojo, what is about alsamixer? It not worked? Hmm... Gtkonly flavor have no alsamixer. What you want to tell me? You tried alsamixer on gtkonly or on core? And on core all works? I have a pattern gap. I can't understand.

____________________

I don't want a war, but it worked again for me in gtkonly flawor. What am I doing wrong?

Still using Rolling ISO (from July, 8). Open it in ISOmaster, extract boot/isolinux/isolinux.cfg from ISO and open it in the text editor:

[c]LABEL gtkonly
    MENU LABEL SliTaz gtkonly Live
    COM32 c32box.c32
    append linux /boot/bzImage initrd=/boot/rootfs4.gz,/boot/rootfs3.gz,/boot/rootfs2.gz rw root=/dev/null autologin[/c]
Extract /boot/rootfs4.gz, /boot/rootfs3.gz, /boot/rootfs2.gz using ISOmaster.

Glue them together (open terminal emulator in folder with extracted files):

[c]cat rootfs4.gz rootfs3.gz rootfs2.gz > gtkonly.gz[/c]
Now I have kernel (previously extracted [c]bzImage[/c]) and rootfs ([c]gtkonly.gz[/c]).

Configure Grub4dos menu entry:

[c]title SliTaz Rolling 13-07-08 (gtkonly)
rootnoverify (hd0,1)
kernel (hd0,1)/boot/rolling130708/bzImage rw root=/dev/null lang=ru_RU kmap=ru autologin
initrd (hd0,1)/boot/rolling130708/gtkonly.gz[/c]
Booting...

OMG! I like this small gtkonly flavor! With Rolling core flavor I've got 800×600 resolution on my 1024×600 display, but here I've saw native resolution. How I like it! wink

Let's press all the menu items? Ok.

Many of them not working at all! Hmm... But vi works. Open /usr/share/applications/vi.desktop and sure its content:

[c]. . .
Exec=vi
Terminal=true
. . .[/c]
And it works. Vi opens in the xterm. But, can I configure this behavior? Unfortunately, SpaceFM is too complicated for me and I can't open hard disk partition with the sakura tazpkg. And I don't want to make ppp0 connection work in the gtkonly today wink Better I write simple fake application:

[c]/usr/bin/faketerm:

#!/bin/sh
echo "Running faketerm..."
echo "Options are: $@"
echo "==================="[/c]
Make it executable. Test it:

[c]faketerm SliTaz loves You!

Running faketerm...
Options are: SliTaz loves You!
===================[/c]
Edit /home/tux/.config/lxpanel/slitaz/config and change

[c]Terminal=terminal[/c]

to

[c]Teminal=faketerm[/c]

Press Vi in the Applications menu. It still opens in the xterm. So we need to [c]lxpanel restart[/c] every time we change its settings.

Where we'll see faketerm messages? Close and reopen LXPanel in the terminal:

[c]killall lxpanel
lxpanel -p slitaz[/c]
Press Vi in the menu again, and we'll see message from faketerm:

[c]Running faketerm...
Options are: -e vi
===================[/c]
Let's back to [c]Terminal=terminal[/c] in the [c]config[/c] and restart using [c]lxpanelctl restart[/c]. Now Vi opens in the xterm. So, we can configure LXPanel behavior, and desktop files with "Terminal=true" are not broken, and they worked in the "core" flavor as they worked in the "gtkonly" flavor. What to fix when it works?

I want to tell you about not working menu items, but It is beyond the scope of the topic.

Offline

#22 2013-07-11 08:55:55

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

Are you here? I'm still here waiting for your answers.

If you don't like to read long post, I repeat questions here, in compressed form:

[*]How you can to found and to run alsamixer in the gtkonly flavor? While gtkonly have no alsamixer.desktop, even have no /usr/bin/alsamixer. But you claim that I broke it.

[*]If you tested all the menu etries in the Applications menu, why you don't pointed out that eight menu items are broken due to lack of browser?

[*]Why it all works for me, and out-from-the-box, and even I can configure it? Why it do'nt works for you?

I do not like when I was accused of being vain, what's not my fault.

I did not break the system by my commits.

Offline

#23 2013-07-11 15:35:01

mojo
Administrator
Registered: 2011-03-29
Posts: 2,173

Re: Terminal/console applications in menu

Aleksej,

I am wrong.

Your commits didn't break anything.

Please accept my apology.

mojo

Offline

#24 2013-07-11 17:12:01

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Terminal/console applications in menu

mojo,

I accepted your apologies. With pleasure.

But still a question, why it not worked?

And still a question, how good this standard is supported "beyond lxpanel": like in jwm and e17...

I know that ADeskBar have not full standard support, it not show my menu sub-categories. But I not dig deeper, ADeskBar is very raw as for me.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.021 seconds, 8 queries executed - Memory usage: 1.61 MiB (Peak: 1.77 MiB) ]