Giter Site home page Giter Site logo

dylanaraps / pywal Goto Github PK

View Code? Open in Web Editor NEW
8.1K 67.0 301.0 759 KB

🎨 Generate and change color-schemes on the fly.

License: MIT License

Python 86.86% CSS 4.22% Shell 1.91% C 3.06% Vim Script 0.76% Haskell 1.26% SCSS 0.66% Stylus 0.63% JavaScript 0.63%
wal colorscheme terminal-emulators changing-colorschemes

pywal's Introduction

Generate and change color-schemes on the fly.

img

Pywal is a tool that generates a color palette from the dominant colors in an image. It then applies the colors system-wide and on-the-fly in all of your favourite programs.

There are currently 5 supported color generation backends, each providing a different palette of colors from each image. You're bound to find an appealing color-scheme.

Pywal also supports predefined themes and has over 250 themes built-in. You can also create your own theme files to share with others.

The goal of Pywal was to be as out of the way as possible. It doesn't modify any of your existing configuration files. Instead it works around them and provides tools to integrate your system as you see fit.

Terminal emulators and TTYs have their color-schemes updated in real-time with no delay. With minimal configuration this functionality can be extended to almost anything running on your system.

pywal's People

Contributors

adamsdarlingtower avatar aeikenberry avatar amitpr avatar aschey avatar atagen avatar blahsd avatar danielx avatar deviantfero avatar dgrisham avatar dithpri avatar djent- avatar dylanaraps avatar furrycatherder avatar hhell avatar joshuarli avatar khoyo avatar kylosus avatar lasers avatar linuxunil avatar loiccoyle avatar ohmree avatar opatut avatar ranisalt avatar robwaz avatar scottawalton avatar sraysmith avatar threadreaper avatar timgates42 avatar vowkn avatar willeccles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pywal's Issues

Colors: Should pywal generate 8 colors and 8 greys?

Should pywal also generate 8 grey colors?

This would allow more flexibility for coloring but will require users to update their usage of the export files. If we decide to implement this it will be added in a new major release indicating that there are breaking changes.

Example:
2017-08-07-151227_726x179_scrot

Installation issues

Really liking wal and I'm happy to see it move forward like this.

Struggling to install this, however... Errors are as follows:

pip install pywal:

Collecting pywal
  Using cached pywal-0.3.7.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-s2_a_wt5/pywal/setup.py", line 13
        DOWNLOAD_URL = f"https://github.com/dylanaraps/pywal/archive/{VERSION}.tar.gz"
                                                                                     ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-s2_a_wt5/pywal/

pip3 install pywal returns the same error except the tmp directory is /tmp/pip-build-lcevfskh/pywal/, as does installing from source. Again in that case the tmp directory is different, though I'm not sure it matters.

Running pywal without installing it as outlined in CONTRIBUTING.md seems to work okay.

In any case I'm using commit b79c443 .

Turn into general color scheme manager

This tool has the potential to be more generic, and I love generic tools 😜

I'd love for wal to be able to read some generic colorscheme format (e.g. simple text based hex or something), without the "need" to generate them from an image. I actually consider this two separate parts of wal currently, and I am more interested in the former.

Use case: I sometimes sit outside with my laptop and switch my vim and terminal to a black-on-white color scheme for contrast. I have do this manually for each program. I don't bother with all the others. It would be awesome to define a few colorschemes somewhere (or download them from somewhere) and then just apply them for ALL the programs :)

Currently, wal does a pretty good job already supporting many different programs. I just can't invoke it without generating from an image.

Shouldn't be too hard, technically, right? :)

fix non-ascii character in description

The description in the setup.py starts with bytes f09f 8ea8, but you don't have an encoding set for that file.

So anyones browser/editor will display that incorrectly unless they happen to have the same settings as the ones used by you. In this case I see a white box placeholder on PyPi and when doing pip show pywal after installing pywal in a virtualbox

If that non-ascii must be there, at least add # coding: utf-8 to the top of your setup.py and insert the character you want. And check if PyPI actually displays that correctly, not just in your browser, but those on other platforms/configurations as well. Now it just look like a bug.

pywal_00

pywal_01

Wal font generation

Since I'm basically using wal's generated files and variables for styling everything, it would be cool if it was possible to also declare a central font that would be exported to css etc. such that I could use for styling everything and thereby allowing for a central font declaration for the entire system.

Setting color66 not color16

