scaryrawr / winwal

A PowerShell wrapper around the pywal tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't find wal

soarn opened this issue · comments

commented

I've been trying to get this to work for the better part of an hour and it just keeps giving me this. I did install all the dependencies beforehand aswell.

I'll gladly provide any other information needed.

PS C:\Users\soarn> Update-WalTheme
wal : The term 'wal' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\soarn\winwal\winwal.psm1:141 char:9
+         wal -n -e -s -t -i $tempImg --backend $Backend
+         ~~~
    + CategoryInfo          : ObjectNotFound: (wal:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Get-Content : Cannot find path 'C:\Users\soarn\.cache\wal\windows-terminal.json' because it does not exist.
At C:\Users\soarn\winwal\winwal.psm1:94 char:23
+ ... alTheme = $(Get-Content "$HOME/.cache/wal/windows-terminal.json" | Co ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\soarn\...s-terminal.json:String) [Get-Content], ItemNotFoundEx
   ception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Get-Content : Cannot find path 'C:\Users\soarn\.cache\wal\windows-terminal.json' because it does not exist.
At C:\Users\soarn\winwal\winwal.psm1:94 char:23
+ ... alTheme = $(Get-Content "$HOME/.cache/wal/windows-terminal.json" | Co ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\soarn\...s-terminal.json:String) [Get-Content], ItemNotFoundEx
   ception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Copy-Item : Cannot find path 'C:\Users\soarn\.cache\wal\wal-prompt.ini' because it does not exist.
At C:\Users\soarn\winwal\winwal.psm1:65 char:5
+     Copy-Item -Path "$HOME/.cache/wal/wal-prompt.ini" -Destination "$ ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\soarn\.cache\wal\wal-prompt.ini:String) [Copy-Item], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

Could not find or load "wal.ini"

Hello @soarn !

It looks like it cannot find pywal on your path (winwal is just a powershell wrapper around pywal for use on Windows).

Depending on how you install python, it may required additional steps to have python installs on your path (the Windows Store version of Python does not add the scripts directory to the PATH environment variable automatically).

I think I do need to update the script to be more helpful in this case and error gracefully 😅.

If you do:

pip install pywal

Does it mention anything about a scripts directory not being on PATH?
Are you using the Windows Store version of Python?

Thanks!

commented
PS C:\Users\soarn> pip install pywal
Requirement already satisfied: pywal in c:\python311\lib\site-packages (3.3.0)
PS C:\Users\soarn> python -m pip install pywal
Requirement already satisfied: pywal in c:\python311\lib\site-packages (3.3.0)
PS C:\Users\soarn> pip3 install pywal
Requirement already satisfied: pywal in c:\python311\lib\site-packages (3.3.0)
PS C:\Users\soarn> pip3.11 install pywal
Requirement already satisfied: pywal in c:\python311\lib\site-packages (3.3.0)

My path has C:\Python311 as a global. My global path also has the scripts directory.
I'm not using the Windows Store version either, mine was installed with Chocolatey.
image

Thanks @soarn for sharing the information and screenshots.

I'll try to see if I can repro myself with a chocolately install of Python. I don't see wal.exe in the screenshot which is unexpected.

I'll be traveling a bit today and tomorrow, but will update this thread when I get the chance.

@soarn when using the chocolatey install, I got an error when trying to install pywal towards the end if I tried install in a regular terminal instead of admin terminal. I had to uninstall and reinstall pywal to get the wal.exe to appear.

If I installed it with pip install --user pywal. The wal.exe ended up in %APPDATA%\Roaming\Python\Python311\Scripts, but it wasn't in my environment variables.

I think you'd want to update your environment variable for PATH to include the %APPDATA%\Roaming\Python\Python311\Scripts and reinstall pywal with the --user option, or uninstall and reinstall pywal as administrator (the first one to me personally seems more "secure" since it doesn't give any install scripts admin privileges, that said I don't find pywal suspicious, just my tendency to typo things).

I'll leave this bug open to work on updating things so the script fails more gracefully and is a bit more resilient. Thanks!

commented

image
That was indeed my issue, thank you so much for your help!