diff options
author | Dave Davenport <qball@gmpclient.org> | 2020-05-21 09:35:55 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2020-05-21 09:35:55 +0200 |
commit | 3604b12fde54ffe0b049dd2f47ece4eba5689989 (patch) | |
tree | d06a82acf7d017be49a3a3cb5b4ef8057186d4c5 /source/rofi.c | |
parent | a4c5a92199249369f1f312f83f6ac3995c6c64f9 (diff) |
Add check that looks if rofi is running inside rofi script mode.
Diffstat (limited to 'source/rofi.c')
-rw-r--r-- | source/rofi.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/rofi.c b/source/rofi.c index 88002324..0b47a9c7 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -788,6 +788,17 @@ int main ( int argc, char *argv[] ) return EXIT_SUCCESS; } + { + const char *ro_pid = g_getenv("ROFI_OUTSIDE"); + if ( ro_pid != NULL ) { + int ro_pidi = g_ascii_strtoll ( ro_pid, NULL, 0 ); + if ( kill ( ro_pidi, 0 ) == 0 ) { + printf ( "Do not launch rofi from inside rofi.\r\n" ); + return EXIT_FAILURE; + } + } + } + // Detect if we are in dmenu mode. // This has two possible causes. // 1 the user specifies it on the command-line. |