all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Advice for changing-theme-function for GNU/Linux system
@ 2022-07-17 17:15 Jonas Damm
  2022-07-17 18:37 ` Yuri Khan
  2022-07-18 22:47 ` Samuel Banya
  0 siblings, 2 replies; 6+ messages in thread
From: Jonas Damm @ 2022-07-17 17:15 UTC (permalink / raw)
  To: Help Gnu Emacs

Hi,

I wish to create my own function in emacs to switch my whole system from
dark to light mode.

I want to use the modus themes included in emacs, so i can toggle with
modus-themes-toggle.

However, I also want to change my systems GTK theme for other
applications like Evince. So i have to change the file
~/.config/gtk-3.0/settings.ini and replace "Adwaita" with "Adwaita-dark"
or the other way round. How would this be done? Do I need to call a
shell command with "sed", or can emacs to this natively by opening that
file, finding and replacing the String?

Thanks for any Ideas,
Jonas



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice for changing-theme-function for GNU/Linux system
  2022-07-17 17:15 Advice for changing-theme-function for GNU/Linux system Jonas Damm
@ 2022-07-17 18:37 ` Yuri Khan
  2022-07-18  9:05   ` Jonas Damm
  2022-07-18 22:47 ` Samuel Banya
  1 sibling, 1 reply; 6+ messages in thread
From: Yuri Khan @ 2022-07-17 18:37 UTC (permalink / raw)
  To: Jonas Damm; +Cc: Help Gnu Emacs

On Mon, 18 Jul 2022 at 00:27, Jonas Damm <emails@jonas-damm.de> wrote:

> I wish to create my own function in emacs to switch my whole system from
> dark to light mode.
>
> I want to use the modus themes included in emacs, so i can toggle with
> modus-themes-toggle.
>
> However, I also want to change my systems GTK theme for other
> applications like Evince. So i have to change the file
> ~/.config/gtk-3.0/settings.ini and replace "Adwaita" with "Adwaita-dark"
> or the other way round.

And restart every running application, and hope they preserve their
state, because themes set via gtk-3.0/settings.ini only take effect on
application startup.

Alternatively, keep a settings daemon running. With one of these, you
can apply themes on the fly. If you’re using a desktop environment
such as GNOME, KDE or Xfce, you already have one. If not, Xfce’s
xfsettingsd is lightweight enough and can run without the whole DE.
(Start it on your session startup with an --sm-client-disable option.)
There is also something called Xsettingsd which is purportedly even
more lightweight.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice for changing-theme-function for GNU/Linux system
  2022-07-17 18:37 ` Yuri Khan
@ 2022-07-18  9:05   ` Jonas Damm
  2022-07-18  9:28     ` Yuri Khan
  0 siblings, 1 reply; 6+ messages in thread
From: Jonas Damm @ 2022-07-18  9:05 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

Thank you, that put me in the right direction.

I am having a little trouble though. I can successfully change the
Firefox-Theme, without restarting the application, which is awesome.
However my GTK applications like Evince do not change their theme. Not
even by restarting them.

I am running the xfsettingsd with the --sm-client-disable option and
then change the theme with this command:

xfconf-query -c xsettings -p /Net/ThemeName -s "Adwaita-dark" 

Any Idea why that is?

Maybe I need the gnome-settings-daemon? But this one seems to have been
split into many small daemons, and i can't find documentation on how to
use them..

