{"id":13407504,"url":"https://github.com/jluttine/rofi-power-menu","last_synced_at":"2025-04-05T08:03:49.957Z","repository":{"id":39856185,"uuid":"253220967","full_name":"jluttine/rofi-power-menu","owner":"jluttine","description":"Configurable power menu mode for Rofi and dmenu","archived":false,"fork":false,"pushed_at":"2024-06-06T01:08:56.000Z","size":104,"stargazers_count":412,"open_issues_count":19,"forks_count":53,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-07-31T20:27:32.020Z","etag":null,"topics":["dmenu","dmenu-scripts","power-menu","rofi","rofi-mode","rofi-scripts"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jluttine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-05T11:41:06.000Z","updated_at":"2024-07-24T19:44:46.000Z","dependencies_parsed_at":"2024-01-16T15:44:55.264Z","dependency_job_id":"ca535663-42f6-414f-9a2d-01cf1ab1e48c","html_url":"https://github.com/jluttine/rofi-power-menu","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jluttine%2Frofi-power-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jluttine%2Frofi-power-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jluttine%2Frofi-power-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jluttine%2Frofi-power-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jluttine","download_url":"https://codeload.github.com/jluttine/rofi-power-menu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305932,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dmenu","dmenu-scripts","power-menu","rofi","rofi-mode","rofi-scripts"],"created_at":"2024-07-30T20:00:41.265Z","updated_at":"2025-04-05T08:03:49.939Z","avatar_url":"https://github.com/jluttine.png","language":"Shell","funding_links":[],"categories":["Other"],"sub_categories":[],"readme":"# Rofi Power Menu Mode\n\n\nRofi Power Menu provides a mode for offering basic power menu operations such as\nshutting down, logging out, rebooting and suspending. By default, it shows all\nchoices and asks for confirmation for irreversible actions. The choices, their\norder and whether they require confirmation, can be all configured with\ncommand-line options. It also shows symbols by default, but this requires a\nmonospace font with good support for symbols, so it can be disabled with\n`--no-symbols`.\n\nIn contrast to other similar solutions I've found, the power menu is implemented\nas a rofi mode, not as a stand-alone executable that launches rofi by itself.\nThis makes it possible to combine the script with the full power of how rofi can\nuse modi. For instance, you can have multiple modi available (`-modi`) or\ncombine multiple modi in one mode (`-combi-modi`), pass your own themes\n(`-theme`) and configurations as CLI flags (e.g., `-fullscreen`,\n`-sidebar-mode`, `-matching fuzzy`, `-location`).\n\nThere's also a stand-alone script which uses dmenu (or rofi in dmenu mode). It's\nalso a bit easier to use as you don't need to type the small amount of rofi\n\"boilerplate\".\n\nJust to give an example, the screenshot below shows Rofi Power Menu launched as:\n\n```\nrofi \\\n  -show p \\\n  -modi p:'rofi-power-menu --symbols-font \"Symbols Nerd Font Mono\"' \\\n  -font \"JetBrains Mono NF 16\" \\\n  -theme Paper \\\n  -theme-str 'window {width: 8em;} listview {lines: 6;}'\n```\n\n![Screenshot of Rofi Power Menu](./screenshot.png)\n\n\n## Install\n\nYou can use the script directly from this directory without needing to install\nit at all. If you want rofi to find it more easily, the script needs to be found\nin `PATH`. If you have `~/.local/bin` in `PATH`, you can just copy the script\nthere:\n\n```\ncp rofi-power-menu ~/.local/bin/\n```\n\n\n## Usage\n\nA simple example showing how to launch the power menu:\n\n```\nrofi -show power-menu -modi power-menu:rofi-power-menu\n```\n\nIf you didn't install the script in `PATH`, you need to give the path to the\nscript. If you're running rofi under this directory where the script is, you can\nrun it as follows:\n\n```\nrofi -show power-menu -modi power-menu:./rofi-power-menu\n```\n\n\n### `--help`\n\n```\nrofi-power-menu - a power menu mode for Rofi\n\nUsage: rofi-power-menu [--choices CHOICES] [--confirm CHOICES]\n                       [--choose CHOICE] [--dry-run] [--symbols|--no-symbols]\n\nUse with Rofi in script mode. For instance, to ask for shutdown or reboot:\n\n  rofi -show menu -modi \"menu:rofi-power-menu --choices=shutdown/reboot\"\n\nAvailable options:\n  --dry-run            Don't perform the selected action but print it to stderr.\n  --choices CHOICES    Show only the selected choices in the given order. Use /\n                       as the separator. Available choices are lockscreen,\n                       logout,suspend, hibernate, reboot and shutdown. By\n                       default, all available choices are shown.\n  --confirm CHOICES    Require confirmation for the gives choices only. Use / as\n                       the separator. Available choices are lockscreen, logout,\n                       suspend, hibernate, reboot and shutdown. By default, only\n                       irreversible actions logout, reboot and shutdown require\n                       confirmation.\n  --choose CHOICE      Preselect the given choice and only ask for a\n                       confirmation (if confirmation is set to be requested). It\n                       is strongly recommended to combine this option with\n                       --confirm=CHOICE if the choice wouldn't require\n                       confirmation by default. Available choices are\n                       lockscreen, logout, suspend, hibernate, reboot and\n                       shutdown.\n  --[no-]symbols       Show Unicode symbols or not. Requires a font with support\n                       for the symbols. Use, for instance, fonts from the\n                       Nerdfonts collection. By default, they are shown\n  --[no-]text          Show text description or not.\n  --symbols-font FONT  Use the given font for symbols. By default, the symbols\n                       use the same font as the text. That font is configured\n                       with rofi.\n  -h,--help            Show this help text.\n```\n\n\n### `--choices=CHOICE1/CHOICE2/...`\n\nBy default, the menu shows all available choices in a particular order. You can\ncontrol the shown choices and their order by using `--choices` and listing the\ndesired choices with `/` as the separator. Available choices are:\n\n- `lockscreen`: Lock screen\n- `logout`: Log out (confirmation asked by default)\n- `suspend`: Suspend\n- `hibernate`: Hibernate\n- `reboot`: Reboot (confirmation asked by default)\n- `shutdown`: Shutdown (confirmation asked by default)\n\nFor instance, to show only `shutdown` and `reboot` choices:\n\n```\nrofi -show power-menu -modi \"power-menu:./rofi-power-menu --choices=shutdown/reboot\"\n```\n\nOr if you want a typical session menu:\n\n```\nrofi -show session-menu -modi \"session-menu:./rofi-power-menu --choices=logout/lockscreen\"\n```\n\n### `--confirm=CHOICE1/CHOICE2/...`\n\nBy default, confirmation is asked for irreversible actions `logout`, `reboot`\nand `shutdown`. You can choose for which actions you want confirmation (if any)\nby listing them with `--confirm` option. For instance, confirmation can be asked\nonly for `reboot` and `shutdown`:\n\n\n```\nrofi -show power-menu -modi \"power-menu:./rofi-power-menu --confirm=reboot/shutdown\"\n```\n\nIf you don't want confirmations for any actions, just give an empty string:\n\n```\nrofi -show power-menu -modi \"power-menu:./rofi-power-menu --confirm=''\"\n```\n\n\n### `--choose=CHOICE`\n\nTo open just a confirmation dialog for some fixed choice, you can use\n`--choose=CHOICE`, where `CHOICE` can again be one of the choices listed above.\nYou should also require confirmation for that choice if that isn't done by\ndefault. For instance, a simple logout confirmation:\n\n```\nrofi -show logout -modi \"logout:./rofi-power-menu --choose=logout\"\n```\n\nFor some choices (e.g., `hibernate`), confirmation isn't asked by default, so\nyou probably want to ask that in this case:\n\n```\nrofi -show hibernate -modi \"hibernate:./rofi-power-menu --choose=hibernate --confirm=hibernate\"\n```\n\nIf confirmation isn't asked, the action is performed immediately. Although,\nthat's probably not useful, it is possible. However, note that Rofi will still\npop up a menu with no options available. It would be nice if Rofi would not\nappear at all if it wasn't given any choices. This works when running the\naccompanied stand-alone script `dmenu-power-menu`.\n\n\n### `--[no-]symbols`\n\nDisable or enable Unicode symbols/icons/glyphs. They are enabled by default. In\norder for them to show up correctly, you need a font that supports the used\nglyphs. It is recommended to use fonts from the [Nerdfonts\ncollection](https://www.nerdfonts.com/). In addition, it is recommended to use a\nmonospace font, otherwise the symbols widths might be messed up. So, for\ninstance, \"Symbols Nerd Font Mono\", \"Iosevka Nerd Font Mono\" or \"JetBrainsMono\nNF\" are good options.\n\n\n### `--dry-run`\n\nFor debugging and development purposes, you can pass `--dry-run` flag. Then, the\nselected action isn't performed but only printed to stderr.\n\n\n### dmenu\n\nThere's a stand-alone script `dmenu-power-menu` that can be used to run the\npower menu with dmenu (or rofi in dmenu mode if dmenu isn't found). That script\ntakes the same command-line arguments as listed above for the main script\n`rofi-power-menu`. The stand-alone script might be easier to use but you cannot\npass arguments to dmenu/rofi so their configuration is hardcoded. Also, you need\nto install\n[rofi-script-to-dmenu](https://github.com/jluttine/rofi-script-to-dmenu).\n\n\n## Copyright\n\nCopyright (c) 2020 Jaakko Luttinen\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjluttine%2Frofi-power-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjluttine%2Frofi-power-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjluttine%2Frofi-power-menu/lists"}