<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=4557&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / simple day night / light dark theme change script -gtk2 and 3.]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=4557</link>
		<description><![CDATA[The most recent posts in simple day night / light dark theme change script -gtk2 and 3..]]></description>
		<lastBuildDate>Tue, 12 Oct 2021 09:08:07 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: simple day night / light dark theme change script -gtk2 and 3.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=32043#p32043</link>
			<description><![CDATA[<p>Made a script for the gtk3 settings.ini as well, pretty much similar to gtk2rc.<br />There is some prior editing to be done to the settings.ini which includes setting up the ini file as follow with your favorite light and dark icons and gtk theme. See bold text in quote, lines 2 and 3&#160; is the light theme and lines 4 and 5 are the dark theme.</p><div class="quotebox"><blockquote><div><p>[Settings]<br /><strong>gtk-application-prefer-dark-theme=false<br />gtk-icon-theme-name=Papirus<br />gtk-application-prefer-dark-theme=true<br />gtk-icon-theme-name=Papirus-Dark</strong><br />gtk-button-images=1<br />gtk-cursor-theme-name=DMZ-White<br />gtk-cursor-theme-size=16<br />gtk-decoration-layout=icon:minimize,maximize,close<br />gtk-enable-animations=true<br />gtk-enable-event-sounds=0<br />gtk-enable-input-feedback-sounds=0<br />gtk-font-name=Sans 12<br />gtk-menu-images=1<br />gtk-primary-button-warps-slider=false<br />gtk-theme-name=Greybird<br />gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR<br />gtk-toolbar-style=GTK_TOOLBAR_ICONS<br />gtk-xft-antialias=1<br />gtk-xft-hinting=1<br />gtk-xft-hintstyle=hintfull<br />gtk-xft-rgba=rgb</p></div></blockquote></div><p>The script.</p><div class="codebox"><pre><code>#!/bin/sh
get_date=$(date +%k%M)
get_theme () {
if [ &quot;$get_date&quot; -lt &quot;1759&quot; ]; then
        printf &quot;$(sed -i -e &#039;2,3s/#//&#039; &quot;$HOME&quot;/.config/gtk-3.0/settings.ini &amp;&amp; sed -i &#039;4,5s/#//&#039; &quot;$HOME&quot;/.config/gtk-3.0/settings.ini)&quot;; # Theme Reset
	printf &quot;$(sed -i -e &#039;2,3s/#//&#039; &quot;$HOME&quot;/.config/gtk-3.0/settings.ini &amp;&amp; sed -i &#039;4,5s/./#&amp;/&#039; &quot;$HOME&quot;/.config/gtk-3.0/settings.ini)&quot;; # Light Theme
elif [ &quot;$get_date&quot; -gt &quot;1800&quot; ]; then
        printf &quot;$(sed -i -e &#039;2,3s/#//&#039; &quot;$HOME&quot;/.config/gtk-3.0/settings.ini &amp;&amp; sed -i &#039;4,5s/#//&#039; &quot;$HOME&quot;/.config/gtk-3.0/settings.ini)&quot; # Theme Reset
        printf &quot;$(sed -i -e &#039;4,5s/#//&#039; &quot;$HOME&quot;/.config/gtk-3.0/settings.ini &amp;&amp; sed -i &#039;2,3s/./#&amp;/&#039; &quot;$HOME&quot;/.config/gtk-3.0/settings.ini)&quot; # Dark Theme
fi
}
while true; do
        get_theme
        sleep 1800s
done</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (hevidevi)]]></author>
			<pubDate>Tue, 12 Oct 2021 09:08:07 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=32043#p32043</guid>
		</item>
		<item>
			<title><![CDATA[simple day night / light dark theme change script -gtk2 and 3.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=32035#p32035</link>
			<description><![CDATA[<p>using gtkrc-2.0 - see second post for gtk3 script.</p><p>i use startx so use .xinitrc to autostart scripts there.</p><p>This just changes the .gtkrc-2.0 theme file in $HOME to match the time of day, so any time after 6 am is a light theme and any time after 6pm is a dark theme, i think i got the script correct as it is using a while loop that checks every 30 minutes?&#160; It just comments out the appropriate gtk and icon theme for the time of day. I thought someone here might find it useful.</p><div class="codebox"><pre><code>#!/bin/sh
get_date=$(date +%k%M)
get_theme () {
if [ &quot;$get_date&quot; -lt &quot;1759&quot; ]; then
        printf &quot;$(sed -i -e &#039;1,2s/#//&#039; &quot;$HOME&quot;/.gtkrc-2.0 &amp;&amp; sed -i &#039;3,4s/#//&#039; &quot;$HOME&quot;/.gtkrc-2.0)&quot;; # Theme Reset
	printf &quot;$(sed -i -e &#039;1,2s/#//&#039; &quot;$HOME&quot;/.gtkrc-2.0 &amp;&amp; sed -i &#039;3,4s/./#&amp;/&#039; &quot;$HOME&quot;/.gtkrc-2.0)&quot;; # Light Theme
elif [ &quot;$get_date&quot; -gt &quot;1800&quot; ]; then
        printf &quot;$(sed -i -e &#039;1,2s/#//&#039; &quot;$HOME&quot;/.gtkrc-2.0 &amp;&amp; sed -i &#039;3,4s/#//&#039; &quot;$HOME&quot;/.gtkrc-2.0)&quot; # Theme Reset
        printf &quot;$(sed -i -e &#039;3,4s/#//&#039; &quot;$HOME&quot;/.gtkrc-2.0 &amp;&amp; sed -i &#039;1,2s/./#&amp;/&#039; &quot;$HOME&quot;/.gtkrc-2.0)&quot; # Dark Theme
fi
}
while true; do
        get_theme
        sleep 1800s
done</code></pre></div><p>so if you have a similar gtkrc-2.0 file with light dark themes you can using the startup script. I dont bother much with gtk3 apps, firefox is set to dark but it only affects the firefox areas of the app. I also dont use theme setters like lxappearance and do it manually.</p><p>Light mode.</p><div class="quotebox"><blockquote><div><p><strong>gtk-theme-name=&quot;Greybird&quot;<br />gtk-icon-theme-name=&quot;Papirus&quot;<br />#gtk-theme-name=&quot;Greybird-dark&quot;<br />#gtk-icon-theme-name=&quot;Papirus-Dark&quot;</strong><br />gtk-font-name=&quot;Sans 11&quot;<br />gtk-cursor-theme-name=&quot;DMZ-White&quot;<br />gtk-cursor-theme-size=0<br />gtk-toolbar-style=GTK_TOOLBAR_ICONS<br />gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR<br />gtk-button-images=1<br />gtk-menu-images=1<br />gtk-enable-event-sounds=1<br />gtk-enable-input-feedback-sounds=1<br />gtk-xft-antialias=1<br />gtk-xft-hinting=1<br />gtk-xft-hintstyle=&quot;hintfull&quot;</p></div></blockquote></div><p>Dark mode</p><div class="quotebox"><blockquote><div><p><strong>#gtk-theme-name=&quot;Greybird&quot;<br />#gtk-icon-theme-name=&quot;Papirus&quot;<br />gtk-theme-name=&quot;Greybird-dark&quot;<br />gtk-icon-theme-name=&quot;Papirus-Dark&quot;</strong><br />gtk-font-name=&quot;Sans 11&quot;<br />gtk-cursor-theme-name=&quot;DMZ-White&quot;<br />gtk-cursor-theme-size=0<br />gtk-toolbar-style=GTK_TOOLBAR_ICONS<br />gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR<br />gtk-button-images=1<br />gtk-menu-images=1<br />gtk-enable-event-sounds=1<br />gtk-enable-input-feedback-sounds=1<br />gtk-xft-antialias=1<br />gtk-xft-hinting=1<br />gtk-xft-hintstyle=&quot;hintfull&quot;</p></div></blockquote></div><p>Edited: Updated script, now working as it should.</p>]]></description>
			<author><![CDATA[dummy@example.com (hevidevi)]]></author>
			<pubDate>Mon, 11 Oct 2021 13:39:12 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=32035#p32035</guid>
		</item>
	</channel>
</rss>
