diff --git a/README.md b/README.md index 3f4cf7a..c46f2c7 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,13 @@ If desired, you can enable the usage of symbolic icons to display the weather co gsettings set org.gnome.shell.extensions.weather use-symbolic-icons false gsettings set org.gnome.shell.extensions.weather use-symbolic-icons true +#### Show Text in Panel (optional, true by default) + +You can configure whether to show the weather condition text together with the temperature in the panel (requires restart of GNOME Shell). + + gsettings set org.gnome.shell.extensions.weather show-text-in-panel true + gsettings set org.gnome.shell.extensions.weather show-text-in-panel false + #### Restart GNOME Shell Don't forget to restart GNOME Shell: diff --git a/src/extension.js b/src/extension.js index 124727a..ecd4d60 100644 --- a/src/extension.js +++ b/src/extension.js @@ -54,6 +54,7 @@ const WEATHER_CITY_KEY = 'city'; const WEATHER_WOEID_KEY = 'woeid'; const WEATHER_TRANSLATE_CONDITION_KEY = 'translate-condition'; const WEATHER_SYMBOLIC_ICONS = 'use-symbolic-icons'; +const WEATHER_SHOW_TEXT_IN_PANEL_KEY = 'show-text-in-panel'; // Keep enums in sync with GSettings schemas const WeatherUnits = { @@ -82,6 +83,7 @@ WeatherMenuButton.prototype = { this._woeid = this._settings.get_string(WEATHER_WOEID_KEY); this._translate_condition = this._settings.get_boolean(WEATHER_TRANSLATE_CONDITION_KEY); this._icontype = this._settings.get_boolean(WEATHER_SYMBOLIC_ICONS) ? St.IconType.SYMBOLIC : St.IconType.FULLCOLOR; + this._text_in_panel = this._settings.get_boolean(WEATHER_SHOW_TEXT_IN_PANEL_KEY); // Watch settings for changes let load_settings_and_refresh_weather = Lang.bind(this, function() { @@ -125,7 +127,8 @@ WeatherMenuButton.prototype = { // Putting the panel item together let topBox = new St.BoxLayout(); topBox.add_actor(this._weatherIcon); - topBox.add_actor(this._weatherInfo); + if (this._text_in_panel) + topBox.add_actor(this._weatherInfo); this.actor.set_child(topBox); Main.panel._centerBox.add(this.actor, { y_fill: true }); Main.panel._menus.addMenu(this.menu); diff --git a/src/org.gnome.shell.extensions.weather.gschema.xml.in b/src/org.gnome.shell.extensions.weather.gschema.xml.in index e405bcd..4050a05 100644 --- a/src/org.gnome.shell.extensions.weather.gschema.xml.in +++ b/src/org.gnome.shell.extensions.weather.gschema.xml.in @@ -29,5 +29,10 @@ <_summary>Whether to use symbolic icons <_description>Whether to use symbolic icons instead of full-colored icons. + + true + <_summary>Whether to show the text in the panel. + <_description>Whether to show the weather condition text together with the temperature in the panel (requires restart). +