Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powermenu: allow typing in addition to selecting buttons #156

Open
rixx opened this issue Oct 14, 2023 · 0 comments
Open

Powermenu: allow typing in addition to selecting buttons #156

rixx opened this issue Oct 14, 2023 · 0 comments

Comments

@rixx
Copy link

rixx commented Oct 14, 2023

Idk if this is something you want, but I kinda like not having to click things, so I took your (awesome!) powermenu and modded it to support typing in what you want to do (eg "lock", "hib", etc). Just wanted to document it here, so feel free to close if you're not interested (but if you are, feel free to copy or tell me to open a PR).

What I did: Switched to using icons rather than nerd code font, and put the strings to be matched in the text options (and then hide the text, so that only the icons are visible). In order to make things non-ugly, I hide the typing input, so you can't see what you're typing, but for something this simple, I feel like that's fine.

Full script and theme, but the relevant parts are:

# Options include strings for fast selection, but only icons will be shown
option_1="shutdownpoweroff"
option_2="reboot"
option_3="logoutexit"
option_4="suspendsleephibernate"
option_5="lock"
yes='yes'
no='no'

icon_1="\0icon\x1fsystem-shutdown"
icon_2="\0icon\x1fsystem-reboot"
icon_3="\0icon\x1fgnome-logout"
icon_4="\0icon\x1fgnome-session-hibernate"
icon_5="\0icon\x1flock"
icon_yes="\0icon\x1fdialog-ok"
icon_no="\0icon\x1fdialog-cancel"

and

chosen="$(echo -e "$option_1$icon_1\n$option_2$icon_2\n$option_3$icon_3\n$option_4$icon_4\n$option_5$icon_5" | rofi \
	…etc

Anyway, tysm for this collection of themes, I learned a lot about rofi while mixing and matching them into something to suit me – really cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant