#!/bin/bash

DIR="$HOME/.config/i3"

rofi_command="rofi -theme $DIR/rofi/themes/asroot.rasi"

# Apps
terminal=" Alacritty"
files=" Pcmanfm"
editor=" Geany"
clifm=" Ranger"
lpad=" Leafpad"
vim=" Vim"

# Variable passed to rofi
options="$terminal\n$files\n$editor\n$clifm\n$lpad\n$vim"

# Functions

chosen="$(echo -e "$options" | $rofi_command -p "Run as root(#)" -dmenu -selected-row 0)"
case $chosen in
    $terminal)
        apps_as_root 'alacritty --class alacritty-float,alacritty-float --config-file /root/.config/alacritty/alacritty.yml'
        ;;
    $files)
        apps_as_root 'dbus-run-session pcmanfm'
        ;;
    $editor)
        apps_as_root geany
        ;;
    $clifm)
        apps_as_root 'alacritty --class alacritty-float,alacritty-float --config-file /root/.config/alacritty/alacritty.yml -e ranger'
        ;;
    $lpad)
        apps_as_root leafpad
        ;;
    $vim)
        apps_as_root 'alacritty --class alacritty-float,alacritty-float --config-file /root/.config/alacritty/alacritty.yml -e vim'
        ;;
esac


