SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-05-11 20:48:01

neal
Member
Registered: 2012-10-21
Posts: 13

For next release: Config files should use alternatives

Hello,

One thing that drove me nuts is that there is a link to change default applications in the menu, but it
isn't actually used in the default config. For example, if I change my default x-terminal-emulator to stterm,
all the shortcut keys and menu items still launch terminator.

For example, instead of this snippet in rc.xml:

     <keybind key="W-h">
       <action name="Execute">
         <startupnotify>
           <enabled>true</enabled>
           <name>htop</name>
         </startupnotify>
         <command>terminator --command=&quot;htop&quot;</command>
       </action>
     </keybind>

we pointed it at

       <keybind key="C-A-Delete">
           <action name="Execute">
               <startupnotify>
                   <enabled>true</enabled>
                   <name>htop</name>
               </startupnotify>
               <command>x-terminal-emulator -e htop</command>
           </action>
       </keybind>

This should be changed in rc.xml, menu.xml, and defaults.list. The apps I got working were terminal and editor, maybe there should be alternatives for file manager and media player too.

-neal

Offline

Help fund CrunchBang, donate to the project!

#2 2013-05-12 08:34:22

Jeeves
New Member
Registered: 2013-05-10
Posts: 3

Re: For next release: Config files should use alternatives

Seconded!

To be honest, I don't mind it so much in my own configuration files because I can easily change them. But there are also hardcoded calls to geany, terminator and nano (and undoubtedly others) in a whole lot of scripts in /usr/bin. That is really, really bad. The freedom of choice is my number 1 reason to use Linux, and now I'm having these applications forced upon me, and no way of getting around them.

Bad crunchbang. Bad, bad crunchbang.

Offline

#3 2013-05-12 09:10:14

fatmac
#! Die Hard
Registered: 2012-11-14
Posts: 1,948

Re: For next release: Config files should use alternatives

Jeeves wrote:

The freedom of choice is my number 1 reason to use Linux, and now I'm having these applications forced upon me, and no way of getting around them.

No freedom of choice is being taken away from you, you chose to use #!, which is set up with defaults just like any other distro, they can all be changed to whatever suits you.  smile


Linux since 1999
Currently:  AntiX, & Crunchbang.
A good general beginners book for Linux :- http://rute.2038bug.com/index.html.gz
A good Debian read :- http://debian-handbook.info/get/now/

Offline

#4 2013-05-12 10:07:43

Jeeves
New Member
Registered: 2013-05-10
Posts: 3

Re: For next release: Config files should use alternatives

fatmac wrote:

...  they can all be changed to whatever suits you.  smile

Well sure, it's all bytes on a disk so ultimately everything can be changed. But right now I have to hack the contents of (for example) /usr/bin/cb-compositor if I want "cb-compositor --edit" to start a different editor. That is not something a user should have to do, especially since Debian already provides the "alternatives" mechanism for this.

Offline

#5 2013-05-12 10:56:18

VDP76
#! Bean Roaster
Registered: 2012-04-12
Posts: 826

Re: For next release: Config files should use alternatives

fatmac wrote:

No freedom of choice is being taken away from you, you chose to use #!, which is set up with defaults just like any other distro

I agree, defaults are inevitable arbitrary choices, if you don't like them they can be changed...

Jeeves wrote:

But right now I have to hack the contents of (for example) /usr/bin/cb-compositor if I want "cb-compositor --edit" to start a different editor. That is not something a user should have to do, especially since Debian already provides the "alternatives" mechanism for this.

freedom is also about finding your own alternatives, likes aliases wink

alias comp_edit='text_editor_of_your_choice /usr/bin/cb-compositor'

#!#!#! Forum etiquette #!#!#!
Are you a new member!? Have you introduced yourself?!
CLI basics | LVM | smxi | chrooting | multiarch

Offline

#6 2013-05-12 11:51:56

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 10,163
Website

Re: For next release: Config files should use alternatives

We all 'hack the contents' of whatever we are using.  Debian out of the box is ugly as sin (IMO) and requires as much work as any other distro to get it flowing the way we want it

It's about a solid base to work from, not subjective perfection that is going to suit every persons needs...

Having said that, I am sure corenominal will look at neal's suggestions and if they work for his plans/goals/objectives, he will use them

@VDP76, excellent suggestion and example of the power of aliases... well done


VSIDO | SolusOS

Words That Build Or Destroy

Offline

#7 2013-05-12 11:57:55

uname
#! Junkie
Registered: 2013-03-15
Posts: 434

Re: For next release: Config files should use alternatives

Terminator uses too much RAM. I think there is no problem to change in the openbox menus from terminator to the alterrnatives-system. Same for editors. I use vim or graphic based vims like vim-gtk.

Last edited by uname (2013-05-12 11:58:28)

Offline

#8 2013-05-12 17:52:21

neal
Member
Registered: 2012-10-21
Posts: 13

Re: For next release: Config files should use alternatives

VDP76 wrote:

I agree, defaults are inevitable arbitrary choices, if you don't like them they can be changed...

Well, the "Edit Default Applications" menu item doesn't work; if you change your terminal there,
Win-T still pops up terminator. I am well aware I could just edit the config file (I posted the fix in the FP),
but if the menu had worked I wouldn't have had to.

If we can get this fixed,  it will save a few minutes of annoyance for every single person that
changes their terminal. Look at the Ideas thread
and you can see how often people change their terminal and how passionate they are about it. Same goes for editors, media players, etc.

And if it is never fixed, well, when someone else has this problem, at least this thread will turn up when they google it.

Offline

#9 2013-05-12 22:48:49

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: For next release: Config files should use alternatives

The freedom in linux and openbox might require the ability to change a few entrys in the openbox-menu, or create a fully custom one. If a user isn`t able to edit menu.xml or not interested in learning to do so, then it`s the users own faulth that he/she doesn`t experience the freedom in linux.


- apt-mark hold account

Offline

#10 2013-05-12 23:38:11

rkwurth
#! Junkie
Registered: 2012-09-04
Posts: 365

Re: For next release: Config files should use alternatives

I'd be happy to see Crunchbang's rc.xml make more use of the update-alternatives system, not necesssarily because it's more or less correct, but as a matter of consistency in relation to the Default Applications dialog. I personally do think it's more correct, but am too a guest in the Crunchbang house.

Offline

#11 2013-05-13 00:11:27

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: For next release: Config files should use alternatives

neal wrote:
VDP76 wrote:

I agree, defaults are inevitable arbitrary choices, if you don't like them they can be changed...

Well, the "Edit Default Applications" menu item doesn't work; if you change your terminal there,
Win-T still pops up terminator. I am well aware I could just edit the config file (I posted the fix in the FP),
but if the menu had worked I wouldn't have had to.

Well, it works for some things, like the gnome-www-browser, and the x-www-browser... I`m happy to use terminator as I have the resources to do so, but I tried to change it to xterm, and it didn`t work. Even though it`s not a issue for me, I just change the execution command in menu.xml from terminator to xterm, and it works just fine. Pretty easy to do, but I have to agree that there`s no point in having a lot of options in "Edit Default Application" if it doesn`t work to select them. At the very least I think that the options that doesn`t work, should be removed, instead of confusing new users that might think they are doing something wrong when they cannot get it to work...

Last edited by ew (2013-05-13 00:12:08)


- apt-mark hold account

Offline

#12 2013-05-13 00:24:37

rkwurth
#! Junkie
Registered: 2012-09-04
Posts: 365

Re: For next release: Config files should use alternatives

ew wrote:

At the very least I think that the options that doesn`t work, should be removed, instead of confusing new users that might think they are doing something wrong when they cannot get it to work...

I think the Default Applications is `update-alternatives --all`, which runs the selection dialog for all "registered" applications.

Another argument here is what S-t should do- Should it launch terminator, or should it launch the terminal emulator?

Offline

#13 2013-05-13 01:42:24

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: For next release: Config files should use alternatives

rkwurth wrote:
ew wrote:

At the very least I think that the options that doesn`t work, should be removed, instead of confusing new users that might think they are doing something wrong when they cannot get it to work...

I think the Default Applications is `update-alternatives --all`, which runs the selection dialog for all "registered" applications.

Another argument here is what S-t should do- Should it launch terminator, or should it launch the terminal emulator?

Yes, I checked it now, and it`s indeed "sudo update-alternatives -all", I`ve always assumed that it was a custom script, so now I`ve learned something new today also:)

<item label="Edit Default Applications">
	<action name="Execute">
			<command>
					terminator --command="sudo update-alternatives --all"
			</command>
	</action>
</item>

As for what S-t should do, I would say that it should launch whatever terminal  that is chosen as default in "update-alternative --all", and that works just fine with this command: "exo-open --launch TerminalEmulator", or even simpler, "x-terminal-emulator". If you choose xterm as default terminal in Edit Default Applications, the TerminalEmulator command will launch xterm....

