This is one of those cases when, viewing a file in your window manager, you see a .php file you want to quickly inspect. You double click on it, and… It quickly opens Geany, or your default quick file editor, but PHPStorm is already running right there… Or the opposite: you just want a quick peak for a single little…
This is one of those cases when, viewing a file in your window manager, you see a .php file you want to quickly inspect. You double click on it, and…
What if your file manager just knew? That's the idea of the following bash script that acts as the default handler for .php files:
Drop this in ~/.local/bin/open-php:
#!/bin/bash
# Open .php files: use PhpStorm if running, otherwise Geany
if pgrep -x "phpstorm" > /dev/null || pgrep -f "phpstorm" > /dev/null; then
# PhpStorm is running - open file in existing instance
phpstorm "$@"
else
geany "$@"
fiThen chmod it +x. Also make sure obviously that your IDE and light editor binaries are in the path. To find the exact name of your IDE process, you can use pgrep -a -f [Pp]hp[Ss]torm for example.
The setupSet open-php as the default application for .php files. Right-click any .php in your file manager, pick "Open With Other Application", point to ~/.local/bin/open-php, and set it as default.
Alternatively, at least if using Nemo (Linux Mint for instance), you can create ~/.local/share/applications/open-php.desktop with the following:
[Desktop Entry]
Name=Open PHP File
Exec=/home/YOUR_USERNAME/.local/bin/open-php %F
Type=Application
NoDisplay=true
MimeType=application/x-php;text/x-php;Replace YOUR_USERNAME with your own user name, then register it as the new handler:
update-desktop-database ~/.local/share/applications
xdg-mime default open-php.desktop application/x-php
xdg-mime default open-php.desktop text/x-phpFrom now on, double-clicking a PHP file does the right thing automatically. Heavy tooling when it's already warm, or the lightweight editor when it's not. Best of both worlds!
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Standardize listing of Markdown Flavors used in the MD document: GLFM, GFM, QMD, etc | 0 | 5.04 | 03-10-2026 |
| 2 | GitHub Copilot vs. OpenClaw: A Hands-On Tutorial for the Two AI Tools Everyone’s Searching For | 0 | 10.71 | 09-08-2026 |
| 3 | AI Makes "Open-Source, Clean Room" Implementations Of Adobe Photoshop & Premier In Rust | 0 | 9.02 | 08-10-2026 |
| 4 | Part 6: An operating system for coding agents: the disciplined build | 0 | 7.44 | 07-10-2026 |
| 5 | Markdific - A better tool to open, read, edit and export Markdown files | 0 | 7.23 | 05-10-2026 |
| 6 | Audacity schneller machen: Diese Tipps und Hacks helfen Ihnen | 0 | 7.48 | 02-10-2026 |
| 7 | X-post: A Note on Figma access | 0 | 11.43 | 18-09-2026 |
| 8 | New features for RFC-Editor.org | 0 | 14.26 | 30-09-2026 |
| 9 | Ability to assign custom global hotkeys to open specific URLs / bookmarks | 0 | 5.4 | 30-09-2026 |