How to add 'st' as default terminal?

Kernels & Hardware, configuring network, installing services

How to add 'st' as default terminal?

Postby bedtime » 2018-01-29 23:29

I've installed st terminal via compile, and it works like a charm. Now it's time to change the default terminal, and I'm at a loss how to do it.

When I do:
Code: Select all
update-alternatives --config x-terminal-emulator


And there is no option for it.

I've tried:
Code: Select all
update-alternatives --set x-terminal-emulator /usr/local/bin/st


Which returns:
Code: Select all
update-alternatives: error: alternative /usr/local/bin/st for x-terminal-emulator not registered; not setting


And as last ditch effort I tried using the alias command to the default terminal.


How can I add it?
bedtime
 
Posts: 36
Joined: 2012-12-16 19:34

Re: How to add 'st' as default terminal?

Postby bw123 » 2018-01-29 23:52

bedtime wrote:I've installed st terminal via compile, and it works like a charm. Now it's time to change the default terminal, and I'm at a loss how to do it.


I'm not surprised, you seem to be very talented at trying to poke holes thru your debian installation. This is a little odd for a beginner.

Do you mean you installed "suckless tools term" by downloading a source tarball and issuing make? Is it some other st?

https://packages.debian.org/stretch/stterm
https://packages.debian.org/stable/virt ... l-emulator

I snagged this from fluxbox pkg, in the postinst script. I yhink you could do something similar, check the stterm pkg and use it's postinst as a guide.

Code: Select all
manager=/usr/bin/startfluxbox

add_wm_entry ()
{
    update-alternatives --install /usr/bin/x-window-manager \
        x-window-manager $manager 50 \
          --slave /usr/share/man/man1/x-window-manager.1.gz \
        x-window-manager.1.gz /usr/share/man/man1/fluxbox.1.gz
}



No, this is not the "debian way" but as long as you have a backup...
User avatar
bw123
 
Posts: 2765
Joined: 2011-05-09 06:02
Location: TN_USA

Re: How to add 'st' as default terminal?

Postby Thorny » 2018-01-30 00:44

bedtime wrote:
Code: Select all
update-alternatives: error: alternative /usr/local/bin/st for x-terminal-emulator not registered; not setting

How can I add it?

What bw123 states makes sense to me.
Perhaps, in order to get it "registered", you might need to install it in a format similar to this.
update-alternatives --install /usr/bin/$LINK $PROVIDES /usr/bin/$BIN $XX
User avatar
Thorny
 
Posts: 531
Joined: 2011-02-27 13:40

Re: How to add 'st' as default terminal?

Postby bedtime » 2018-01-30 02:11

Perhaps your solutions were more professional, but I solved it with:
cp /usr/local/bin/st /usr/bin/stterm
bedtime
 
Posts: 36
Joined: 2012-12-16 19:34

Re: How to add 'st' as default terminal?

Postby Head_on_a_Stick » 2018-01-30 06:53

There is a GUI front-end for the alternatives system:

https://packages.debian.org/stretch/galternatives
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7189
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to add 'st' as default terminal?

Postby Thorny » 2018-01-30 08:55

Head_on_a_Stick wrote:There is a GUI front-end for the alternatives system:

I've never used that GUI but I'd guess that since bedtime's self compiled st isn't in alternatives, it probably wouldn't know about it.

I'd also guess that APT also wouldn't know about it so it wouldn't get upgrades like a Debian package would but you would probably know more about that than me, eh?
User avatar
Thorny
 
Posts: 531
Joined: 2011-02-27 13:40

Re: How to add 'st' as default terminal?

Postby Head_on_a_Stick » 2018-01-30 08:59

Thorny wrote:I'd guess that since bedtime's self compiled st isn't in alternatives, it probably wouldn't know about it

The GUI has a handy "install" button to add new alternatives to the system, that's why I suggested it ;)

Thorny wrote:I'd also guess that APT also wouldn't know about it so it wouldn't get upgrades like a Debian package

suckless don't change st much, it is considered feature complete :)

Anyway, an update can be as simple as
Code: Select all
cd ~/git/st
git pull
sudo make install

suckless' own operating system uses git as the package manager :cool:
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7189
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to add 'st' as default terminal?

Postby Thorny » 2018-01-30 09:10

Thanks for the clarifications!

[edit] Hey, HoaS, I thought you didn't like GUI's. :-)
User avatar
Thorny
 
