justbuchanan / i3scripts

My scripts for enhancing i3wm
Other
162 stars 45 forks source link

autoname_workspaces error Non-ASCII character #30

Closed ghost closed 5 years ago

ghost commented 5 years ago

i found autoname_workspaces.py yesterday and really like the idea, but i cant get it working as intended with my polybar. python .config/i3/autoname_workspaces.py gives me this error, and its not showing any icons.

  File ".config/i3/autoname_workspaces.py", line 208
SyntaxError: Non-ASCII character '\xe2' in file .config/i3/autoname_workspaces.py on line 208, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

i've made the changes in my i3 config according to the autoname_workspaces.py instructions, and also in polybar config i've changed %index% to %name%. i've installed the dependencies

justbuchanan commented 5 years ago

What version of python are you running? I only use the script with python 3, so it's possible it doesn't work quite right with python 2.

ghost commented 5 years ago

What version of python are you running? I only use the script with python 3, so it's possible it doesn't work quite right with python 2.

i have Python 2.7.16 and Python 3.7.3 installed, but the autoname script pointing to #!/usr/bin/env python3. running on debian buster if that matters

justbuchanan commented 5 years ago

When you run the script directly like ./autoname_workspaces.py, the #!/usr/bin/env python3 line at the top of the file is read to determine how to launch it. However if you do python autoname_workspaces.py, that line is ignored and the script is run with python. My guess is that on your system, python is a symlink to python2.

ghost commented 5 years ago

@justbuchanan intresting, now its working. had to start it one time manually and now it starts with i3, thats weird. another thing is, its working, but not showing any icons. just 1: instead of just 1.

getting error like this from polybar warn: Dropping unmatched character  (U+f120) does it not find fontawesome?

justbuchanan commented 5 years ago

Yeah you probably need to configure polybar to use font awesome. This might help: https://github.com/polybar/polybar/issues/1301.