/*
* rofi
*
* MIT/X11 License
* Copyright © 2012 Sean Pringle <sean.pringle@gmail.com>
* Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
/** The log domain for this helper. */
#define G_LOG_DOMAIN "Helper"
#include "config.h"
#include "display.h"
#include "helper-theme.h"
#include "rofi.h"
#include "settings.h"
#include "view.h"
#include "xcb.h"
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <limits.h>
#include <pango/pango-fontmap.h>
#include <pango/pango.h>
#include <pango/pangocairo.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
/**
* Textual description of positioning rofi.
*/
const char *const monitor_position_entries[] = {
"on focused monitor", "on focused window", "at mouse pointer",
"on monitor with focused window", "on monitor that has mouse pointer"};
/** copy of the argc for use in commandline argument parser. */
int stored_argc = 0;
/** copy of the argv pointer for use in the commandline argument parser */
char **stored_argv = NULL;
char *helper_string_replace_if_exists_v(char *string, GHashTable *h);
void cmd_set_arguments(int