Commit Graph

3 Commits

Author SHA1 Message Date
Kasper 6e4ecb334c
Improved icon theme helper (#144)
* Small refactor for the get_client_icon_path function

* Try to match first by icon name and then by class

* Formatting

* It's dashes

* Use methods

* Why check it every loop?

* Try to get icon by the retriving the command from the pid

* Split into multiple functions

* No newline at eof

* Remove empty line

* Gets only the process name instead of the full command

* Double quotes everywhere

* I don't need pattern matching

* I want the executable

* Check if pid is nil

* Use client icon if not found

* Class can be nil for some clients too?

* Check for nil values

* Lgi doesn't work with gtk 4.0

* Fix class being nil

* client.icon can be nil as well
2022-05-11 18:28:32 +03:00
Kasper e4fd438e3e
More app launcher improvements (#132)
* Make sure there is always a default icon

* Use get_example_icon_path to get the default icon

* Refactor scrolling to add support for left and right scrolling

* fixup! Make sure there is always a default icon

* Fix calculation happening at the wrong time

* Fix default icons again

* Where did that come from?

* Fix calculation happening at the wrong time for scroll_up as well

* Fix error on scroll right when scrolling to page where amount of rows is smaller than the selected row

* Sort search results by string similarity

* Don't sort by similarity when the search string is empty

* Add hover effects

* try_to_keep_index_after_searching should be false by default

* This should only trigger for lmb

* Add an option to hide the app launcher when clicked with lmb/rmb outside of it

* Use gtk-launch so terminal apps spawn correctly

* Use get_executable instead of get_commandline

* Add an option to set the hover colors

* Further improvements for the spawn function

* Fix scrolling/searching errors when there app list is empty

* This should never be nil anyway

* whitespace

* Refactor show, hide and toggle method + remove support for manually setting x an y (use placement)

* Add arguements for custom icon_theme (defaults to the selected system gtk theme) and icon_size (defaults to 48)

* Pass the app table instead of individual keys to create_app_widget

* Add an arguement to pass the default terminal for terminal apps as gtk-launch only uses xterm

* Reformating

* Rename 'mark_app' and 'unmark_app' to 'select_app' and 'unselect_app'

* Call :hide() from app.spawn() to avoid calling hide() twice on some cases

* Fix escape not closing the launcher after b7e44ec4

* Reduce code duplication and only reset the launcher when the animation is over (if not nil)

* Set active_widget to nil when the grid is empty to prevent from spawning the wrong app

* Override the default exe_callback

* Override the default behaviour for 'Return' via hooks instead because overriding only exe_callback still doesn't stop it from pausing the prompt keygrabber

* Set active_widget to nil on unselect

* Unselect previous app on search to avoid from spawning it when the grid is empty

* Use double quotes for everything
2021-11-05 05:38:54 +02:00
Gokul Swaminathan 274df77bba Minor edits for the icon_theme and app_launcher PR 2021-11-03 14:44:03 -07:00