Merge branch 'plasma-rework'

Merging plasma-rework with master because it's ready for production (hopefully!)
This commit is contained in:
Eudaimon 2022-02-05 16:40:37 +01:00
commit 307bcd11b7
11 changed files with 11459 additions and 713 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
@define-color window_fg @theme_fg_color_breeze;
@define-color window_bg @theme_bg_color_breeze;
@define-color text_widget_fg @theme_text_color_breeze;
@define-color text_widget_bg @theme_base_color_breeze;
@define-color disabled_fg @insensitive_fg_color_breeze;
@define-color disabled_bg @insensitive_bg_color_breeze;
@define-color selected_fg @theme_selected_fg_color_breeze;
@define-color selected_bg @theme_selected_bg_color_breeze;
@define-color button_fg @theme_button_foreground_normal_breeze;
@define-color button_bg @theme_button_background_normal_breeze;
@define-color button_pushed_fg @button_fg; /*could need to be @selected_fg on some themes. Plasma does not have a setting for toggled buttons*/
@define-color button_pushed_bg mix(@button_bg, @selected_bg, 0.5); /*Plasma does not have a setting for toggled buttons*/
@define-color border_color shade(mix(@window_fg, @text_widget_bg, 0.5), 0.5); /* to honor Plasma's that would be @borders_breeze, instead of shade(...) */
@define-color warning_color @warning_color_breeze;
@define-color error_color @error_color_breeze;
@define-color success_color @success_color_breeze;
@define-color titlebar_active_fg @theme_titlebar_foreground_breeze;
@define-color titlebar_active_bg @theme_titlebar_background_breeze;
@define-color titlebar_backdrop_fg @theme_titlebar_foreground_backdrop_breeze;
@define-color titlebar_backdrop_bg @theme_titlebar_background_backdrop_breeze;
@define-color hint_fg @tooltip_text_breeze;
@define-color hint_bg @tooltip_background_breeze;

1
imports/import.css vendored Symbolic link
View File

@ -0,0 +1 @@
import_ignore_plasma.css

View File

@ -0,0 +1,41 @@
/* This imports current selected theme's colors and then overwrites it with Plasma's colors */
@import "plasma_colors.css"; /*unfortunately if it does not exist, this theme will be broken!*/
@import "../theme_colors.css";
@define-color window_fg @theme_fg_color_breeze;
@define-color window_bg @theme_bg_color_breeze;
@define-color text_widget_fg @theme_text_color_breeze;
@define-color text_widget_bg @theme_base_color_breeze;
@define-color disabled_fg @insensitive_fg_color_breeze;
@define-color disabled_bg @insensitive_bg_color_breeze;
@define-color selected_fg @theme_selected_fg_color_breeze;
@define-color selected_bg @theme_selected_bg_color_breeze;
@define-color button_fg @theme_button_foreground_normal_breeze;
@define-color button_bg @theme_button_background_normal_breeze;
@define-color button_pushed_fg @button_fg; /*could need to be @selected_fg on some themes. Plasma does not have a setting for toggled buttons*/
@define-color button_pushed_bg mix(@button_bg, @selected_bg, 0.5); /*Plasma does not have a setting for toggled buttons*/
@define-color border_color shade(mix(@window_fg, @text_widget_bg, 0.5), 0.5); /* to honor Plasma's that would be @borders_breeze, instead of shade(...) */
@define-color warning_color @warning_color_breeze;
@define-color error_color @error_color_breeze;
@define-color success_color @success_color_breeze;
@define-color titlebar_active_fg @theme_titlebar_foreground_breeze;
@define-color titlebar_active_bg @theme_titlebar_background_breeze;
@define-color titlebar_backdrop_fg @theme_titlebar_foreground_backdrop_breeze;
@define-color titlebar_backdrop_bg @theme_titlebar_background_backdrop_breeze;
@define-color hint_fg @tooltip_text_breeze;
@define-color hint_bg @tooltip_background_breeze;

View File

@ -0,0 +1,3 @@
/* This imports current selected theme's colors but DOES NOT import Plasma's colors */
@import "../theme_colors.css";

View File