Posts: 531
Joined: 2011-02-27 13:40

Re: How to add 'st' as default terminal?

Postby bedtime » 2018-01-30 10:59

Head_on_a_Stick wrote:Anyway, an update can be as simple as
Code: Select all
cd ~/git/st
git pull
sudo make install

You forgot a command:

Code: Select all
cd ~/git/st
git pull
sudo make install
cp /usr/local/bin/st /usr/bin/stterm

:P

Anyways, this is great info to know. I'll be trying this with dwm next (dwm was installed with apt, and now I would like to install by source.)
bedtime
 
Posts: 36
Joined: 2012-12-16 19:34

Re: How to add 'st' as default terminal?

Postby Head_on_a_Stick » 2018-01-30 11:38

Thorny wrote:I thought you didn't like GUI's

Well, I don't use it myself, obviously:
Code: Select all
~ $ update-alternatives --list x-terminal-emulator     
/usr/bin/koi8rxterm
/usr/bin/lxterm
/usr/bin/terminator
/usr/bin/urxvt
/usr/bin/uxterm
/usr/bin/xterm
~ $ sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/urxvtc 100
~ $ update-alternatives --list x-terminal-emulator                                                         
/usr/bin/koi8rxterm
/usr/bin/lxterm
/usr/bin/terminator
/usr/bin/urxvt
/usr/bin/urxvtc
/usr/bin/uxterm
/usr/bin/xterm
~ $ update-alternatives --config x-terminal-emulator
There are 7 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).

  Selection    Path                 Priority   Status
------------------------------------------------------------
  0            /usr/bin/urxvtc       100       auto mode
  1            /usr/bin/koi8rxterm   20        manual mode
  2            /usr/bin/lxterm       30        manual mode
  3            /usr/bin/terminator   50        manual mode
* 4            /usr/bin/urxvt        20        manual mode
  5            /usr/bin/urxvtc       100       manual mode
  6            /usr/bin/uxterm       20        manual mode
  7            /usr/bin/xterm        20        manual mode

Press <enter> to keep the current choice[*], or type selection number:
~ $

:D
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7189
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to add 'st' as default terminal?

Postby Head_on_a_Stick » 2018-01-30 11:40

bedtime wrote:dwm was installed with apt, and now I would like to install by source.

ProTip: use this command to get the source:
Code: Select all
apt-get source dwm # needs deb-src lines in sources.list to work

Then modify the code to your liking and rebuild the package afterwards and install the .deb so it is all under the aegis of APT.
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7189
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to add 'st' as default terminal?

Postby Thorny » 2018-01-30 11:56

[OT]
Head_on_a_Stick wrote:
Thorny wrote:I thought you didn't like GUI's

Aw, gee, you left off the smilie. How dare you! I was trying to have a little banter, I thought you of all people would appreciate that.

I too use the CL for updating alternatives.

I think I'd better learn how to interface with people better. :-)
User avatar
Thorny
 
Posts: 531
Joined: 2011-02-27 13:40

Re: How to add 'st' as default terminal?

Postby Head_on_a_Stick » 2018-01-30 17:29

Thorny wrote:Aw, gee, you left off the smilie

Nah, it's right there, at the bottom :)

Thorny wrote:I think I'd better learn how to interface with people better. :-)

D00d, you are awesome, please don't change.
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7189
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to add 'st' as default terminal?

Postby bw123 » 2018-01-30 21:20

Wouldn't the best answer be, "Use the debian repo to install it, then use (as root) 'update-alternatives --config x-terminal-emulator'?"

I might try stterm. I haven't used suckless apps in awhile. I recall surf is also a really intersting pkg.

galternatives is a 189k pkg that needs 20 MEGS of gnome dependencies for me, so that one is not going to happen...
User avatar
bw123
 
Posts: 2765
Joined: 2011-05-09 06:02
Location: TN_USA

Re: How to add 'st' as default terminal?

Postby Head_on_a_Stick » 2018-01-30 21:28

bw123 wrote:Wouldn't the best answer be, "Use the debian repo to install it, then use (as root) 'update-alternatives --config x-terminal-emulator'?"

It is only possible to configure st at compile time so the binary package from the repositories isn't much use (unless you happen to like the default settings).
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7189
Joined: 2014-06-01 17:46
Location: /dev/chair

Next

Return to System configuration

Who is online

Users browsing this forum: SuperDuperUser and 2 guests

fashionable