Re: [dev] [dwm] swallow without patching dwm -- or losing focus

2023-05-26 Thread Spenser Truex
On 23/05/26 11:07AM, v4hn wrote:
> On Fri, May 26, 2023 at 02:50:20AM -0300, Spenser Truex wrote:
> > I just want my windows to open where I opened
> > them. There is no kitchen sink included.
>
> I would like that too, but the linked project doesn't do it.
> It doesn't even work when ran through `dmenu`, but instead hides/unhides
> whatever window you focused before you opened dmenu. :)

That's true, sorry I was unclear. That's what I'm trying to do with it.
I think it can be done with a POSIX queue.
>
>
> v4hn
>
> --
> Michael 'v4hn' Görner, M.Sc. Cognitive Science, Research Associate
> Universität Hamburg
> Faculty of Mathematics, Informatics and Natural Sciences
> Department of Informatics
> Group Technical Aspects of Multimodal Systems
>
> Vogt-Kölln-Straße 30
> D-22527 Hamburg
>
> Room: F-315
> Phone: +49 40 42883-2432
> Website: https://tams.informatik.uni-hamburg.de/people/goerner/



-- 
CAEE B377 FC82 BAF9 102C  D22F C5CE D003 1AA8 E281
Spenser Truexhttps://equwal.com


signature.asc
Description: PGP signature


Re: [dev] [dwm] swallow without patching dwm -- or losing focus

2023-05-26 Thread Santtu Lakkala
On 26.5.2023 9.19, NRK wrote:> `system` is a function that should never 
be used unless the person is

aware of all the shell shenanigans that can bite back. The above is an
extreme example, but *any* character that has special meaning to shell
can cause problems.

You should instead look into exec and/or posix_spawn functions before
going any further.


Yes, this, system() is most of the time both the wrong way and the hard 
way. Created a PR[0] to demonstrate how to use posix_spawnp() instead.


Also, as a sidenote; there is no C--, there's nothing -- about C.

[0]: https://github.com/equwal/swallow-c--/pull/2

--
Santtu



Re: [dev] [dwm] swallow without patching dwm -- or losing focus

2023-05-26 Thread v4hn
On Fri, May 26, 2023 at 02:50:20AM -0300, Spenser Truex wrote:
> I just want my windows to open where I opened
> them. There is no kitchen sink included.

I would like that too, but the linked project doesn't do it.
It doesn't even work when ran through `dmenu`, but instead hides/unhides
whatever window you focused before you opened dmenu. :)


v4hn

-- 
Michael 'v4hn' Görner, M.Sc. Cognitive Science, Research Associate
Universität Hamburg
Faculty of Mathematics, Informatics and Natural Sciences
Department of Informatics
Group Technical Aspects of Multimodal Systems

Vogt-Kölln-Straße 30
D-22527 Hamburg

Room: F-315
Phone: +49 40 42883-2432
Website: https://tams.informatik.uni-hamburg.de/people/goerner/


signature.asc
Description: PGP signature


Re: [dev] [dwm] swallow without patching dwm -- or losing focus

2023-05-26 Thread NRK
On Thu, May 25, 2023 at 07:42:04PM -0300, Spenser Truex wrote:
> I converted this swallow program to C, not that it makes any difference
> at this code size. It's just a couple of malloc'd strings.
> 
> https://github.com/equwal/swallow-c--

$ ./swallow '$(rm -fr $HOME)'

`system` is a function that should never be used unless the person is
aware of all the shell shenanigans that can bite back. The above is an
extreme example, but *any* character that has special meaning to shell
can cause problems.

You should instead look into exec and/or posix_spawn functions before
going any further.

- NRK



Re: [dev] [dwm] swallow without patching dwm -- or losing focus

2023-05-25 Thread Spenser Truex
On 23/05/26 07:24AM, Sagar Acharya wrote:
> Beautiful code. As a rookie user, how will this code be used? Can this be a 
> complete Xenocara/Xorg alternative?
> Thanking you

A very humourous response. I just want my windows to open where I opened
them. There is no kitchen sink included.

It is used like this

./swallow mpv

cheers

> Sagar Acharya
> http://humaaraartha.in 
>
>
>
> 26 May 2023, 05:45 by tr...@equwal.com:
>
> > Greetings,
> >
> > I converted this swallow program to C, not that it makes any difference
> > at this code size. It's just a couple of malloc'd strings.
> >
> > https://github.com/equwal/swallow-c--
> >
> > I'd like to make it actually transfer the terminal's focus rather than
> > async open and hide itself. That way you get the program you opened in the
> > tag you opened it in, which is something I've been trying to do for a
> > long time in multiple window managers.
> >
> > The author pointed out that "startup hooks" can do this in some window
> > managers, but I like the idea of not even having that be part of the WM
> > itself.
> >
> >
> > --
> > CAEE B377 FC82 BAF9 102C  D22F C5CE D003 1AA8 E281
> > Spenser Truexhttps://equwal.com
> >
>

-- 
CAEE B377 FC82 BAF9 102C  D22F C5CE D003 1AA8 E281
Spenser Truexhttps://equwal.com


signature.asc
Description: PGP signature


Re: [dev] [dwm] swallow without patching dwm -- or losing focus

2023-05-25 Thread Sagar Acharya
Beautiful code. As a rookie user, how will this code be used? Can this be a 
complete Xenocara/Xorg alternative?
Thanking you
Sagar Acharya
http://humaaraartha.in 



26 May 2023, 05:45 by tr...@equwal.com:

> Greetings,
>
> I converted this swallow program to C, not that it makes any difference
> at this code size. It's just a couple of malloc'd strings.
>
> https://github.com/equwal/swallow-c--
>
> I'd like to make it actually transfer the terminal's focus rather than
> async open and hide itself. That way you get the program you opened in the
> tag you opened it in, which is something I've been trying to do for a
> long time in multiple window managers.
>
> The author pointed out that "startup hooks" can do this in some window
> managers, but I like the idea of not even having that be part of the WM
> itself.
>
>
> -- 
> CAEE B377 FC82 BAF9 102C  D22F C5CE D003 1AA8 E281
> Spenser Truexhttps://equwal.com
>



[dev] [dwm] swallow without patching dwm -- or losing focus

2023-05-25 Thread Spenser Truex
Greetings,

I converted this swallow program to C, not that it makes any difference
at this code size. It's just a couple of malloc'd strings.

https://github.com/equwal/swallow-c--

I'd like to make it actually transfer the terminal's focus rather than
async open and hide itself. That way you get the program you opened in the
tag you opened it in, which is something I've been trying to do for a
long time in multiple window managers.

The author pointed out that "startup hooks" can do this in some window
managers, but I like the idea of not even having that be part of the WM
itself.


-- 
CAEE B377 FC82 BAF9 102C  D22F C5CE D003 1AA8 E281
Spenser Truexhttps://equwal.com


signature.asc
Description: PGP signature