You are not logged in.

#1 2023-06-11 12:34:31

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 205

[SOLVED] Launch gtk-launch <terminal> to land in a different folder

Hello, I have a simple question:

I made a simple script called gtklaunch.sh as:

#!/bin/sh

gtk-launch kitty

and this script file is located in a folder, let's say "/home/user/test".

When I run ./gtklaunch.sh directly on its folder, kitty will be opened in "/home/user/test". If I move to two parent folders back, and I am in "/home" dir and I run "./user/test/gtklaunch", kitty will be opened in "/home" folder.

Is there a way to force gtk-launch to open the terminal that I use (in this case Kitty, but could be every terminal) to a fixed folder (as /home/user) regardless the position I call the script?

Last edited by D3vil0p3r (2023-06-11 13:07:35)

Offline

#2 2023-06-11 12:51:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,484
Website

Re: [SOLVED] Launch gtk-launch <terminal> to land in a different folder

Why not just add a 'cd' to the script?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-06-11 13:07:20

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 205

Re: [SOLVED] Launch gtk-launch <terminal> to land in a different folder

Trilby wrote:

Why not just add a 'cd' to the script?

Very simple solution. Thanks.

Offline

Board footer

Powered by FluxBB