#!/usr/bin/env bash # ABOUTME: Application launcher using rofi with GTK theme integration. # ABOUTME: Supports window, files, run, and drun modes. SETTINGS=/etc/xdg/rofi/gtk-theme.ini #Gets the current gtk using gsettings and removes the quotes CURRENT_GTK_THEME=$(gsettings get org.gnome.desktop.interface gtk-theme) CURRENT_GTK_THEME="${CURRENT_GTK_THEME#?}" CURRENT_GTK_THEME="${CURRENT_GTK_THEME%?}" #Gets the gtk theme that is in the settings.ini file SETTINGS_GTK_THEME=$(grep "GTK_THEME" "${SETTINGS}" | cut -b 11-) #create new colors.rasi from template if [ "${SETTINGS_GTK_THEME}" != "${CURRENT_GTK_THEME}" ]; then sed -i "s:GTK_THEME=${SETTINGS_GTK_THEME}:GTK_THEME=${CURRENT_GTK_THEME}:g" "${SETTINGS}" python3 moonarch-gtk-style /etc/xdg/rofi/_template/colors.rasi > /etc/xdg/rofi/colors.rasi fi case $1 in window) showmode="window" ;; files) showmode="filebrowser" ;; run) showmode="run" ;; *) showmode="drun" ;; esac ## Run rofi \ -show $showmode \ -click-to-exit \ -theme /etc/xdg/rofi/launcher/launcher.rasi