A good solution might be that Terminator is set as default initially, but that it is being launched as the TerminalEmulator or x-terminal-emulator. That way it will reflect any changes in Edit Default Apllications. This issue is actually rather easy to fix. I probably could do it myself. Maybe tomorrow:)

Last edited by ew (2013-05-13 01:48:22)


- apt-mark hold account

Offline

#14 2013-05-13 01:48:23

rkwurth
#! Junkie
Registered: 2012-09-04
Posts: 365

Re: For next release: Config files should use alternatives

I agree! Whether you should use exo-open or x-terminal-emulator is raises another issue- multiple environmental variables for the same thing...

Offline

#15 2013-05-13 01:54:33

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: For next release: Config files should use alternatives

rkwurth wrote:

I agree! Whether you should use exo-open or x-terminal-emulator is raises another issue- multiple environmental variables for the same thing...

Yes, it would be cleaner with just one of them. exo-open is probably a leftover from the xfce-days...


- apt-mark hold account

Offline

#16 2013-05-13 02:07:11

neal
Member
Registered: 2012-10-21
Posts: 13

Re: For next release: Config files should use alternatives

ew wrote:

This issue is actually rather easy to fix. I probably could do it myself. Maybe tomorrow:)

I just put in a pull req on github, so don't worry about it. smile

Also, terminator has a bug about parsing commands, so you can't just s/terminator/x-terminal-emulator/g on the config files sad

https://bugs.launchpad.net/terminator/+bug/366644

Offline

#17 2013-05-13 07:24:39

uname
#! Junkie
Registered: 2013-03-15
Posts: 434

Re: For next release: Config files should use alternatives

Why use the lightweight distribution the big terminal-emulator "terminator" and not "xterm" with perhaps a nice ~/.Xdefaults or ~/.Xresources. You can save perhaps 10 MB of RAM. Test it.

Offline

#18 2013-05-13 07:56:25

DebianJoe
#! Code Whisperer
From: The Bleeding Edge
Registered: 2013-03-13
Posts: 1,207
Website

Re: For next release: Config files should use alternatives

uname wrote:

Why use the lightweight distribution the big terminal-emulator "terminator" and not "xterm" with perhaps a nice ~/.Xdefaults or ~/.Xresources. You can save perhaps 10 MB of RAM. Test it.

I strongly recommend urxvt + tmux as a really fantastic way to do everything that Terminator does and more with less overhead.  On the other hand, it also requires some "hackery" to really get it to shine like the sun.  Once you're done, though, it's brutally efficient.

@VDP76, thanks for pointing out how aliases can be used to not be "forced" into anything.  Part of what makes Linux so great is that there is pretty much nothing that you cannot adjust to your personal needs if you take the time to figure it out.

Offline

#19 2013-05-13 10:41:44

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: For next release: Config files should use alternatives

neal wrote:
ew wrote:

This issue is actually rather easy to fix. I probably could do it myself. Maybe tomorrow:)

I just put in a pull req on github, so don't worry about it. smile

Also, terminator has a bug about parsing commands, so you can't just s/terminator/x-terminal-emulator/g on the config files sad

https://bugs.launchpad.net/terminator/+bug/366644

Ok, that makes it a bit more tricky, but nothing bad will happen by looking into it. Even if I don`t get it to work, I still will learn something...


- apt-mark hold account

Offline

#20 2013-05-13 10:47:41

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: For next release: Config files should use alternatives

DebianJoe wrote:

I strongly recommend urxvt + tmux as a really fantastic way to do everything that Terminator does and more with less overhead.  On the other hand, it also requires some "hackery" to really get it to shine like the sun.  Once you're done, though, it's brutally efficient.

I don`t doubt that, but I don`t recommend that Phillip makes urxvt and tmux the new defaults in Crunchbang  lol


- apt-mark hold account

Offline

#21 2013-05-13 12:54:56

ancwd
New Member
Registered: 2013-05-12
Posts: 3

Re: For next release: Config files should use alternatives

I use xterm personally but I'm not sure how well xterm supports japanese, chinese, arabic, farsi  and such languages. so maybe that would hinder it being set as the default out of the box term emulator.

not to mention xterm by itself is one ugly terminal, i personally have 2 scripts in my ~/bin folder that run xterm for me in truetype and fixed, i've added 2 entries to my menu.xml pointing to each one of them

for anyone interested the scripts are

~/bin/xterm-truetype.sh

#!/bin/bash
font="DejaVu Sans Mono"
font_size=12
 
exec xterm -bg black -fg white \
    -fa "$font" \
    -fd "$font" \
    -fs $font_size \
    -j -s \
    -sb -si -sk \
    -sl 1024 -rightbar \
    +sf +dc -cr green  \
    -u8 \
    $@ & 
exit

~/bin/xterm-fixed.sh

#!/bin/sh

exec xterm -bg black -fg white \
    -j -s \
    -sb -si -sk -sl 1024 -rightbar \
    +sf +dc -cr green  \
    -u8 \
    -xrm "xterm*font:-misc-*-*-*-*-*-20-*-*-*-*-*-iso10646-*"  \
    -xrm "xterm*wideFont:-misc-*-*-*-*-*-20-*-*-*-*-*-iso10646-*"  \
    $@ & 
exit

I didn't write these scripts, i found them on the net somewhere a long time ago

as for tmux, there seems to be a new one called byobu. i'm personally a screen user but for that too i had to heavily modified screenrc to run along with it

Offline

#22 2013-05-13 15:21:00

neal
Member
Registered: 2012-10-21
Posts: 13

Re: For next release: Config files should use alternatives

ew wrote:
neal wrote:
ew wrote:

This issue is actually rather easy to fix. I probably could do it myself. Maybe tomorrow:)

I just put in a pull req on github, so don't worry about it. smile

Also, terminator has a bug about parsing commands, so you can't just s/terminator/x-terminal-emulator/g on the config files sad

https://bugs.launchpad.net/terminator/+bug/366644

Ok, that makes it a bit more tricky, but nothing bad will happen by looking into it. Even if I don`t get it to work, I still will learn something...

