Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script fails under Windows 10 #7

Open
Snowflake6 opened this issue Jul 18, 2019 · 7 comments
Open

Script fails under Windows 10 #7

Snowflake6 opened this issue Jul 18, 2019 · 7 comments

Comments

@Snowflake6
Copy link

Not sure this is completely fixed. I just tried this and i'm getting a similar error returned when I try to run it under WSL (Ubuntu 18.04):

user@LAPTOP:~$ ./darkSlack.sh
ls: cannot access '/Users/First.Last/AppData/Local/slack/app*/': No such file or directory
Bringing Slack into the darknesss...

This script requires sudo privileges.
You'll need to provide your password.
tee: /Users/First.Last/AppData/Local/slack//resources/app.asar.unpacked/dist/ssb-interop.bundle.js: No such file or directory

Slack Updated! Refresh or reload slack to see changes
user@LAPTOP:~$

I'll add that there is no ssb-interop.bundle.js in the install tree for Slack 4.0.0 on Win 10 either. So unless this script is supposed to create it, I don't know how it gets there?

Update: I added a bunch of echo statements to try and diagnose why it's not finding things. That showed me that it wasn't populating the USERPROFILE_* variables, which meant it wasn't populating WIN_HOME properly or APP_VER, etc. etc. That's now fixed, but it still fails with a permission error:

user@LAPTOP:~$ ./darkSlack.sh
WIN_HOME_RAW=  C:\Users\First.Last
USERPROFILE_DRIVE=  C:
USERPROFILE_MNT=  /mnt/c
USERPROFILE_DIR=  \Users\First.Last
WIN_HOME=  /mnt/c/Users/First.Last
APP_VER= /mnt/c/Users/First.Last/AppData/Local/slack/app-4.0.0/ /mnt/c/Users/First.Last/AppData/Local/slack/app-3.4.3/
SLACK_RESOURCES_DIR=  /mnt/c/Users/First.Last/AppData/Local/slack/app-4.0.0/resources
Bringing Slack into the darknesss...

This script requires sudo privileges.
You'll need to provide your password.
EACCES: permission denied, open '/mnt/c/Users/First.Last/AppData/Local/slack/app-4.0.0/resources/app.asar.unpacked/node_modules/@nodert-win10-au/windows.data.xml.dom/build/Release/binding.node'

Slack Updated! Refresh or reload slack to see changes
user@LAPTOP:~$

If I run the same script as sudo ./darkSlack.sh, I get this instead:

user@LAPTOP:~$ sudo ./darkSlack.sh
WIN_HOME_RAW=
USERPROFILE_DRIVE=  :
USERPROFILE_MNT=  /mnt/c
USERPROFILE_DIR=
WIN_HOME=  /mnt/c
ls: cannot access '/mnt/c/AppData/Local/slack/app*/': No such file or directory
APP_VER=
SLACK_RESOURCES_DIR=  /mnt/c/AppData/Local/slack//resources
Bringing Slack into the darknesss...

This script requires sudo privileges.
You'll need to provide your password.
tee: /mnt/c/AppData/Local/slack//resources/app.asar.unpacked/dist/ssb-interop.bundle.js: No such file or directory

Slack Updated! Refresh or reload slack to see changes
user@LAPTOP:~
@Snowflake6
Copy link
Author

Oh, and note that I had to hard-code the value of /mnt/c for USERPROFILE_MNT. It won't find that no matter what I try. That's why it shows up when I run it via sudo.

@Snowflake6
Copy link
Author

Update: As per comments in this thread:
https://github.com/widget-/slack-black-theme/issues/98
I tried exiting Slack and running the script again. This time it completes, however, now Slack won't start.
Java_Error

@Snowflake6
Copy link
Author

Snowflake6 commented Jul 18, 2019

Update:

Re-installed Slack over top of my non-working install.
Confirmed working with white (stock) backgrounds.
Closed Slack window, then Exited Slack using the taskbar-tray icon.
Ran script in WSL. Took longer than last time, but finished.
Started Slack, and it works! Back to dark theme.

@ransagy
Copy link

ransagy commented Jul 19, 2019

The USERPROFILE_MNT part has to do with escaping, i guess. the findmnt command itself works if your hard-code "C:\" as the lookup string but won't work when using said variable that contains the same value.
Didn't find a way to escape it properly either and hard-coded the same value you did.

For me however, It still doesn't work. I still get the stock white backgrounds as if it won't load the DOM event at all.

@kurtzberger
Copy link

I ended up having to change USERPROFILE_DRIVE="${WIN_HOME_RAW%%:*}:" to USERPROFILE_DRIVE="${WIN_HOME_RAW%%:*}:\\" to get the script to work on Windows.

This worked for me. I also mentioned this on https://github.com/widget-/slack-black-theme/issues/98

@Snowflake6
Copy link
Author

@kurtzberger confirmed. Adding the double backslash fixes the detection of folders. Looks like the script is now functional on my end.

@benjamhooper
Copy link

If you're using windows use this in powershell (running in Administrator mode):

iex (new-object net.webclient).downloadstring('https://raw.githubusercontent.com/benjamhooper/slack-custom-theme/master/slackcustomtheme.ps1')

Run this for a custom slack theme, just use this repo's theme. The raw link: https://raw.githubusercontent.com/earlduque/Slack-Dark-Theme/master/dark.css

If you have issues, please visit here: https://github.com/benjamhooper/slack-custom-theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants