Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to add 'st' as default terminal?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
bedtime
Posts: 146
Joined: 2012-12-16 19:34
Has thanked: 1 time
Been thanked: 6 times

How to add 'st' as default terminal?

#1 Post by bedtime »

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?

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

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

#2 Post by bw123 »

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...
resigned by AI ChatGPT

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

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

#3 Post by Thorny »

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

bedtime
Posts: 146
Joined: 2012-12-16 19:34
Has thanked: 1 time
Been thanked: 6 times

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

#4 Post by bedtime »

Perhaps your solutions were more professional, but I solved it with:
cp /usr/local/bin/st /usr/bin/stterm

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#5 Post by Head_on_a_Stick »

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

https://packages.debian.org/stretch/galternatives
deadbang

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

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

#6 Post by Thorny »

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
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#7 Post by Head_on_a_Stick »

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:
deadbang

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

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

#8 Post by Thorny »

Thanks for the clarifications!

[edit] Hey, HoaS, I thought you didn't like GUI's. :-)

bedtime
Posts: 146
Joined: 2012-12-16 19:34
Has thanked: 1 time
Been thanked: 6 times

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

#9 Post by bedtime »

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.)

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#10 Post by Head_on_a_Stick »

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
deadbang

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#11 Post by Head_on_a_Stick »

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.
deadbang

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

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

#12 Post by Thorny »

[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
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#13 Post by Head_on_a_Stick »

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.
deadbang

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

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

#14 Post by bw123 »

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...
resigned by AI ChatGPT

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#15 Post by Head_on_a_Stick »

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).
deadbang

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

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

#16 Post by bw123 »

Head_on_a_Stick wrote:
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).

I see. In that case this might be a good thread to hijack and post some tweaks, or add a helpful link or two.

https://git.suckless.org/st/plain/FAQ
resigned by AI ChatGPT

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#17 Post by Head_on_a_Stick »

Here's my config.h: https://raw.githubusercontent.com/Head- ... onfig.h.st (with BunsenLabs' terminal colours) :)
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

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

#18 Post by stevepusser »

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'?"

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...
Wow, you must not have any GTK+ apps on your system at all.
MX Linux packager and developer

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

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

#19 Post by bw123 »

stevepusser wrote:
bw123 wrote:
galternatives is a 189k pkg that needs 20 MEGS of gnome dependencies for me, so that one is not going to happen...
Wow, you must not have any GTK+ apps on your system at all.
It's not that I don't want to, but geez...

That 20 mb I mentioned was without recommends:

Code: Select all

# apt-get -s --install-recommends install galternatives
The following NEW packages will be installed:
  adwaita-icon-theme at-spi2-core dbus-user-session dconf-gsettings-backend
  dconf-service galternatives gconf-service gconf2 gconf2-common gcr gksu
  glib-networking glib-networking-common glib-networking-services gnome-icon-theme
  gnome-keyring gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libblas-common libblas3
  libcairo-gobject2 libcap2-bin libcolord2 libcups2 libdbus-glib-1-2 libdconf1
  libgail-common libgail18 libgck-1-0 libgconf-2-4 libgcr-3-common libgcr-base-3-1
  libgcr-ui-3-1 libgfortran3 libgksu2-0 libglade2-0 libgnome-keyring-common
  libgnome-keyring0 libgtk-3-0 libgtk-3-bin libgtk-3-common libgtk2.0-0 libgtk2.0-bin
  libgtk2.0-common libgtop-2.0-10 libgtop2-common libjson-glib-1.0-0
  libjson-glib-1.0-common liblapack3 libpam-cap libpam-gnome-keyring libquadmath0
  librest-0.7-0 librsvg2-common libsecret-1-0 libsecret-common libsoup-gnome2.4-1
  libsoup2.4-1 libstartup-notification0 libwayland-cursor0 libwayland-egl1-mesa p11-kit
  p11-kit-modules pinentry-gnome3 python-cairo python-glade2 python-gobject-2
  python-gtk2 python-numpy sudo
resigned by AI ChatGPT

Post Reply