Looking for a segment of neofetch [SOLVED]
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Looking for a segment of neofetch [SOLVED]
Hello all,
My neofetch displays on my terminal a Windows Manager field, populated with the value:
WM: Mutter (Muffin)
Does anyone know the script neofetch uses to display this?
Thank you,
Logan
My neofetch displays on my terminal a Windows Manager field, populated with the value:
WM: Mutter (Muffin)
Does anyone know the script neofetch uses to display this?
Thank you,
Logan
Last edited by Logansfury on Wed Mar 20, 2024 9:34 am, edited 1 time in total.
Re: Looking for a segment of neofetch
It depends on your system. In your case it is likely it uses
In the neofetch script itself it is determined in the function
The portion that you are interested in is probably this:
I added the last line to display the result.
xprop
for it.In the neofetch script itself it is determined in the function
get_wm()
in /usr/bin/neofetch
The portion that you are interested in is probably this:
Code: Select all
id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK)
id=${id##* }
wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t)
wm=${wm/*WM_NAME = }
wm=${wm/\"}
wm=${wm/\"*}
echo "$wm"
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a segment of neofetch
Hey Vimes how are you?vimes666 wrote: ⤴Wed Mar 20, 2024 8:34 am It depends on your system. In your case it is likely it usesxprop
for it.
In the neofetch script itself it is determined in the functionget_wm()
in/usr/bin/neofetch
The portion that you are interested in is probably this:I added the last line to display the result.Code: Select all
id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK) id=${id##* } wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t) wm=${wm/*WM_NAME = } wm=${wm/\"} wm=${wm/\"*} echo "$wm"
That displays exactly what I want it to!
I wanted to use this in conky, can it be done in one line?
Last edited by Logansfury on Wed Mar 20, 2024 9:34 am, edited 1 time in total.
Re: Looking for a segment of neofetch
I dont know about conky but this may do it (as one line):
Code: Select all
id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK) && id=${id##* } && wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t) && wm=${wm/*WM_NAME = } && wm=${wm/\"} && wm=${wm/\"*} && echo "$wm"
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a segment of neofetch
My conky is displaying the WM info perfectly!vimes666 wrote: ⤴Wed Mar 20, 2024 9:33 am I dont know about conky but this may do it:Code: Select all
id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK) && id=${id##* } && wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t) && wm=${wm/*WM_NAME = } && wm=${wm/\"} && wm=${wm/\"*} && echo "$wm"
Thank you for taking the time to help
Re: Looking for a segment of neofetch [SOLVED]
But you could also use
instead
Code: Select all
neofetch wm
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a segment of neofetch [SOLVED]
I see! It needs editing for conky however, it's displaying as "wm: Mutter (Muffin)" and I need just "Mutter (Muffin)"vimes666 wrote: ⤴Wed Mar 20, 2024 9:40 am But you could also useinsteadCode: Select all
neofetch wm
- Logansfury
- Level 6
- Posts: 1237
- Joined: Fri Oct 27, 2023 4:08 pm
- Location: Las Vegas NV, USA
Re: Looking for a segment of neofetch [SOLVED]
Got it!!Logansfury wrote: ⤴Wed Mar 20, 2024 9:47 amI see! It needs editing for conky however, it's displaying as "wm: Mutter (Muffin)" and I need just "Mutter (Muffin)"vimes666 wrote: ⤴Wed Mar 20, 2024 9:40 am But you could also useinsteadCode: Select all
neofetch wm
Code: Select all
neofetch wm | awk -F ': ' '{print $2}'
Re: Looking for a segment of neofetch [SOLVED]
Then use this:
Code: Select all
a=$(neofetch wm) && echo "${a#* }"
Re: Looking for a segment of neofetch [SOLVED]
Ok you got it now