{"id":17656395,"url":"https://github.com/nwg-piotr/rof","last_synced_at":"2025-05-07T11:45:49.755Z","repository":{"id":98647965,"uuid":"155645567","full_name":"nwg-piotr/rof","owner":"nwg-piotr","description":"Launcher script to avoid running multiple instance of the same window","archived":false,"fork":false,"pushed_at":"2018-11-23T01:31:00.000Z","size":31,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T09:41:20.231Z","etag":null,"topics":["archlinux","bash","linux","openbox","tint2"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nwg-piotr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-11-01T01:36:37.000Z","updated_at":"2022-11-09T09:03:42.000Z","dependencies_parsed_at":"2023-03-13T15:57:26.285Z","dependency_job_id":null,"html_url":"https://github.com/nwg-piotr/rof","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwg-piotr%2Frof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwg-piotr%2Frof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwg-piotr%2Frof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwg-piotr%2Frof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwg-piotr","download_url":"https://codeload.github.com/nwg-piotr/rof/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873937,"owners_count":21817708,"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":["archlinux","bash","linux","openbox","tint2"],"created_at":"2024-10-23T14:31:42.088Z","updated_at":"2025-05-07T11:45:49.748Z","avatar_url":"https://github.com/nwg-piotr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rof\nrof is  a launcher script to avoid launching multiple instances of the same window. The name stands for [r]un [o]r set [f]ocus).\n\nWhile playing with [my collection of Tint2 executors](https://github.com/nwg-piotr/tint2-executors) one of things I hated most \nwas that commands assigned to mouse events would execute again and again after each click, even if previous instances were \nalready running. The behavior I expected was: launch the command if not yet running, else just bring focus to the command \nwindow. Having no better idea on how to achieve this, I wrote this short script. It searches the process ID of the name given, then tries to find a window by the process ID. If found, it'll be given focus, instead of running the command again.\n\n## Dependencies:\n\n`xorg-xprop`, `wmctrl` (valid for Arch Linux; package names may vary in other distributions)\n\n## Usage:\n\n```\nrof [-P process_name] command\n```\n\nUse `rof command` to simply run if the command and the process name are the same.\n\nProvide the optional process name, for instance if the command is a script which runs another command:\n\n```\nrof -P zenity zenity-set-volume.sh\n```\n\nlaunches the script which opens a zenity box, with arguments: `zenity --scale --value ${lvl} --title \"Volume\" --text \"Set master volume level\"`\n\n## Sample:\n\nThe script may be useful in a Tint2 executor left/right click commands:\n\n```\n#-------------------------------------\n# Executor 4\nexecp = new\nexecp_command = ~/tint2-executors/volume-icon.sh\nexecp_interval = 3\nexecp_has_icon = 1\nexecp_cache_icon = 1\nexecp_continuous = 0\nexecp_markup = 1\nexecp_tooltip = Scroll ↓↑, middle click to mute\nexecp_lclick_command = rof -P zenity ~/tint2-executors/zenity-set-volume.sh\nexecp_rclick_command = rof pavucontrol\nexecp_mclick_command = amixer set Master toggle -q\nexecp_uwheel_command = amixer set Master 5%+ unmute -q \u0026\u0026 ~/tint2-executors/notify-vol.sh\nexecp_dwheel_command = amixer set Master 5%- -q \u0026\u0026 ~/tint2-executors/notify-vol.sh\nexecp_font_color = #000000 100\nexecp_padding = 0 0\nexecp_background_id = 0\nexecp_centered = 0\nexecp_icon_w = 26\nexecp_icon_h = 26\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwg-piotr%2Frof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwg-piotr%2Frof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwg-piotr%2Frof/lists"}