You are not logged in.

#1 2021-12-16 22:17:12

savantshuia
Member
Registered: 2021-12-15
Posts: 5

[SOLVED] st won't launch + text clipping issue in dwm bar

I'm running arch in Oracle VM VirtualBox
and I am using dwm as my wm with st as my terminal emulator and dmenu

I changed the following line (line 22) in config.h for st

 char *scroll = NULL;

to

char *scroll = "scroll";

as the comment in line 21 states

/* scroll program: to enable use a string like "scroll" */

Now when I do super+shift+enter st doesn't launch but sometime I see the word st being shown on dmenu as if it was being launched, from dmenu I tried typing st and pressing enter but that does not do anything.

I know I will have to fix this by logging in as root but I don't know what to do apart from cloning st from github again and running sudo make clean install.

edit: I have a clone with dwm and dmenu so I can just switch to that, but I want to figure out whats wrong with this one
        Also my dwm has clipping but the clone does not, so if somebody could help with that too I would be super grateful
       
        Clipping (current VM)
        https://imgur.com/qo3HzKG.png
       
        No clipping (clone VM)
        https://imgur.com/uqqPExp.png

moderator edit -- replaced oversized images with links.
Pasting pictures and code

Last edited by savantshuia (2022-02-21 18:43:47)

Offline

#2 2021-12-17 00:00:26

savantshuia
Member
Registered: 2021-12-15
Posts: 5

Re: [SOLVED] st won't launch + text clipping issue in dwm bar

It appears that logging in as root and changing back

char *scroll = "scroll";

to

char *scroll = NULL;

and running sudo make clean install
has fixed the problem, but I still want to be able to scroll up in terminal when I cat long files or a command has a long output, so how do I do that (If it's something super obvious then just give me the link or redirect me somewhere)?

btw I figured out the st issue by breaking my clone in the same way by changing

NULL

to

"scroll"

and then fixing it by logging in as root.

Also I still have no idea why the dwm bar text is getting clipped off at the very top, I'll give information you need to help but the clipping is honestly quite annoying and looks horrible.

Last edited by savantshuia (2021-12-17 00:03:10)

Offline

#3 2021-12-17 01:38:34

lmn
Member
Registered: 2021-05-09
Posts: 92
Website

Re: [SOLVED] st won't launch + text clipping issue in dwm bar

Do you have scroll installed?

Offline

#4 2021-12-17 08:37:13

savantshuia
Member
Registered: 2021-12-15
Posts: 5

Re: [SOLVED] st won't launch + text clipping issue in dwm bar

lmn wrote:

Do you have scroll installed?


I downloaded the scrollback patch and did the following

patch --merge -i st-scrollback-0.8.4.diff

but I got this merge error

patching file config.def.h
patching file st.c
Hunk #4 NOT MERGED at 194-203.
patching file st.h

This was on a fresh clone of st with just the font size changed

How do I resolve this merge error?

lines 194-203 are these lines in config.h:

	{ TERMMOD,              XK_Prior,       zoom,           {.f = +1} },
	{ TERMMOD,              XK_Next,        zoom,           {.f = -1} },
	{ TERMMOD,              XK_Home,        zoomreset,      {.f =  0} },
	{ TERMMOD,              XK_C,           clipcopy,       {.i =  0} },
	{ TERMMOD,              XK_V,           clippaste,      {.i =  0} },
	{ TERMMOD,              XK_Y,           selpaste,       {.i =  0} },
	{ ShiftMask,                 XK_Insert,      selpaste,       {.i =  0} },
	{ TERMMOD,              XK_Num_Lock,    numlock,        {.i =  0} },
};

edit:


sorry sorry hmm I read the notes in the patch page: Patches modify config.def.h, you need to add mkeys to your own config.h
that's a lesson to always read error messages carefully before hopping on a forum and asking for help, my bad! tongue


for anyone who finds this post, encountering the same problem all you have to do is download the .diff file, patch it using

 patch -p1 < path_to_patch.diff 

for this specific scrollback patch since it only affects config.def.h (and st.c) and not config.h you have to delete config.h after applying the patch and run smci (just an alias I use for sudo make clean install) and everything worked in my case

note: if you have heavily patched your program, the patching may fail and you will have to manually patch it, I don't have much experience with that but all I will say is it is certainly beneficial if you know how to read c code, because the error tells you what lines it failed to merge and you will have to manually edit/remove/change those lines, the edits will be different depending on your case


Now all I can't figure out by myself is the clipping issue in dwm, if anyone could help me with that I'd be very happy smile

Last edited by savantshuia (2021-12-17 09:20:46)

Offline

#5 2022-02-21 18:40:15

savantshuia
Member
Registered: 2021-12-15
Posts: 5

Re: [SOLVED] st won't launch + text clipping issue in dwm bar

Very Simple Solution Actually

This was actually just a ricing issue but it still stumped me for too long.

Figured it out after installing Arch on bare metal with Windows 10 dual booted but the fix will work in VM's too if anyone is looking this up.

All you have to do is change your font to your font to a suitable one , I went with "Source Code Pro" in my case use

fc-list

to list installed fonts or install fonts

My previous font (and the default dwm, dmenu and st font btw) was "Liberation Mono" and now it is "Source Code Pro"

How to change the fonts:
Previous font was "Liberation Mono" and now it is "Source Code Pro"
in ~/dwm/config.h

static const char *fonts[]          = {"Source Code Pro:pixelsize=40:antialias=true:autohint=true"}
static const char dmenufont[]       = "Source Code Pro:pixelsize=40:antialias=true:autohint=true";

in ~/dmenu/config.h

static const char *fonts[] = {
"Source Code Pro:pixelsize=40:antialias=true:autohint=true";
};

in ~/st/config.h

static char *font = "Source Code Pro:pixelsize=40:antialias=true:autohint=true";

Here is how my desktop looks now:
Desktop Screenshot
My wallpaper of Makise Kurisu in case you are interested, she is ofc my waifu(irrelevant to anything btw) tongue

Offline

Board footer

Powered by FluxBB