@ -0,0 +1,35 @@
@define-color theme_fg_color_breeze @window_fg;
@define-color theme_bg_color_breeze @window_bg;
@define-color theme_text_color_breeze @text_widget_fg;
@define-color theme_base_color_breeze @text_widget_bg;
@define-color insensitive_fg_color_breeze @disabled_fg;
@define-color insensitive_bg_color_breeze @disabled_bg;
@define-color theme_selected_fg_color_breeze @selected_fg;
@define-color theme_selected_bg_color_breeze @selected_bg;
@define-color theme_button_foreground_normal_breeze @button_fg;
@define-color theme_button_background_normal_breeze @button_bg;
/*Plasma does not have a setting for toggled buttons*/
/* @define-color button_pushed_fg @button_fg;
@define-color button_pushed_bg mix(@button_bg, @selected_bg, 0.5);*/
@define-color border_color shade(mix(@window_fg, @text_widget_bg, 0.5), 0.5);
@define-color warning_color_breeze @warning_color;
@define-color error_color_breeze @error_color;
@define-color success_color_breeze @success_color;
@define-color theme_titlebar_foreground_breeze @titlebar_active_fg;
@define-color theme_titlebar_background_breeze @titlebar_active_bg;
@define-color theme_titlebar_foreground_backdrop_breeze @titlebar_backdrop_fg;
@define-color theme_titlebar_background_backdrop_breeze @titlebar_backdrop_bg;
@define-color tooltip_text_breeze @hint_fg;
@define-color tooltip_background_breeze @hint_bg;

1
imports/plasma_colors.css Symbolic link
View File

@ -0,0 +1 @@
/home/nestor/.config/gtk-3.0/colors.css

0
imports/plasma_inactive Normal file
View File

84
toggle_plasma.sh Executable file
View File

@ -0,0 +1,84 @@
#! /bin/bash
THEMES_DIR=color_themes
CSS_LINK_NAME=theme_colors.css
IMPORTS_DIR=imports
IMPORT_FILE=import.css
IMPORT_FILE_HONOR_PLASMA=import_honor_plasma.css
IMPORT_FILE_IGNORE_PLASMA=import_ignore_plasma.css
PLASMA_ACTIVE=plasma_active
PLASMA_INACTIVE=plasma_inactive
PLASMA_SOURCE_CSS_FILE=~/.config/gtk-3.0/colors.css
LINK_TO_PLASMA_SOURCE_FILE=plasma_colors.css
maxParams=1
usage() {
echo -e "Usage: $(basename "$0") [--current-status] \n" >&2
echo -e "Toggles honoring Plasma's color theme on or off. If there is no color theme for GTK generated by Plasma, it won't be toggled on" >&2
echo -e "\nOption --current-status tells if the theme is currently honoring Plasma color scheme or not" >&2
}
if [ $# -gt $maxParams ]
then
echo -e "\nError: Incorrect usage." >&2
usage
exit 1
fi
if [ $# -eq 1 ]
then
if [ $1 = "--current-status" ]
then
[ -e $IMPORTS_DIR/PLASMA_ACTIVE ] && echo -e "The theme is honoring Plasma's color scheme\n" || echo -e "\nThe theme is NOT honoring Plasma's color scheme\n"
exit 0
else
echo -e "\nError: Incorrect usage." >&2
usage
exit 1
fi
fi
# Making sure we are in the script's directory, otherwise it's not going to work
SCRIPT_PATH=`realpath "$0"`
SCRIPT_DIR=`dirname "$SCRIPT_PATH"`
cd $SCRIPT_DIR
cd $IMPORTS_DIR
#if we are honoring Plasma colors...
if [ -e $PLASMA_ACTIVE ]
then
# deactivate it
[ -h $IMPORT_FILE ] && rm $IMPORT_FILE
ln -s $IMPORT_FILE_IGNORE_PLASMA $IMPORT_FILE
rm $PLASMA_ACTIVE
touch $PLASMA_INACTIVE
echo -e "\n Plasma theme honoring toggled OFF (that is: GTK theme will not follow current Plasma color scheme)\n"
else
#before activating Plasma, check if plasma colors.css file exists!
if [ ! -e $PLASMA_SOURCE_CSS_FILE ]
then
echo -e "Could not find Plasma color theme for GTK ($PLASMA_SOURCE_CSS_FILE), so GTK theme will continue not attempting to follow Plasma color scheme. Not doing anything, therefore..."
cd cd $SCRIPT_DIR
exit 2
fi
[ -h $IMPORT_FILE ] && rm $IMPORT_FILE
ln -s $IMPORT_FILE_HONOR_PLASMA $IMPORT_FILE
[ -h $LINK_TO_PLASMA_SOURCE_FILE ] && rm $LINK_TO_PLASMA_SOURCE_FILE
ln -s $PLASMA_SOURCE_CSS_FILE $LINK_TO_PLASMA_SOURCE_FILE
[ -e $PLASMA_INACTIVE ] && rm $PLASMA_INACTIVE
touch $PLASMA_ACTIVE
echo -e "\n Plasma theme honoring toggled ON (that is: GTK theme will follow current Plasma color scheme)\n"
fi
cd $SCRIPT_DIR