You are not logged in.

#1 2019-03-08 13:13:18

Wismut
Member
Registered: 2018-12-07
Posts: 18

[solved] Add global alias

Hello,

I've written a bash script which depends on my web browser being started with some flags. but the browser itself is not started by the script. I've defined an alias in my bashrc file and can start the browser from the command line and it works fine, however, if I start it using the keybindings, it does not work as the script www-browser is called, which apparently does not care if there is an alias or not. How can I incorporate the alias into www-browser, so that it will also start the browser with the necessary flags?

Last edited by Wismut (2019-05-09 08:59:03)

Offline

#2 2019-03-08 13:23:00

damo
....moderator....
Registered: 2015-08-20
Posts: 4,877

Re: [solved] Add global alias

An alias is for the shell. Please post your script, using [ code ]tags.


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#3 2019-03-10 20:52:51

ohnonot
...again
Registered: 2015-09-29
Posts: 3,671
Website

Re: [solved] Add global alias

more precisely:
aliases are not considered in shell scripts, only on the command line.
but there's plenty of way around that.
show us what you got, i'm not 100% sure i understood.

i have some scripts in ~/bin that override applications in /usr/bin, but i'm not sure if x-www-broser would use that.
does it have to be x-www-browser?

Offline

#4 2019-03-15 11:10:00

Wismut
Member
Registered: 2018-12-07
Posts: 18

Re: [solved] Add global alias

I want to start the Vivaldi web browser with the remote-debugging-port flag enabled even when launching it from openbox using either super+w or from the super menu. However, by default the browser is not launched directly, but from openbox, x-www-browser is invoked, which then starts the browser, but without flags. In the background there is a programm running that tries to connect to the remote-debugging-port of the browser, but it obviously fails if the browser is started without the flag. At the moment, I have to start the browser from the command line with the flags added, which is not what I want. It would be nice if it would be possible to start the browser with its flags added using super+w.

Offline

#5 2019-03-15 11:33:19

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,733

Re: [solved] Add global alias

I'd do a browser script in ~/bin/browser , like

vivaldi --stuff ...

and edit .config/openbox rc.xml and menu.xml accordingly to call that script.

Example browser script:

#!/bin/bash

if cat $HOME/.gtkrc-2.0 | grep Adapta-Nokto ; then
    echo "mkay"
    GTK_THEME=Adapta /usr/bin/firefox
else
    echo "just using what's there"
    /usr/bin/firefox
fi

Last edited by brontosaurusrex (2019-03-15 11:34:38)

Offline

#6 2019-03-15 18:55:54

ohnonot
...again
Registered: 2015-09-29
Posts: 3,671
Website

Re: [solved] Add global alias

Wismut wrote:

I want to start the Vivaldi web browser with the remote-debugging-port flag enabled even when launching it from openbox using either super+w or from the super menu. However, by default the browser is not launched directly, but from openbox, x-www-browser is invoked, which then starts the browser, but without flags. In the background there is a programm running that tries to connect to the remote-debugging-port of the browser, but it obviously fails if the browser is started without the flag. At the moment, I have to start the browser from the command line with the flags added, which is not what I want. It would be nice if it would be possible to start the browser with its flags added using super+w.

sounds like you want to create a custom .desktop file that does what you want.

Offline

#7 2019-03-16 01:28:24

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,229
Website

Re: [solved] Add global alias

Or just edit rc.xml to replace the command 'x-www-browser' with your custom 'vivaldi --option --option2'.

(x-www-browser is an alias that points to whatever browser has been configured as that Debian alternative. The idea is that even if you switch to another browser all your menu entries and keybinds will go on working.)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#8 2019-05-09 08:19:58

Wismut
Member
Registered: 2018-12-07
Posts: 18

Re: [solved] Add global alias

Sorry for the late reply, but this worked, thank you smile

Offline

Board footer

Powered by FluxBB