Dr-Terrible / ineluctable-overlay

Ineluctable Overlay offers a repository of Gentoo ebuilds for projects that I am interested in, or are not yet available through Portage tree.
GNU General Public License v2.0
11 stars 4 forks source link

[Question] Custom shortcut on Termite #7

Closed bpinto closed 7 years ago

bpinto commented 7 years ago

Termite has builtin shortcuts but they are set on compilation time and are hard coded.

Is there any way you can think of that would allows us to apply a custom patch that I have on my computer while reusing the ebuild from your overlay in car I want to modify the shortcuts?

Dr-Terrible commented 7 years ago

Is there any way you can think of that would allows us to apply a custom patch that I have on my computer while reusing the ebuild from your overlay in car I want to modify the shortcuts?

Sure, emerge has a way to let users apply patches during the src_prepare phase without modifying the ebuild itself; x11-terms/termite needs to be adjusted here and there, but it's technically feasible.

Just give me some time to dig up the doc and see what needs to be done, because the last time I used that feature was 10 years ago :)

Dr-Terrible commented 7 years ago

You're lucky, here is the doc. The process is far far more simpler than 10 years ago :D

No modifications are required for x11-terms/termite; all you need to do is to put your patch set inside the directory /etc/portage/patches/x11-terms/termite and re-install the package. emerge should be able to automatically pick up your patches during the src_prepare phase.

Most probably you need to refactor your patches to make them suitable for Portage EAPI=6, which means that all the patches must be absolute paths to the ${WORKDIR}/${P} directory. For example, if you need to patch the file /var/tmp/portage/${CATEGORY}/${P}/work/${P}/foo, then the front matter of your patch must be like this:

--- /foo 2014-08-08 18:14:52.000000000 +0200
+++ /foo 2016-11-25 14:08:05.000000000 +0100
@@ -1,4 +1,4 @@

Instead, something like this:

--- /a/foo 2014-08-08 18:14:52.000000000 +0200
+++ /b/foo 2016-11-25 14:08:05.000000000 +0100
@@ -1,4 +1,4 @@

will never applies.

If you need help, feel free to ask ;)

bpinto commented 7 years ago

Thank you so much for the thorough explanation. I'm going to work on this patch and then share it here in case others have interest too.

Dr-Terrible commented 7 years ago

I'm going to work on this patch and then share it here in case others have interest too.

I, for sure, I'm going to need that patch when I have completed the transition from i3 to Sway. Feel free to share it 😄.

bpinto commented 7 years ago

Why is that? What have changed?

I think I'm going to work on a "custom" solution for handling application-specific shortcuts on i3... I couldn't find an existing solution I could use for that.

I did find autokey-py3 (recently renamed to autokey) but there is no ebuild and it comes with either gtk or qt... I'm not sure I need a GUI for what I need... might be overkill.

bpinto commented 7 years ago

I have considered to use i3 IPC interface. There is a go library but it's no longer maintained, I might use the rust version instead.

bpinto commented 7 years ago

Okay, my copy and paste shortcut does not interfere with any of the builtin shortcuts so I could add a new one instead of replacing it.

Link to the patch: https://github.com/bpinto/dotfiles/commit/8dc231859f4c7ffb1a8e8c5bbd01eb19c58c16e7

Dr-Terrible commented 7 years ago

Why is that? What have changed?

I'm replacing i3 with sway, so I can use Wayland everywhere and ditch Xorg. Termite is the last missing piece for finalizing that transition, so I can step away from gnome-terminal too and remove a bunch of Gnome3 dependencies from my system. Unfortunately, Termite built-in short-cuts are conflicting with my sway set-up — and several other short-cuts from the apps I use every days; hence I'll use your patch as a starting point for my key-binding customization. I have low expectations for this solution, but at least it's easier and quicker rather than using i3's IPC interface (which at the moment is not available under Wayland).

I did find autokey-py3 (recently renamed to autokey) but there is no ebuild [...]

Actually, there is an ebuild. As an alternative, there is also sxhkd.

I have considered to use i3 IPC interface. There is a go library but it's no longer maintained, I might use the rust version instead.

It's my last resort too. I'm going with the Go lib, and in case I'll rewrite the one no longer maintained since I'm building my own Wayland tiling compositor written in Go just for the fun.

Link to the patch: bpinto/dotfiles@8dc2318

Thank you for sharing. This is going to save me some time.

bpinto commented 7 years ago

I'm replacing i3 with sway, so I can use Wayland everywhere and ditch Xorg.

:heart: I'm going this direction soon. I just need to get my gentoo stable (as in personal modifications).

I have low expectations for this solution, but at least it's easier and quicker rather than using i3's IPC interface (which at the moment is not available under Wayland).

Yeah, I was looking into this yesterday and apparently it doesn't support window events yet, which is the one I'm going to use. :(

Actually, there is an ebuild. As an alternative, there is also sxhkd.

The ebuild seems outdated, and it would require me to install gtk or qt dependencies... I'd like to avoid unnecessary dependencies as much as I can.

I think I'm going to use i3 modes instead of sxhkd, not 100% yet.

It's my last resort too. I'm going with the Go lib, and in case I'll rewrite the one no longer maintained since I'm building my own Wayland tiling compositor written in Go just for the fun.

My friend helped me to get the C++ version working yesterday, but apparently it doesn't support latest message format, might be a small fix. If you ever start maintaining the Go version, let me know, I would use that.

Wayland tiling compositor written in go!? Could you say anything else in the same phrase that I'd love to have? :D

Thank you for sharing. This is going to save me some time.

I hope so!

Dr-Terrible commented 7 years ago

❤️ I'm going this direction soon. I just need to get my gentoo stable (as in personal modifications).

BTW, I just pushed a new bump release for x11-misc/termite which adds the configuration option client_side_decoration for enabling/disabling GTK3 CSD: https://bug776290.bugzilla-attachments.gnome.org/attachment.cgi?id=342245

Wayland tiling compositor written in go!? Could you say anything else in the same phrase that I'd love to have? :D

It's just an experiment, but I'm planning to provide thread-safe RESTful APIs instead of IPC-ish interfaces that block, and it will be way more simpler than i3 code base because it will use Enlightenment's concept of surfaces instead of i3's screen layouts; lastly, it will use Go's native plugins :D