#!/bin/bash

# testing $USER config
if [ ! -d $HOME/.conky ]; then
    mkdir -p $HOME/.conky
    cp -u /usr/share/nakedconky/* $HOME/.conky/
fi
# list conkyrc in DIR
if [ -d "$1" ]; then
    DIR="$1"
else
    DIR="$HOME/.conky/"
fi
# kill other conkys
killall conky
# show rofi menu with conky's
CKY=$(ls -A $DIR | grep conkyrc | rofi -dmenu -p 'switch conky ') \
    && eval "conky -q -c $DIR/$CKY"
exit 0
