bakkeby / st-flexipatch

An st build with preprocessor directives to decide which patches to include during build time
MIT License
347 stars 107 forks source link

help,Changing the shell doesn't work #95

Closed kimuxer closed 1 year ago

kimuxer commented 1 year ago

I have set shell in config.def.h, static char *shell = "/bin/fish"; or static char *shell = "/usr/bin/fish"; or static char *shell = "/sbin/fish";

Delete config.h and compile the installation, But the shell is still bash after running st. Where is my setting wrong?

I don't want to use chsh to change the shell, my ly login manager seems to not support fish. If I use chsh to set fish as the default shell, ly can't log in to the desktop

list of my patches

ALPHA_PATCH
ALPHA_FOCUS_HIGHLIGHT_PATCH
ANYSIZE_SIMPLE_PATCH
BOLD_IS_NOT_BRIGHT_PATCH
BOXDRAW_PATCH
CLIPBOARD_PATCH
DELKEY_PATCH
FONT2_PATCH
HIDECURSOR_PATCH
HIDE_TERMINAL_CURSOR_PATCH
LIGATURES_PATCH
SCROLLBACK_PATCH
SCROLLBACK_MOUSE_PATCH
SCROLLBACK_MOUSE_ALTSCREEN_PATCH
SIXEL_PATCH
USE_XFTFONTMATCH_PATCH
VERTCENTER_PATCH
WIDE_GLYPHS_PATCH
XRESOURCES_PATCH
XRESOURCES_RELOAD_PATCH
bakkeby commented 1 year ago

Not relevant to this but config.def.h is the default configuration that comes with the software, your personal configuration goes into config.h. If you make changes to config.def.h then that is only going to create conflicts down the road.

As for why changing this setting in st doesn't work for you; have you checked that you do not define a shell in your .Xresources file?

shell: /bin/bash

If you have that and you intentionally want this to be different and st to not pick this up then you can remove the corresponding line in the resources array: https://github.com/bakkeby/st-flexipatch/blob/a8e2af0d923e7b6f7b19e8fa516bcd0670dfae84/config.def.h#L308

kimuxer commented 1 year ago

thanks for your reply Don't worry about me messing up config.def.h and config.h, I'm used to editing config.def.h instead of config.h, and I delete config.h before compiling every time. :)

I don't yet have a .Xresources file, Later I will create .Xresources ,but just want to use the .Xresources file to set the unified color matching of dwm, st, and dmenu

I'll try to remove { "shell", STRING, &shell },

have a nice day

kimuxer commented 1 year ago

I just tried it out and re-clone a copy Only set static char *shell = "/bin/fish"; , other codes keep the default, there is no .Xresources file

Run st, still in bash

Then I comment out { "shell", STRING, &shell }, and compile and run again, the shell is still bash

bakkeby commented 1 year ago

Maybe see https://www.reddit.com/r/suckless/comments/o8s442/changing_the_priorities_of_selecting_the_shell_in/

There are apparently several layers of precedence before it uses that shell variable.

kimuxer commented 1 year ago

Actually, I did the same steps as him yesterday...lol But my knowledge of C language is pitiful I'll experiment with modifying the source code I remember about a few years ago, you can simply modify the config.h file to get the same effect. At that time, I saw a video saying that he used dash as the default shell, and set the fish task interactive shell in st

kimuxer commented 1 year ago

I remember wrong, it is to modify dwm's config.h

static const char *termcmd[] = { "st", "-e", "fish", NULL };

now it's ok

bakkeby commented 1 year ago

I wonder if having a SHELL environment variable set in your .profile file will make any difference in your case.

E.g.

export SHELL=/bin/fish

I checked and for me it is determined by such an environment variable, not what I have in that shell config or .Xresources file (which in practice just changes the value of that shell variable).

kimuxer commented 1 year ago

sorry for my bad english, i don't quite understand you I set export SHELL=/bin/fish, but only the value of SHELL changes to /bin/fish, and the default shell of st is still bash

But it doesn't matter, static const char *termcmd[] = { "st", "-e", "fish", NULL }; works for me

I figured I shouldn't take your time on this little question. I recently discovered wezterm, and in the process of configuring it, I thought I'd probably give wezterm a preference, with st as a second choice. Thanks again for your help, your project is amazing for me, I really like dwm, but too many patches are a huge disaster for me :)

bakkeby commented 1 year ago

too many patches are a huge disaster for me :)

lol, it is a huge disaster for me as well.

I'll have a look at wezterm.