nwg-piotr / nwg-look Goto Github PK
View Code? Open in Web Editor NEWGTK3 settings editor adapted to work in the wlroots environment
License: MIT License
GTK3 settings editor adapted to work in the wlroots environment
License: MIT License
nwg-look is up to date in Guru
Do you have any plans on getting nwg-look packaged on NixOS? Thanks.
(...) is it possible to have a command-line option to export nwg-look preferences to files? i use nwg-look to set my themes, and on top of that, i have darkman for automatic dark mode toggling. i set my theme to a light one during the day, and a dark one when it's night time, and apps under XWayland reads the gtk settings files instead of directly reading from gsettings, so having a command-line option for nwg-look to automatically export to files would be really neat!
Originally posted by @j1nxie in nwg-piotr/nwg-shell#157 (comment)
I already have go 1.20, gtk+3-devel, xcur2png, glib-devel, and cairo installed all through xbps which I'm pretty sure covers everything. This might be a void specific thing, or I messed something up
Output of make build
`go build -o bin/nwg-look .
./main.go:29:29: undefined: gtk.Settings
./main.go:34:29: undefined: gtk.Viewport
./main.go:35:29: undefined: gtk.ScrolledWindow
./main.go:36:29: undefined: gtk.ListBox
./main.go:37:29: undefined: gtk.MenuBar
./main.go:38:29: undefined: gtk.Grid
./main.go:39:29: undefined: gtk.Grid
./main.go:40:29: undefined: gtk.Frame
./main.go:41:29: undefined: gtk.Box
./main.go:42:29: undefined: gtk.Frame
./main.go:42:29: too many errors
make: *** [Makefile:7: build] Error 1`
I thought it was a good app, but it turned out to be a copy of LXappearance, with the same disease, so I deleted it...
The question is - why are you violating the XDG specification?
Why are you polluting the HOME catalog?
Themes and icons should be here
~/.local/share/icons
~/.local/share/themes
and gtk files should be here
~/.config/gtk-2.0/gtkrc
~/.config/gtk-3.0/settings.ini
Attempting to set a theme, running Hyprland WM setting WhiteSur theme. Everything applies correctly but the gtk2 file does not get saved. I do have GTK2_RC_FILES
defined, idk if thats meant to break the app but it doesnt respect this env either. There are 0 traces of any gtk2 files created on the system.
By constrast, lxappearence did make them. I recently switched from lxappearance to this, because I was recommended it. Any ideas what might be happening?
using arch, I get the following error when paru tries to install:
cgo-gcc-prolog: In function ‘_cgo_200740c87a77_Cfunc_g_binding_get_source’:
cgo-gcc-prolog:71:2: warning: ‘g_binding_get_source’ is deprecated: Use 'g_binding_dup_source' instead [-Wdeprecated-declarations]
In file included from /usr/include/glib-2.0/glib-object.h:24,
from /usr/include/glib-2.0/gio/gioenums.h:30,
from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from ../go/pkg/mod/github.com/gotk3/[email protected]/glib/gbinding.go:3:
/usr/include/glib-2.0/gobject/gbinding.h:115:23: note: declared here
115 | GObject * g_binding_get_source (GBinding *binding);
| ^~~~~~~~~~~~~~~~~~~~
cgo-gcc-prolog: In function ‘_cgo_200740c87a77_Cfunc_g_binding_get_target’:
cgo-gcc-prolog:107:2: warning: ‘g_binding_get_target’ is deprecated: Use 'g_binding_dup_target' instead [-Wdeprecated-declarations]
/usr/include/glib-2.0/gobject/gbinding.h:119:23: note: declared here
119 | GObject * g_binding_get_target (GBinding *binding);
| ^~~~~~~~~~~~~~~~~~~~
I like to keep track of my config files with git so I would like to know what files nwg-look
stores configurations in / is dependant on. Git is also not great at handling binary files so if possible I would like to exclude such files from being versioned (such as dconf files).
I went a bit too fast whilst installing nwg-look and got the error below. Of course after installing main.glade
at the right location this problem went away.
INFO[0000] input-feedback-sounds: false
(nwg-look:20058): Gtk-ERROR **: 22:09:16.247: failed to add UI: Failed to open file “/usr/share/nwg-look/main.glade”: No such file or directory
SIGTRAP: trace trap
PC=0x7f87a54a9e10 m=4 sigcode=128
signal arrived during cgo execution
goroutine 1 [syscall]:
runtime.cgocall(0x5bbee0, 0xc0000e5c50)
/usr/lib/golang/src/runtime/cgocall.go:157 +0x5c fp=0xc0000e5c28 sp=0xc0000e5bf0 pc=0x48523c
github.com/gotk3/gotk3/gtk._Cfunc_gtk_builder_new_from_file(0x1f4abd0)
_cgo_gotypes.go:6402 +0x49 fp=0xc0000e5c50 sp=0xc0000e5c28 pc=0x56cd09
github.com/gotk3/gotk3/gtk.BuilderNewFromFile({0x689f03?, 0x7?})
/home/han/go/pkg/mod/github.com/gotk3/[email protected]/gtk/gtk_since_3_10.go:876 +0x67 fp=0xc0000e5ca8 sp=0xc0000e5c50 pc=0x58a207
main.main()
/usr/pkgmk/work/nwg-look/src/nwg-look/main.go:333 +0x62c fp=0xc0000e5f80 sp=0xc0000e5ca8 pc=0x599c8c
runtime.main()
/usr/lib/golang/src/runtime/proc.go:250 +0x212 fp=0xc0000e5fe0 sp=0xc0000e5f80 pc=0x4b6fd2
runtime.goexit()
/usr/lib/golang/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc0000e5fe8 sp=0xc0000e5fe0 pc=0x4e2721
rax 0x0
rbx 0x1
rcx 0xf
rdx 0x7f8770002
rdi 0x7
rsi 0x7f87700008e0
rbp 0x7f87792a34c0
rsp 0x7f87792a3420
r8 0x7f8770002fd0
r9 0x73
r10 0x0
r11 0xcdcd34f3ae091e21
r12 0x6
r13 0x0
r14 0x7f87a5584d00
r15 0x7f87a5584d90
rip 0x7f87a54a9e10
rflags 0x202
cs 0x33
fs 0x0
gs 0x0
First of all, I would like to thank you for your tireless efforts. I use nwg-shell components in yocto/openembedded build environment and I am really thankful for that tools that enrich wlroots/sway a lot.
Found two small issues:
nwg-look/stuff/nwg-look.desktop
Line 11 in 05b482a
And if wearing the distributors hat, i'd like to have a LICENSE file to ship with the package
Apart from this i did succeed in building nwg-look for x86-64 and aarch64.
Looks awesome. Great work!
Hey bro, first off, I love your projects.
I use mostly your nwg-look which is wayyyy better than any other gtk-settings / theming app in my opinion.
Question:
Do you have any plans on maintaining a COPR repo for our fedora users?
Building from source is kinda takes long tbh and would be nice if there is for Fedora
(oh and maybe Debian) :)
TIA
It would be awesome if nwg-look could handle gtk-4.
The icon folder can be on two locations:
~/.icons
$XDG_DATA_HOME/icons
Can you support both locations?
The new settings and welcome even for those who are not using nwg-shell. It would be great to be able to install it as a standalone application. instead of lxappearence
.
The code to load data files (en_US.json
and main.glade
) is hardwired to use /usr/share
as the location. This prohibits alternate installation locations (e.g. /usr/local
). The getDataDirs()
function in tools.go
can easily be leveraged to provide a "search path" for locating these files. I will submit a pull request that implements this change for your consideration.
Hi,
Firstly I'd like to thank you for this project, it's been really helpful in my transition to Wayland.
I've noticed that currently when using nwg-look -a
, the text scaling factor is not actually read from the file, and the default is instead used. I've had a go at creating a patch for it (see below), and it seems to work well on my end.
Cheers,
Grzegorz
From d6dd3f231f5fcfc6b75a17da66f369c7fd09061e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Grzegorz=20Cio=C5=82ek?= <[email protected]>
Date: Tue, 23 May 2023 16:46:01 +0100
Subject: [PATCH] Fixed text scale loading from file
---
tools.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools.go b/tools.go
index fd98763..f6d5385 100644
--- a/tools.go
+++ b/tools.go
@@ -534,6 +534,11 @@ func applyGsettingsFromFile() {
gsettings.fontAntialiasing = value
case "font-rgba-order":
gsettings.fontRgbaOrder = value
+ case "text-scaling-factor":
+ v, err := strconv.ParseFloat(value, 64)
+ if err == nil {
+ gsettings.textScalingFactor = v
+ }
case "event-sounds":
gsettings.eventSounds = value == "true"
case "input-feedback-sounds":
--
2.39.3
All theme settings are correctly applied, but after restarting Sway config all reset to default Adwaita theme. The only workaround for this is using import-gsettings script https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
nwg-look 0.1.3
Ubuntu 22.04 LTS
Sway 1.7
I want to change my Hyprland cursor and was redirected to this repo. There seems to not be any nixpkg of this, so I'm making an issue for it
they are located in ~/.icons
Greetings. First of all, I'd like to thank you for this very useful software.
I am using nwg-look to change the look of gtk on hyprland. I was using breeze-dark icons and cursor, when I decided to change the cursor to Catppuccin-Mocha-Dark from the AUR. In selecting a different cursor, all icons changed to adwaita (i noticed this on thunar, which is the main gtk program i use), and all my attempts to set a different icon set were for naught, as I seem to be unable to change the icons using nwg-look. I have had to install kde-plasma and make the change there in order to be able to have my old icons with the new cursor.
I'm attaching a video showcasing the issue as well as a log file of the output of nwg-look.
Hello,
can you support environment variables like the following one?
GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0
At least I think so and where vast majority user configs are, not in $XDG_DATA_HOME
(~/.local/share
)
Summary: https://wiki.archlinux.org/title/XDG_Base_Directory#User_directories
I'm stuck on this message
❯ make build
go build -o bin/nwg-look .
# github.com/gotk3/gotk3/glib
cgo-gcc-prolog: In function ‘_cgo_200740c87a77_Cfunc_g_binding_get_source’:
cgo-gcc-prolog:71:2: warning: ‘g_binding_get_source’ is deprecated: Use 'g_binding_dup_source' instead [-Wdeprecated-declarations]
In file included from /usr/include/glib-2.0/glib-object.h:24,
from /usr/include/glib-2.0/gio/gioenums.h:30,
from /usr/include/glib-2.0/gio/giotypes.h:30,
from /usr/include/glib-2.0/gio/gio.h:28,
from ../../go/pkg/mod/github.com/gotk3/[email protected]/glib/gbinding.go:3:
/usr/include/glib-2.0/gobject/gbinding.h:115:23: note: declared here
115 | GObject * g_binding_get_source (GBinding *binding);
| ^~~~~~~~~~~~~~~~~~~~
cgo-gcc-prolog: In function ‘_cgo_200740c87a77_Cfunc_g_binding_get_target’:
cgo-gcc-prolog:107:2: warning: ‘g_binding_get_target’ is deprecated: Use 'g_binding_dup_target' instead [-Wdeprecated-declarations]
/usr/include/glib-2.0/gobject/gbinding.h:119:23: note: declared here
119 | GObject * g_binding_get_target (GBinding *binding);
| ^~~~~~~~~~~~~~~~~~~~
Many cursor themes (such as quintom) do not ship with a index.theme file. Instead, they ship with a cursor.theme file. The syntax is indentical. Some ship with both as well.
As of now, nwg-look seems to only look for the index.theme file, and since the theme didn't have it it didn't show up in the cursor list.
If you set a custom cursor theme without that folder, index.theme will never be created and the settings are not properly applied. For any updated setting file nwg-look should create the folder if it does not exist.
~/.icons/default/index.theme
Workaround:
mkdir -p ~/.icons/default
OS: Arch Linux
WM: wlroots
-based
nwg-look
: 0.1.1
First off, thanks for this great tool, it very much improves the user experience of theming!
Not sure whether this is a bug, but when picking a cursor theme I still have to set the theme manually in ~/.icons/default/index.theme
to make it visible on the plain WM layer/background (on waybar and GUI apps it's working as expected), leaving it blank will make the theme fall back to the "system" cursor.
Any ideas are appreciated,
Thanks again
Hello, I tried this out on arch linux, sway 1.7 with a couple gnome apps.
I used Adapta before and used nwg-look to try and switch to Adwaita and/or Adwaita-dark:
At first it seemed to work: easyeffects and the keyring unlock dialogue both now use the theme as shown by nwg-look's preview.
But then I noticed that galculator and evince use a light theme version instead:
Am I doing something wrong?
Is there a way to get nwg-look to work with GTK-4 apps?
So, let's say there's 'JetBrainsMono NF SemiBold 12', but there's also 'JetBrainsMono Nerd Font SemiBold 12'
Even though both variants properly change the displayed font in GTK, only first option works properly with Java Swing (If it's using GTK look and feel).
It seems to only fork if there's a font with exact family name in fc-list
https://github.com/nwg-piotr/nwg-look/blob/main/uicomponents.go#L245
https://github.com/nwg-piotr/nwg-look/blob/main/uicomponents.go#L247
Attached screenshot with the demonstration of the issue:
Top screenshot: Swing properly changes font, but nwg-look's font selector displays it as "None"
Bottom screenshot: Swing fallsback to using another font, but the font in nwg-look is properly shown
If the fonts were set by family name (which is shown in fc-list) instead of display name, that would also fix fonts in java applications.
Hello is there or in plan to have possibility to change setting directly from command line?
Could be useful to quickly change let's say GTK theme between light and dark theme via keybinding.
Something like:
nwg-look -c gtk-theme="theme-name"
Thank you!
hi when i set a size for the cursor it dosen't apply it.(it only applys it for google chrome)
i did get it working by setting the cursor in .Xresources
but i wanted to inform you with this problem
i'm using dwm on debian 12
Hello! When I run make build inside the cloned repository, the process gets stuck in github.com/gotk3/gotk3/gtk
, and doesn't proceed. I initially tried it with makepkg from the AUR, and when I encountered this error, I tried to build from source by cloning the repository and building it. Both of the attempts resulted in the same thing.
i 've installed the pkg so as to correct font issues with some gtk apps on endeavourOS (arch + plasma6) .
It does the job pretty well, but:
WARN[0000] Unsupported config key: gtk-decoration-layout
WARN[0000] Unsupported config key: gtk-enable-animations
WARN[0000] Unsupported config key: gtk-modules
WARN[0000] Unsupported config key: gtk-primary-button-warps-slider
WARN[0000] Unsupported config key: gtk-sound-theme-name
WARN[0000] Unsupported config key: gtk-xft-dpi
...
WARN[0018] Couldn't find icons folder ```
3) can you limit the production of GTK config files base on the default path of the major distros
Operating System: EndeavourOS
KDE Plasma Version: 6.0.3
Graphics Platform: Wayland
I'd like to suggest xsettings
support using xsettingsd, since some xwayland apps I've found, mostly using electron apps, only seem to follow some settings from xsettings. xsettingsd by default uses .xsettingsd
. More info about configuring it on their wiki: https://github.com/derat/xsettingsd/wiki/Settings
There is also GNOME's xsettings daemon gsd-xsettings
, but I haven't tried it and don't know how it works.
When i run nwg-look -a it's not change gtk2 theme
My icon theme is symlinked from one location to ~/.local/share/icons
, but it fails to be recognized. If I manually copy it to ~/.local/share/icons
, it functions correctly. However, I have specific reasons for preferring to use a symlink. Are there any solutions to this issue?
Requested on Reddit by someone else :-)
On your github README the screen shows default font options to choose from, but on the actual software it is missing as well as in the screen that you have on your website
I don't know any other software which could work with font settings under wlroots, so It would be nice to see it back.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.