Thanks,
Jonas

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Mon, 18 Jul 2022 at 00:27, Jonas Damm <emails@jonas-damm.de> wrote:
>
>> I wish to create my own function in emacs to switch my whole system from
>> dark to light mode.
>>
>> I want to use the modus themes included in emacs, so i can toggle with
>> modus-themes-toggle.
>>
>> However, I also want to change my systems GTK theme for other
>> applications like Evince. So i have to change the file
>> ~/.config/gtk-3.0/settings.ini and replace "Adwaita" with "Adwaita-dark"
>> or the other way round.
>
> And restart every running application, and hope they preserve their
> state, because themes set via gtk-3.0/settings.ini only take effect on
> application startup.
>
> Alternatively, keep a settings daemon running. With one of these, you
> can apply themes on the fly. If you’re using a desktop environment
> such as GNOME, KDE or Xfce, you already have one. If not, Xfce’s
> xfsettingsd is lightweight enough and can run without the whole DE.
> (Start it on your session startup with an --sm-client-disable option.)
> There is also something called Xsettingsd which is purportedly even
> more lightweight.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice for changing-theme-function for GNU/Linux system
  2022-07-18  9:05   ` Jonas Damm
@ 2022-07-18  9:28     ` Yuri Khan
  2022-07-18 10:36       ` Jonas Damm
  0 siblings, 1 reply; 6+ messages in thread
From: Yuri Khan @ 2022-07-18  9:28 UTC (permalink / raw)
  To: Jonas Damm; +Cc: help-gnu-emacs

On Mon, 18 Jul 2022 at 16:13, Jonas Damm <emails@jonas-damm.de> wrote:

> However my GTK applications like Evince do not change their theme. Not
> even by restarting them.
>
> I am running the xfsettingsd with the --sm-client-disable option and
> then change the theme with this command:
>
> xfconf-query -c xsettings -p /Net/ThemeName -s "Adwaita-dark"
>
> Any Idea why that is?

I don’t know, does changing the theme interactively through
xfce4-appearance-settings work for you?

Hm. For me, choosing the theme in xfce4-appearance-settings works for
Firefox, Thunderbird, LibreOffice, and Evince, while going through
xfconf-query only affects the former three. Both work for Atril
though. (Atril is to Xfce as Evince is to GNOME.)

(We might have crossed into offtopic territory.)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice for changing-theme-function for GNU/Linux system
  2022-07-18  9:28     ` Yuri Khan
@ 2022-07-18 10:36       ` Jonas Damm
  0 siblings, 0 replies; 6+ messages in thread
From: Jonas Damm @ 2022-07-18 10:36 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

> Hm. For me, choosing the theme in xfce4-appearance-settings works for
> Firefox, Thunderbird, LibreOffice, and Evince, while going through
> xfconf-query only affects the former three.

Its the same for me. I am trying to get help from the GNOME people on
this, but that seems pretty difficult. Thanks so far. If i get around to
write my emacs-function, I will post it here..

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Mon, 18 Jul 2022 at 16:13, Jonas Damm <emails@jonas-damm.de> wrote:
>
>> However my GTK applications like Evince do not change their theme. Not
>> even by restarting them.
>>
>> I am running the xfsettingsd with the --sm-client-disable option and
>> then change the theme with this command:
>>
>> xfconf-query -c xsettings -p /Net/ThemeName -s "Adwaita-dark"
>>
>> Any Idea why that is?
>
> I don’t know, does changing the theme interactively through
> xfce4-appearance-settings work for you?
>
> Hm. For me, choosing the theme in xfce4-appearance-settings works for
> Firefox, Thunderbird, LibreOffice, and Evince, while going through
> xfconf-query only affects the former three. Both work for Atril
> though. (Atril is to Xfce as Evince is to GNOME.)
>
> (We might have crossed into offtopic territory.)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice for changing-theme-function for GNU/Linux system
  2022-07-17 17:15 Advice for changing-theme-function for GNU/Linux system Jonas Damm
  2022-07-17 18:37 ` Yuri Khan
@ 2022-07-18 22:47 ` Samuel Banya
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Banya @ 2022-07-18 22:47 UTC (permalink / raw)
  To: Emanuel Berg

One thing I can think of is to base it upon the '~/.Xresources' file itself:
 * https://github.com/martenlienen/xresources-theme

Or just use 'pywal':
 * https://github.com/dylanaraps/pywal

Sincerely,

Sam

On Sun, Jul 17, 2022, at 1:15 PM, Jonas Damm wrote:
> Hi,
> 
> I wish to create my own function in emacs to switch my whole system from
> dark to light mode.
> 
> I want to use the modus themes included in emacs, so i can toggle with
> modus-themes-toggle.
> 
> However, I also want to change my systems GTK theme for other
> applications like Evince. So i have to change the file
> ~/.config/gtk-3.0/settings.ini and replace "Adwaita" with "Adwaita-dark"
> or the other way round. How would this be done? Do I need to call a
> shell command with "sed", or can emacs to this natively by opening that
> file, finding and replacing the String?
> 
> Thanks for any Ideas,
> Jonas
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-18 22:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-17 17:15 Advice for changing-theme-function for GNU/Linux system Jonas Damm
2022-07-17 18:37 ` Yuri Khan
2022-07-18  9:05   ` Jonas Damm
2022-07-18  9:28     ` Yuri Khan
2022-07-18 10:36       ` Jonas Damm
2022-07-18 22:47 ` Samuel Banya

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.