I also sent in a patch for the terminator bug (not that I even use terminator) at launchpad, but I have no idea how long it will take them before it makes it's way to the repos.  I'm somewhat surprised that the -e bug was open for over four years, but it only took me 20 min and 6 lines of code to fix it  smile

Offline

#23 2013-05-13 15:31:16

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: For next release: Config files should use alternatives

neal wrote:
ew wrote:
neal wrote:

I just put in a pull req on github, so don't worry about it. smile

Also, terminator has a bug about parsing commands, so you can't just s/terminator/x-terminal-emulator/g on the config files sad

https://bugs.launchpad.net/terminator/+bug/366644

Ok, that makes it a bit more tricky, but nothing bad will happen by looking into it. Even if I don`t get it to work, I still will learn something...

I also sent in a patch for the terminator bug (not that I even use terminator) at launchpad, but I have no idea how long it will take them before it makes it's way to the repos.  I'm somewhat surprised that the -e bug was open for over four years, but it only took me 20 min and 6 lines of code to fix it  smile

Nice, thumbs up! It`s probably not a preferred issue to make it easier for someone to use something else....


- apt-mark hold account

Offline

#24 2013-05-13 15:38:06

ancwd
New Member
Registered: 2013-05-12
Posts: 3

Re: For next release: Config files should use alternatives

I converted the scripts i posted earlier into .Xresources format.
Hope this is helpful to someone

just append the following to your ~/.Xresources file and run
$ xrdb ~/.Xresources
or
$ xrdb -merge ~/.Xresources
or just restart you computer

For fixed font, uncomment the font and wideFont rescources and comment the faceSize, faceName and faceNameDoublesize resources
Lines starting by ! are comment lines and will be ignored

! Xterm ---------------------------------------------------------------
!XTerm*font:-misc-*-*-*-*-*-20-*-*-*-*-*-iso10646-*
!XTerm*wideFont:-misc-*-*-*-*-*-20-*-*-*-*-*-iso10646-*
XTerm*faceSize:12
XTerm*faceName:DejaVu Sans Mono
XTerm*faceNameDoublesize:DejaVu Sans Mono
!XTerm*faceName:Terminus
!XTerm*faceNameDoublesize:Terminus
XTerm*VT100.geometry:80x24
XTerm*background:black
XTerm*cursorColor:green
XTerm*dynamicColors:true
XTerm*eightBitInput:true
XTerm*foreground:white
XTerm*jumpScroll:true
XTerm*keyboardType:default
XTerm*multiScroll:true
XTerm*rightScrollBar:true
XTerm*saveLines:1024
XTerm*scrollBar:true
XTerm*scrollKey:true
XTerm*scrollTtyOutput:false
XTerm*toolBar:false
XTerm*utf8:2

Offline

Be excellent to each other!

#25 2013-08-27 20:20:38

neal
Member
Registered: 2012-10-21
Posts: 13

Re: For next release: Config files should use alternatives

Just wanted to pop in and mention that my patch for terminator has been merged on launchpad and available through the nightly ppa. I'm not sure how long it will take for it to propogate to the debian repos, but hopefully we can get this fixed for Janice.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo