Skip to content

RoundUpSSBM/Hyprfoci

 
 

Repository files navigation

Hyprfoci (Hyprland Focus Indicator)

A tiny Hyprland plugin that draws a single, always-visible dot in the corner of the screen whenever any window has input focus.

Why?

I'm not a fan of border/dim/opacity in general, so having an a dot as indicator helps my case. So the overall use cases:

  • You run a borderless or minimal border setup.
  • You are blind like me and lose track of which window is currently focused.
  • Subtle, non-intrusive visual cue without all the giant borders, window titles, just a dot.
  • Now also support png images.

Bongocat tho, that thing invalidated everything I said above.

Demo (bongo)

output.mp4

Demo

demo.mp4

Installation

Requirement

  • Newest Hyprland.
  • Meson, cmake and a C++ compiler. (usually already builtin if you use hyprland)

Build from source

git clone https://github.com/pohlrabi404/Hyprfoci
cd Hyprfoci
make all

then add it to hyprland:

hyprctl plugin load /dir/to/hyprfoci.so

change load to unload to remove the plugin

Config

Typing Bongocat! [NEW]

Now you can have cute bongocat! Copy the bongo dir that has images in there to your prefered location and set plugin:hyprfoci:imgs accordingly

plugin {
	hyprfoci {
		# can be from -1 to 1, will be
			# dynamic ratio with the window instead.
			# recommend fixed size for image as dynamic can look weird
			# leave one as 0 to keep original image ratio (image only)
		# width, height
		size = 100, 0 			

		# shift down right (can be from -1 to 1, similarly)
		pos = 0, 0

		#0: left/top, 1: middle, 2: down/right
		origin = 1, 0 

        # path to a directory with both.png, left.png, right.png
		# Absolute path is needed (~ for home directory is fine)
		imgs = /path/to/your/imgs
	}
}
# can also disable/enable with windowrule!
windowrule = plugin:hyprfoci:enabled 0, class:kitty

Simple dot or png

Add the following to your Hyprland.conf for normal configuration with dot or png

plugin {
	hyprfoci {
		# can be from -1 to 1, will be
			# dynamic ratio with the window instead.
			# recommend fixed size for image as dynamic can look weird
			# in some cases.
			# leave one as 0 to keep original image ratio (image only)
		# width, height
		size = 100, 0 			

		# shift down right (can be from -1 to 1 similarly)
		pos = 0, 0

		# rounding of 3~4 usually results in circle
			# depends on monitor type
			# higher and lower will make it look square-ly
			# doesn't affect image
		rounding = 4.0

		# color = rgba(FFDD33FF)

		#0: left/top, 1: middle, 2: down/right
		origin = 1, 0 

		# Absolute path is needed (~ for home directory is fine)
		img = /path/to/your/image.png
        
        # can also exclude specific windows!
        exclude = kitty, firefox        
	}
}

TODO

  • main functionalities
  • can now have a cute bongocat typing with you!
  • add config options
    • size, color, position
    • more position origins (top left, top middle, etc)
    • support for png
    • animation
    • window title as focus indicator
    • option to disable indicator when there is only 1 window (not sure if I want it lol)
  • maybe something else

Contribute

PRs are welcome~

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 94.2%
  • Meson 4.6%
  • Makefile 1.2%