Fresh install of pywall, and generated a colorscheme from an image. When inspecting the generated scheme, I noticed that colors.css generates:

:root {
	--color0: #010408;
	--color1: #233238;
	--color2: #083647;
	--color3: #145362;
	--color4: #466A76;
	--color5: #41A4B5;
	--color6: #50ACBA;
	--color7: #65DAE8;
	--color8: #666666;
	--color9: #233238;
	--color10: #083647;
	--color11: #145362;
	--color12: #466A76;
	--color13: #41A4B5;
	--color14: #50ACBA;
	--color15: #65DAE8;
	--color66: #010408;
}

I haven't dug into the internals of pywall extensively, but that color66 should almost certainly be a color16, and pywall doesn't set color16 properly in my terminal which supports that hypothesis.

Error with pywal 0.2.1

Hi, sorry to bother you (and for my bad english)

I just installed the latest version using pip install pywal but when I run wal ... I have the following error :

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2299, in resolve
    return functools.reduce(getattr, self.attrs, module)
AttributeError: module 'pywal' has no attribute 'main'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/wal", line 11, in <module>
    load_entry_point('pywal==0.2.1', 'console_scripts', 'wal')()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2301, in resolve
    raise ImportError(str(exc))
ImportError: module 'pywal' has no attribute 'main'

OS : Debian (Stretch) / Python : 3.6
Previous version (before pywal was split in several files) worked fine.
I don't know what information you may need so I will try to provide everything you ask for.

Name change (Suggestions welcome)

wal is already registered on Pypi so I can't create a pip package using the name wal. This means I'll either have to come up with a different name solely for the Pypi site (The repo and script name will stay the same) or I rename the entire project. (I'll pick a google-able name this time.)

Anyway, suggestions are welcome. :)

Re-implement -a

Transparency is crucial for some of us. If you don't feel like implementing this, I should be able to.

TODO

If anyone wants to contribute, feel free to tackle anything below.

  • Args
    • -a
    • -f
    • -n
    • -o
    • -q
      • out() function needs to be re-added.
      • A global variable may be needed to use the -q value globally.
    • -x No longer needed. Imported schemes use all 16 colors.
  • Optimization
    • Look into running specific tasks in parallel.
      • Sending sequences to all open terminals.
    • Look into running specific tasks asynchronously.
      • Wallpaper setting.
  • Tests
    • Write some tests.
      • Any help is appreciated as I've never done this before. :)
  • Images
    • wal still calls imagemagick as a system command. Nothing I can do about this.
      • Look into libraries to perform the same task.
    • Picking a random image from a directory currently looks for all files instead of just images.
  • Wallpaper
    • Identify the desktop environment.
  • Error Handling
    • Check that the user has imagemagick installed.
  • Other
    • Add fold markers to blocks of functions like in the original script.
    • Make wal.py a pip package eventually.
    • Drop the _colors from file names.
      • They're redundant.

Mac Issues

Hi there, I just installed the latest version of Pywal on macOS and ran into an issue or two.


First was that, when I ran wal -i image.png, I'd get an error from line 87 of wallpaper.py.

The error was TypeError: unsupported operand type(s) for /: 'str' and 'str'.

It seems there was an error of some sort parsing the HOME / 'Library... bit of code. I fixed it quickly by changing it to beHOME + '/Library... instead.

After that the wallpaper set correctly.

