deviantfero / wpgtk

:flower_playing_cards: a colorscheme, wallpaper and template manager for *nix
http://deviantfero.github.io/wpgtk/
GNU General Public License v2.0
2.04k stars 49 forks source link

Not all commands run after setting theme #161

Closed cjstock closed 4 years ago

cjstock commented 5 years ago

I created a script reset_gtk #!/bin/zsh gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark; gsettings set org.gnome.desktop.interface icon-theme Adwaita; gsettings set org.gnome.desktop.interface gtk-theme FlatColor; gsettings set org.gnome.desktop.interface icon-theme flattrcolor;

I can run the script no problem from the command line, however, if I add it to the commands to execute after setting the wallpaper, it doesn't run.

deviantfero commented 5 years ago

wpgtk only runs one command, not a lista of commands, are you trying to run more than one? You could place all your commands in be script and run that instead

On Fri, Aug 9, 2019, 11:36 PM Corey Stock notifications@github.com wrote:

I created a script reset_gtk `#!/bin/zsh Resets GTK theme

gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark; gsettings set org.gnome.desktop.interface icon-theme Adwaita; gsettings set org.gnome.desktop.interface gtk-theme FlatColor; gsettings set org.gnome.desktop.interface icon-theme flattrcolor;`

I can run the script no problem from the command line, however, if I add it to the commands to execute after setting the wallpaper, it doesn't run.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/deviantfero/wpgtk/issues/161?email_source=notifications&email_token=ACVCGSIPI4GDEH6S4XWUSGTQDZHWVA5CNFSM4IKYUHLKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HEQPMRQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ACVCGSMXD7EELA75HD2P6CLQDZHWVANCNFSM4IKYUHLA .

cjstock commented 5 years ago

I have a script called reset_gtk with the following contents:

#!/bin/zsh xrdb -merge ~/.Xresources-regolith-1.2.15; i3-msg reload; i3-msg restart; gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark; gsettings set org.gnome.desktop.interface icon-theme Adwaita; gsettings set org.gnome.desktop.interface gtk-theme FlatColor; gsettings set org.gnome.desktop.interface icon-theme flattrcolor; Here is the command I use to run the script in wpgtk: source ~/myscripts/reset_gtk

When I set a new wallpaper, the gsettings commands don't seem to run, as all programs other than my terminal still use the old theme. If I run the script directly from the terminal, it works perfectly, and my gtk applications now use the new theme.

deviantfero commented 5 years ago

could you try: zsh -c /path/to/script?

cjstock commented 5 years ago

That doesn't seem to work either. The main purpose of the script is to apply the new colorscheme to my gtk applications. For some reason the "Reload GTK+" feature in the options of wpgtk doesn't work, so I'm trying to do it manually.

deviantfero commented 5 years ago

The "Reload GTK+" only works with the included theme, I'll keep this in mind for future releases, but could you post the log of applying a theme there? any errors should appear on the console, try to do a wpg -m from the console

cjstock commented 5 years ago

I see. Here is the ouput of wpg -m


[i] image         Using image flower_2560x1440.jpg.
[i] theme         Set theme to _home_corey__config_wpg_wallpapers_flower_2560x1440_jpg_dark_wal__1.1.0.json.
[i] colors        Found cached colorscheme.
[i] sequences     Set terminal colors.
[i] export        Exported all files.
[i] export        Exported all user files.
[i] color         wrote: icon-step1
[i] color         wrote: _etc_rofi.conf
[i] color         wrote: corey_Xresources.d_color-wpg
[i] color         wrote: gtk2
[i] color         wrote: corey_Xresources.d_i3-wm
[i] color         wrote: gtk3.0
[i] color         wrote: gtk3.20
[i] color         wrote: corey_Xresources.d_i3xrocks
[i] wallpaper     Set the new wallpaper.
➜  ~ [{"success":true}]                                                                                          
➜  ~  ```
bilaal-s commented 5 years ago

@deviantfero Hey! thanks for your help and building this amazing tool! I would like to contribute the following to this issue:

I have noticed that when I run a command to update the lockscreen with a script called betterlockscreen (takes a few seconds to run), something wierd happens:

bilaal@starshot ~/dev/computer-setup                                    [13:05:22] 
> $ wpg -s ~/Pictures/rain-drops-mac.jpg                    ⬡ 10.16.0 [±master ●●]
[i] image         Using image rain-drops-mac.jpg.
[i] theme         Set theme to _home_bilaal_Pictures_rain-drops-mac_jpg_dark_wal__1.1.0.json.
[i] colors        Found cached colorscheme.
[i] sequences     Set terminal colors.
[i] export        Exported all files.
[i] export        Exported all user files.
[i] color         wrote: icon-step1
[i] color         wrote: gtk3.0
[i] color         wrote: gtk2
[i] color         wrote: gtk3.20
[i] color         wrote: tmux
[i] color         wrote: i3
[i] color         wrote: polybar
[i] color         wrote: wal-color-theme.json
[i] wallpaper     Set the new wallpaper.
Tmux reloaded!

bilaal@starshot ~/dev/computer-setup                                    [13:05:31] 
Got 2880x1800 /home/bilaal/.cache/i3lock/2880x1800
> $ Generating alternate images based on the image you specified,16.0 [±master ●●]
please wait this might take few seconds...

Converting provided image to match your resolution...
> $                                                         ⬡ 10.16.0 [±master ●●]
Applying dim, blur, and pixelation effect to resized image

Caching images for faster screen locking
> $                                                                                                                                             ⬡ 10.16.0 [±master ●●]
All required changes have been applied

wpgtk creates the config files from their base files fine, then it goes on run the script and the first command is to reload the tmux.conf file, which works fine. Then the script executes the betterlockscreen script, but wait, the first line of my prompt returns... ??? then the script carries on and my prompt returns... ??? it seems my prompt is returning multiple times but the betterlockscreen script is still outputting to the terminal.

the command I am using in wpgtk is:

command = ~/dev/computer-setup/scripts/afterColorise.sh

where afterColorise is an executable script. the contents of the script are:

tmux source-file ~/.tmux.conf && echo "Tmux reloaded!" && betterlockscreen -u $(cat ~/.fehbg | awk 'NR==2 {print $3}' | tr -d \')

I have tried:

command = source ~/dev/computer-setup/scripts/afterColorise.sh

as well as using zsh -c.

Any help would be appreciated! :+1:

cjstock commented 4 years ago

I stopped trying to call the script after wpg. Instead, in my 'afterColorise.sh' I first call a wpg command:

!/bin/bash

Sets randcom theme and handles fixes

wpg -m; xrdb -merge ~/.Xresources-regolith; i3-msg reload; i3-msg restart; gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark; gsettings set org.gnome.desktop.interface icon-theme Adwaita; gsettings set org.gnome.desktop.interface gtk-theme FlatColor; gsettings set org.gnome.desktop.interface icon-theme flattrcolor; spicetify update;

deviantfero commented 4 years ago

@cjstock did you try to run this script with bash, like this bash ~/afterColorise.sh? @bilaal-s you get this output, but does the command actually work?

bilaal-s commented 4 years ago

@deviantfero Yes the command does work, to be honest, I have noticed this occurring with different programs so I don't think the problem I am having is a wpgtk issue. I only recently realized this ( I am new to linux, sorry). alas, it would be cool to know why this is happening.