You are not logged in.

#1 2023-02-22 08:43:57

archisominimalist
Member
Registered: 2023-02-11
Posts: 22

[SOLVED] symbols in ~/.xintirc pass shell commands to st ?

 ~/.xinitrc st ls -lah /#/ Passing shell commands to st in ~/.xinitrc 

Was the original title, for a lack of better ideas.

The goal is to edit my ~/.xinitrc so that commands are executed in st in dwm.
In my understanding, after typing startx manually or automatically with ~/.bashrc the output of the commands at the end of ~/.xinitrc are visible in the VT.
So, in case you would want to see the output of ls -lah in st in dwm, how would one achieve that without ~/.bashrc or ~/.bash_profile, if that's possible?

I imagine that it should be possible given that it's Linux. I lack the vocabulary to explain it better. I'm sorry,
Sorry for this text aswell, mentioning that I know of ~/.bashrc or ~/.bash_profile which would be another solution, if possible I want to learn how to use the shell efficiently, I don't know if that's efficient however.


#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then







    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then







    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

st &
exec dwm

  

Last edited by archisominimalist (2023-02-23 09:44:01)


Thanks to everybody that is contributing to make open-source software possible.
Apparently I still manage to offend people, even while trying to be as empathic as possible and search/try to learn before posting.
I love y'all.

Offline

#2 2023-02-22 09:02:08

seth
Member
Registered: 2012-09-03
Posts: 50,008

Re: [SOLVED] symbols in ~/.xintirc pass shell commands to st ?

"man st"

st -e ls -lah

Edit: the problem w/ the specific command is that st will terminate immediately after ls, so you'll barely see the window showing up


st -e /bin/bash -c "ls -lah; read"

Will run ls in bash in st and then wait for input before it quits.

Edit #2:
try

st -e /bin/bash -c "ls -lah; exec /bin/bash"

and explain what you *actually* want to achieve here.

Last edited by seth (2023-02-22 09:07:26)

Online

#3 2023-02-22 10:36:43

archisominimalist
Member
Registered: 2023-02-11
Posts: 22

Re: [SOLVED] symbols in ~/.xintirc pass shell commands to st ?

Seth, I want to thank you for your excellent post.

st -e /bin/bash -c "ls -lah; exec /bin/bash"

is the perfect solution.


Are you sure that you really want to spend your time reading some1's random story online?
Or the better questions are: Do you really care, will you read and understand my story?

I wake up at 4AM, while brushing my teeth I do a warmup, then I take a run with shorts and hoodie at -10 Celsius until I need to convince myself that I have to stop because I'm not sure if my body can take anymore, but in return the cold apartment feels a bit warmer, warm enough to learn and improve my skills daily, hoping that one day it will pay back, but in reality I'm just counting the years that have been lost, where any ordinary 9-5, even as a waste collector would have paid out better by now, because apparently I'm too dumb.
But I'm grateful, because I'm aware that even this shitty life in the first world is luxurious to the lives of the children and adults around the world mining the minerals necessary to produce the very devices we use to share our, oh such and such important thoughts and problems, without the slightest idea of hope, not even a reliable source of clean water or food.

You struggle with coding, but I'm a great UX/UI Designer and Community Manager with extraordinary communication skills, not writing obviously, maybe not in anything, really, but who cares about me or my opinion anyway.

Hopefully one day I'll be in the position to do some good, because I will never forget what it means to be poor and helpless.

That's why I'm asking questions online, to find some hope in my daily misery, hoping that somebody will notice and help me unleash my potential.

The only question I really have is:

What's a good entry level job for web3 development or even better if somebody would reach out to me, because I'm lost, totally lost.


Thanks to everybody that is contributing to make open-source software possible.
Apparently I still manage to offend people, even while trying to be as empathic as possible and search/try to learn before posting.
I love y'all.

Offline

#4 2023-02-22 13:33:18

seth
Member
Registered: 2012-09-03
Posts: 50,008

Re: [SOLVED] symbols in ~/.xintirc pass shell commands to st ?

What I meant is, what do you actually want to achieve w/

in case you would want to see the output of ls -lah in st in dwm

Afaiu that's only an example and typically such turns out to be an https://en.wikipedia.org/wiki/XY_problem

Online

#5 2023-02-23 09:42:26

archisominimalist
Member
Registered: 2023-02-11
Posts: 22

Re: [SOLVED] symbols in ~/.xintirc pass shell commands to st ?

st -e /bin/bash -c "ls -lah; exec /bin/bash"

But I would love to understand the underlying concept.
The necessity of using the correct vocabulary in order to be able to ask a question is a paradox.
Paradox:
Since you can't learn without reading, and in terms of computer science you can't find what to read without finding a good source first #1 the student is limited by his own ability to ask a question, but unable to ask a question due to the lack of vocabulary.
#1while a bad source will ruin your perspective on things [for example only knowing windows GUI Filemanager versus mv cp mkdir ...]

Visual Example:

 $ ./script.sh "$1,2,3" 

$0 ~/.xinitrc
$1 executed
$2 VT
$3 shell

The $0 is $1 and the output visible in the $2 because $0 is $1 in the $3

Now if you replace the variables with the correct words that you have over the course of your life symlinked to create a workflow therefore use the computer in front of you efficiently, if I would be able to understand that, then I would not need to ask questions, and in return you would not question that this is the actual perfect solution.


Thanks to everybody that is contributing to make open-source software possible.
Apparently I still manage to offend people, even while trying to be as empathic as possible and search/try to learn before posting.
I love y'all.

Offline

#6 2023-02-23 12:45:31

seth
Member
Registered: 2012-09-03
Posts: 50,008

Re: [SOLVED] symbols in ~/.xintirc pass shell commands to st ?

But I would love to understand the underlying concept.

This starts st and makes it execute a transient bash script which first runs "ls -lah" and then replaces itself w/ an interactive shell.

Online

Board footer

Powered by FluxBB