#!/bin/bash

theme=$(grep -o -P '(?<=local theme = ").*(?=")' /home/nick/.config/awesome/theme/init.lua)

case $theme in
    "nordic_legion")
        new_theme="abstract_office"
        ;;
    "abstract_office")
        new_theme="nordic_legion"
        ;;
    *)
esac

# Replace the theme in the init.lua file
sed -i "s/local theme = .*$/local theme = \"$new_theme\"/" /home/nick/.config/awesome/theme/init.lua

# Restart awesome
echo 'awesome.restart()' | awesome-client