(I'm not overly familiar with python, so I'm not sure exactly how the / worked in this scenario, but for some reason it wasn't parsing correctly for me.)


Second issue was that, when running the command it iterm2, it would change some font and tab colors, however not the background, foreground and some other main colors.

I looked at iterm's website for the syntax for switching it. And the example they show is echo -e "\033]Pg4040ff\033\\"

Doing some quick debugging, I found that wal was outputting something like: "\033[Pg4040ff\033\\".

Pretty much the same, the only difference being that the bracket was the other way around ([, instead of ] like the iterm example). I switched the bracket around on line 16 of sequences.py. And everything worked correctly going forward.

Now, I'm using the iterm2 beta (3.1.beta.5), so this bracket issue may be a change in syntax they made recently, I'm not too sure.

Anyway, not sure if these issues are effecting other Mac users, but I thought I'd post them here incase they are wider spread issues.


Another thing I'd like to mention isn't an issue, but a small thing I've done which might be a cool feature for some users (May only be applicable to iterm users, not sure).

What I did was add a small bit of text: echo -e "$(cat ~/.cache/wal/sequences)" to my .bash_profile. Which allows me to reload the color scheme when reloading my terminal, (As it the colors don't stick in iterm normally).

Move to template files for colors

Right now wal generates output files by looping over the colors and formatting them. This works for the simple output files (colors.css, colors.sh etc) but becomes overly complicated when working with more complex file formats (xcolors (xrdb)).

What I'm thinking is that we move to template files instead. These files would be identical to the current outputted files but full of markers telling wal where to put each color. This way we can also have comments in the files telling the user wal generated them as well as proper alignment etc.

XTerm vs. UXterm

Some distros, at least arch, include a unicode wrapper for XTerm named UXterm.
This wrapper will be priorities by e.g. i3-sensible-terminal which causes the colors for
foreground, background and cursorColor to not be applied.

Using xterm* instead of XTerm* will solve this problem.

xterm*foreground: <color>
xterm*background: <color>
xterm*cursorColor: <color>

Disclaimer :P
As I'm fairly new to dealing with Xresource files and just now migrated to xterm (due to sixel support) I'm not a 100% sure if this is the proper way of dealing with this issue.

vim colorscheme requires manual intervention

I have this line in my ~/.i3/config:

exec --no-startup-id wal -i ~/usr/img/wallpaper/koi-to-uso.png

After a reboot I see this:
before

vim-before

I have to run wal again to get the colors right:
after

vim-after

ERROR

Processing /home/jarron/Documents/pywal/pywal
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-4vwlnhlm-build/setup.py", line 13
DOWNLOAD_URL = f"https://github.com/dylanaraps/pywal/archive/{VERSION}.tar.gz"
^
SyntaxError: invalid syntax

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-4vwlnhlm-build/

it happens with both install methods

Install Error

I'm trying to install pywal but i get this error

user@localtest:/tmp$ sudo pip install pywal
Collecting pywal
  Using cached pywal-0.3.5.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-NG7xbN/pywal/setup.py", line 13
        DOWNLOAD_URL = f"https://github.com/dylanaraps/pywal/archive/{VERSION}.tar.gz"
                                                                                     ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-NG7xbN/pywal/
user@localtest:/tmp$ 

I've tried to remove the "f" in the DOWNLOAD_URL and now it give me this error

user@localtest:/tmp/pywal$ pip install .
Processing /tmp/pywal
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-tdf3sz-build/setup.py", line 3, in <module>
        import pywal
      File "pywal/__init__.py", line 5, in <module>
        from pywal.settings import __version__  # noqa: F401
      File "pywal/settings.py", line 12, in <module>
        CACHE_DIR = pathlib.Path.home() / ".cache/wal/"
    AttributeError: type object 'Path' has no attribute 'home'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-tdf3sz-build/

OS: Debian GNU/Linux 9.0
Kernel: 4.9.0-3-amd64
Shell: bash 4.4.12

Flatabulous-wal appearing as Raleigh

(No Issues page on Flatabulous-wal)

2017-07-28-090155_1366x768_scrot

As title says. Flatabulous-wal folder as-is from the git repo, in $HOME/.themes/

EDIT: Flatabulous vanilla works perfectly, of course with no colour change.

Missing URL in setup.py

Good afternoon,

ENV Setup:

distro: ubuntu 17.04 - daily build
uname -a: Linux 4.12.0-999-generic
python: 3.6.2rc1

I have been attempting to install pywal on my ubuntu 17.04 install and I am receiving an error upon running setup.py as per the below:

fridge@fridgebuntu:~$ pip install pywal Collecting pywal Using cached pywal-0.3.6.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-HdFFPb/pywal/setup.py", line 13 DOWNLOAD_URL = f"https://github.com/dylanaraps/pywal/archive/{VERSION}.tar.gz" ^ SyntaxError: invalid syntax

Upon inspection of setup.py it appears the URL

https://github.com/dylanaraps/pywal/archive/

doesn't exist at all, let alone a child url.

Am I missing something here? It appears as if they are just not hosted anymore.

Cheers,
Kyle.

No such file or directory: '/dev/pts/' on Mac

OS: macOS Sierra 10.12.5

Just installed with pip3, and am seeing this:

~ » sudo pip3 install pywal
Collecting pywal
Installing collected packages: pywal
Successfully installed pywal-0.5.7
~ » wal -i ~/Dropbox/Wallpapers/RdpGQ6o.jpg
image: Using image /Users/aaron/Dropbox/Wallpapers/RdpGQ6o.jpg
colors: Found cached colorscheme.
Traceback (most recent call last):
  File "/usr/local/bin/wal", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/pywal/__main__.py", line 126, in main
    process_args(args)
  File "/usr/local/lib/python3.6/site-packages/pywal/__main__.py", line 111, in process_args
    sequences.send(colors_plain, args.t)
  File "/usr/local/lib/python3.6/site-packages/pywal/sequences.py", line 48, in send
    terminals = [f"/dev/pts/{term}" for term in os.listdir("/dev/pts/")
FileNotFoundError: [Errno 2] No such file or directory: '/dev/pts/'

I'm able to run python3 -m pywal -i ~/Dropbox/Wallpapers/RdpGQ6o.jpg just fine though on the pywal-0.5.7 master branch.

Easier method of overriding color schemes

Sometimes you're lumped with a wallpaper that only uses two colours, say, and that's always been a weak point of wal. In that case, I've got a suggestion - a flag that defines only the foreground and background colors. Predefined color schemes such as the ones available on terminal.sexy would fill the rest of the colors.

Handle foreground/background colors

Currently, foreground and background are set to colors 15 and 0 respectively everywhere. Now that I can specify my own color scheme with -f (:wink:), I'd like to be able to specify different colors for these (and probably also cursorColor).

This probably needs a bit of refactoring in format_colors and export_colors, mostly. I'll see in the following days if I can prepare a little pull request 😊

Bug from pre-pywall seems back

Seems like this bug or related is back. When trying to start Dwarf Fortress I get the following:

19:17:37 user@host LinuxLNP-0.43.05-r05 ./startlnp 
Traceback (most recent call last):
  File "<string>", line 12, in <module>
  File "/home/username/df/python_lnp/build/lnp/out00-PYZ.pyz/core.lnp", line 119, in __init__
  File "/home/username/df/python_lnp/build/lnp/out00-PYZ.pyz/core.lnp", line 212, in initialize_ui
  File "/home/username/df/python_lnp/build/lnp/out00-PYZ.pyz/tkgui.tkgui", line 131, in __init__
  File "/home/username/df/python_lnp/build/lnp/out00-PYZ.pyz/Tkinter", line 1810, in __init__
_tkinter.TclError: bad cursor spec "#E0E0DF"
[WARNING] startlnp: Failed to start PyLNP

Possible to edit the way pywal works with rofi?

I don't know how to correctly describe this, so I'll try my best:

As you know, when pywal generates colorschemes to apply it to rofi through .Xresources, the colors are pretty much "absolute" - which means that if the user wants to change any part of rofi's colorscheme, he/she will have to edit by hand the .Xresources file, reload, and even then the colorset will not remain the same the next time that wallpaper is chosen, as each colors are automatically + directly stated in the file by pywal; unlike polybar, when you can dynamically set e.g. color01, color02, color03... and each bar elements can catch different colors & the way colors are chosen is persistent through wallpapers.

I think it's mostly because rofi directly takes the colors in the .Xresources, but I still want to ask: is there any way to edit how pywal implements colors for rofi so that we can achieve the same mechanics for both rofi and polybar?

Sorry if there's wordiness because I'm not a native English speaker. Thank you for reading this issue.

VTE: Garbage / Junk / Characters printed to the terminal

Workaround: Add -t to all wal commands.

This issue is open to track the issue with VTE based terminals displaying junk when sent an unrecognized escape sequence (in our case \033]708;#000000\007).

The issue has been open on VTE's bug tracker for just over 10 years now with no one willing to fix it.

This VTE bug is responsible for the following wal/pywal issues:

I've written a patch for VTE that works-around the issue by making VTE just ignore the sequence. I've tested the patch in multiple terminal emulators and it works just fine. Now I just need to figure out the right way to submit this upstream. (Any help is appreciated)

I've based the patch on a pre-existing patch that does the identical to below but for another sequence. You can see the patch my patch was based on here: https://mail.gnome.org/archives/commits-list/2016-July/msg00635.html

The patch:

From f5e1ff373efc322adc6eddd5d5284b388ec29370 Mon Sep 17 00:00:00 2001
From: Dylan Araps <[email protected]>
Date: Wed, 2 Aug 2017 15:31:01 +1000
Subject: [PATCH 1/1] emulation: Swallow ursvt OSC 708

Accept OSC 708 but make it a no-op.

This sequence is used in color changing programs and scripts to
change the terminal emulator's border color on the fly. Everytime
this sequence is used it clutters up the vte terminal since it
doesn't ignore unknown escape sequences (bug 403130).

https://bugzilla.gnome.org/show_bug.cgi?id=403130
---
 src/caps.cc        |  2 ++
 src/vteseq-n.gperf |  1 +
 src/vteseq.cc      | 10 ++++++++++
 3 files changed, 13 insertions(+)

diff --git a/src/caps.cc b/src/caps.cc
index 1f9cd1e..5d95114 100644
--- a/src/caps.cc
+++ b/src/caps.cc
@@ -256,6 +256,7 @@ const char _vte_xterm_capability_strings[] =
         ENTRY(OSC "118" BEL, "reset-tek-cursor-color")
         ENTRY(OSC "119" BEL, "reset-highlight-foreground-color")
         ENTRY(OSC "133;%s" BEL, "iterm2-133")
+        ENTRY(OSC "708;%s" BEL, "urxvt-708")
         ENTRY(OSC "777;%s" BEL, "urxvt-777")
         ENTRY(OSC "1337;%s" BEL, "iterm2-1337")
 
@@ -295,6 +296,7 @@ const char _vte_xterm_capability_strings[] =
         ENTRY(OSC "118" ST, "reset-tek-cursor-color")
         ENTRY(OSC "119" ST, "reset-highlight-foreground-color")
         ENTRY(OSC "133;%s" ST, "iterm2-133")
+        ENTRY(OSC "708;%s" ST, "urxvt-708")
         ENTRY(OSC "777;%s" ST, "urxvt-777")
         ENTRY(OSC "1337;%s" ST, "iterm2-1337")
 
diff --git a/src/vteseq-n.gperf b/src/vteseq-n.gperf
index eec89ae..6e0baf8 100644
--- a/src/vteseq-n.gperf
+++ b/src/vteseq-n.gperf
@@ -170,6 +170,7 @@ struct vteseq_n_struct {
 "set-current-directory-uri", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_current_directory_uri)
 "set-current-file-uri", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_current_file_uri)
 "set-current-hyperlink", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_current_hyperlink)
+"urxvt-708", VTE_SEQUENCE_HANDLER(vte_sequence_handler_urxvt_708)
 "urxvt-777", VTE_SEQUENCE_HANDLER(vte_sequence_handler_urxvt_777)
 "iterm2-133", VTE_SEQUENCE_HANDLER(vte_sequence_handler_iterm2_133)
 "iterm2-1337", VTE_SEQUENCE_HANDLER(vte_sequence_handler_iterm2_1337)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 1391e15..9700d1b 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -3499,6 +3499,16 @@ vte_sequence_handler_reset_highlight_foreground_color (VteTerminalPrivate *that,
 	that->reset_color(VTE_HIGHLIGHT_FG, VTE_COLOR_SOURCE_ESCAPE);
 }
 
+/* URXVT generic OSC 708 */
+
+static void
+vte_sequence_handler_urxvt_708(VteTerminalPrivate *that, GValueArray *params)
+{
+        /* Accept but ignore this for compatibility when using terminal color
+         * changing scripts.
+         */
+}
+
 /* URXVT generic OSC 777 */
 
 static void
-- 
2.13.3

Shebang interpreter should point to python3

Since pywal is only compatible with python>=3.6 the script should be instructed to run using python3 instead of python.

See PEP 394

Abstract

This PEP provides a convention to ensure that Python scripts can continue to be portable across *nix systems, regardless of the default version of the Python interpreter (i.e. the version invoked by the python command).

  • python2 will refer to some version of Python 2.x.
  • python3 will refer to some version of Python 3.x.
  • for the time being, all distributions should ensure that python refers to the same target as python2.
  • however, end users should be aware that python refers to python3 on at least Arch Linux (that change is what prompted the creation of this PEP), so python should be used in the shebang line only for scripts that are source compatible with both Python 2 and 3.
  • in preparation for an eventual change in the default version of Python, Python 2 only scripts should either be updated to be source compatible with Python 3 or else to use python2 in the shebang line.

Mac X11 issue

Hi Again,

I've noticed a weird bug with pywal interacting with my Mac's Xquartz (x11) installation. As far as I can tell, whenever I run the wal command, and the xquartz app is not open, the command will freeze when refreshing the environments, and just sit there.

I've tracked down the error specifically to xrdb command in reload.py (line 19/20ish). It seems that the xrdb command will freeze on mac and wait for xquartz to open if it isn't open already.

Anyway, I fixed the issue by chaning line 18 of reload.py.

I changed
if shutil.which("xrdb"):
to
if shutil.which("xrdb") and OS != "Darwin":)

I also added OS to the import from .settings (Line 10), so I could use that variable there.

Once this was added, it bypassed the xrdb command and allowed the env to refresh normally.

(I haven't used python in a few years, so there may be a simpler fix for this, but it worked for me.)


I also tested pywal without xquartz installed, and everything worked correctly, so it seems to only happen when Xquartz is installed.

I wish I could help figure out why this issue was happening with Xquartz, but I'm not familiar enough with how X11 works on mac to be able to.

invalid syntax with pip install .

Hi,

When following the manual install from git (https://github.com/dylanaraps/pywal#manualgit-install ) we get a invalid syntax error

$ pip install .
Processing pywal
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-oes2dE-build/setup.py", line 13
        DOWNLOAD_URL = f"https://github.com/dylanaraps/pywal/archive/{VERSION}.tar.gz"
                                                                                     ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-oes2dE-build/

removing the f in the download url and running the setup again gives another error

$ pip install .
Processing pywal
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-m6BX2X-build/setup.py", line 3, in <module>
        import pywal
      File "pywal/__init__.py", line 5, in <module>
        from pywal.settings import __version__  # noqa: F401
      File "pywal/settings.py", line 11, in <module>
        CACHE_DIR = pathlib.Path.home() / ".cache/wal/"
    AttributeError: type object 'Path' has no attribute 'home'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-m6BX2X-build/

Running Ubuntu Xenial 16.04

pahtlib version:

$ pip list | grep pathlib
pathlib (1.0.1)

Not getting past writing colors in save_file

Seems to be getting stuck at writing colors or something, when i run
wal -i ~/wallpapers/16.9/
never exits and when I hit ^c twice

~
❯ wal -i ~/wallpapers/16.9    
image: Using image /home/aerol/wallpapers/16.9/FVgljW7.jpg
colors: Generating a colorscheme...
colors: Generated colorscheme
wallpaper: Set the new wallpaper
Gtk-Message: Failed to load module "gail"
Gtk-Message: Failed to load module "atk-bridge"
^C^CKeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/wal", line 9, in <module>
    load_entry_point('pywal==0.3.6', 'console_scripts', 'wal')()
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/__main__.py", line 118, in main
    process_args(args)
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/__main__.py", line 105, in process_args
    sequences.send_sequences(colors_plain, args.t)
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/sequences.py", line 51, in send_sequences
    [util.save_file("".join(sequences), term) for term in terminals]
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/sequences.py", line 51, in <listcomp>
    [util.save_file("".join(sequences), term) for term in terminals]
  File "/usr/local/lib/python3.6/dist-packages/pywal-0.3.6-py3.6.egg/pywal/util.py", line 59, in save_file
    file.write(colors)
KeyboardInterrupt

Running Maui Linux 17.03, Ubuntu 16.04 based.
Odd thing is, it doesn't always happen, but it happens more so than not.

Wallpaper turning black

Hey there,
I've been having an issue where wal seems to change the desktop to an all black image. It changes the colorscheme in the open terminals and vim but the wallpaper gets messed up. It may have to do with a messy install I had, since Python 3.6 doesn't seem to be what pip uses on my system, so I installed it via "sudo -H python3.6 -m pip install pywal". I installed pywal once before and it was working great, but uninstalled and reinstalled it and that's when the issues started. As for my system, I'm running Ubuntu 17.04 with Gnome using the Gnome terminal. The command I'm using for wal is simply "wal -t -i ~/Pictures/Wallpapers/wallpaper.jpg"

Dual monitor issue

I am using one 1920x1080 monitor as my primary monitor, and a 1280x1024 monitor as my secondary monitor. Whenever I reboot, the wallpaper switches monitor, meaning the wallpaper scaled for 1280x1024 ends up on the 1920x1080 monitor, and wallpaper scaled for 1920x1080 ends up on the 1280x1024 monitor. Running wal -i fixes the issue, but this means that I need to run pywal every time.

Impossible to launch

When installing using
sudo pip install pywal

or

git clone ... cd pywal pip install pywal

it install correctly but whenever I try to launch it says:

➜ ~ wal -t -i /home/yolan/Pictures/Wallpapers/Final/ Traceback (most recent call last): File "/usr/bin/wal", line 11, in <module> load_entry_point('pywal==0.5.6', 'console_scripts', 'wal')() File "/usr/lib/python3.6/site-packages/pywal/__main__.py", line 126, in main process_args(args) File "/usr/lib/python3.6/site-packages/pywal/__main__.py", line 100, in process_args image_file = image.get(args.i) File "/usr/lib/python3.6/site-packages/pywal/image.py", line 37, in get wal_img = get_random_image(image) File "/usr/lib/python3.6/site-packages/pywal/image.py", line 16, in get_random_image current_wall = os.path.basename(current_wall) File "/usr/lib/python3.6/posixpath.py", line 144, in basename p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType

Also, I can't install it using AUR because it says

:: Installing python-pywal package(s)... :: python-pywal package(s) failed to install. :: ensure package version does not mismatch between .SRCINFO and PKGBUILD :: ensure package name has a VCS suffix if this is a devel package
Just to let you know.
Thanks !

Alacritty doesn't seem to be working with wal

I installed Void Linux today and finally managed to get pywal working (it only has py3.5 so I compiled 3.6.1 with pyenv) and since it doesn't have Termite (my go-to terminal) in it's repos I decided to try Alacritty (it's supposed to be fast). So turns out it's dash-fast, as in "lacks too many useful features" (probably because it's still in alpha). The printf "%b" "\033]11;#ff0000\007" does nothing so I guess you should add it to the list. I tried to make it work with wal by having a config.yml that contains non-color options and an auto-generated colors.yml that has colors (used termcolors to convert to Alacritty's format), what I did was add this function:

function fix_alacritty() {
	local dir="${HOME}/.config/alacritty"
	rm "${dir}/alacritty.yml"
	cat "${dir}/config.yml" "${dir}/colors.yml" >> "${dir}/alacritty.yml"
}

And call it in the script that gets executed after wal, turns out Alacritty needs everything to be in specific positions for the thing to work (it is possible with some mad regex-foo or yaml parsing, both of which I'm no good at and not going to try doing since the benefits aren't that good, not being able to change colors on the fly is a bummer)

So I guess it's not really an issue with wal but I'm just letting you know

pathlib seems to have broken, help?

Traceback (most recent call last): File "/usr/bin/wal", line 11, in <module> load_entry_point('pywal==0.5.11', 'console_scripts', 'wal')() File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 564, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2662, in load_entry_point return ep.load() File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2316, in load return self.resolve() File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2322, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/usr/lib/python3.6/site-packages/pywal/__init__.py", line 12, in <module> from .settings import __version__ File "/usr/lib/python3.6/site-packages/pywal/settings.py", line 19, in <module> HOME = pathlib.Path.home() AttributeError: type object 'Path' has no attribute 'home'

I cloned and used https://github.com/ritiek/spotify-downloader. Immediately after, every time I open a terminal it spits out the above error. You can fix it by reinstalling pywal, but I'm curious as to why it breaks. Any ideas?

GTK3 programs and Thunar not updating on the fly.

So the issue that I'm having atm is when I update the GTK theme, most application are updated instantly or showing the new color on restart except my gtk of the terminal (urxvt) (not the terminal itself).

I tried to restart the terminal without any success. It updates on reboot or reapplying the GTK-theme though. Im new to this software and will do some further research. I'm using Archlinux with Gnome-desktop and urxvt with fish shell.

Missing setuptools.

When I go to install pywal I get this error "Could not import setuptools which is required to install from a source distribution." If I try to manually I get this "Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-ocxvniqa-build/" Not sure if im missing something here.

weechat support?

Is it possible to add a weechat theme? Right now there is horribly low contrast in the bars. Sorry, I don't know much about weechat. I just started using it today.

image

Pywal inaccessible from terminal

In what was likely a futile attempt to get Python 3.6 working with pip, I used the following workaround in my .bashrc: alias "pip3.6"="python3.6 -m pip $1". Now, when I run pip list, pip3 list and pip3.6 list, I get three different outputs. pywal is only present on the last of those, naturally, and is located at ~/.local/lib/python3.6/site-packages/pywal.

Adding this directory to my $PATH hasn't changed anything, and installing from source doesn't magically take it to some different directory. When searching for pywal's install location, that directory was the only thing that turned up, but I still feel like I'm missing something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.