You are not logged in.
Hello together,
i installed i3 and unsed this configuration files to make it look nice:
reddit post:
i3 everything
dotfiles (lemonbar and workspace script)
it works all execpt one thing. I get errors from the workspace-idicator-script:
when I run "sh startbar"
File "/home/****/.config/lemonbar/workspace", line 48, in <module>
print(workspace_string, flush=True)
UnicodeEncodeError: 'ascii' codec can't encode character '\uf111' in position 13: ordinal not in range(128)Has probably something todo with that:
#!/usr/bin/env python3
import i3ipc
# Create the Connection object that can be used to send commands and subscribe
# to events.
i3 = i3ipc.Connection()
coloractive = '%{F#eeeeee}'
colorinactive = '%{F#93a0aa}'
colorwarning = '%{F#e84f4f}'
# Define a callback to be called when you switch workspaces.
def on_workspace_focus(self, e):
workspace_string = ' '
workspaces = i3.get_workspaces()
ws_nums = [int(n['num']) for n in workspaces]
focused = [n['visible'] for n in workspaces].index(True)
urg = [n for n, _ in enumerate(workspaces) if workspaces[n]['urgent'] == True]
names =[''.join([i for i in n['name'] if not i.isdigit()]) for n in workspaces]
for n in range(len(ws_nums)):
if focused == n:
workspace_string += coloractive + names[n] + ' '
elif n in urg:
workspace_string += colorwarning + names[n] + ' '
else:
workspace_string += colorinactive + names[n] + ' '
print(workspace_string, flush=True)
workspace_string = ' '
workspaces = i3.get_workspaces()
ws_nums = [int(n['num']) for n in workspaces]
focused = [n['visible'] for n in workspaces].index(True)
urg = [n for n, _ in enumerate(workspaces) if workspaces[n]['urgent'] == True]
names =[''.join([i for i in n['name'] if not i.isdigit()]) for n in workspaces]
for n in range(len(ws_nums)):
if focused == n:
workspace_string += coloractive + names[n] + ' '
elif n in urg:
workspace_string += colorwarning + names[n] + ' '
else:
workspace_string += colorinactive + names[n] + ' '
print(workspace_string, flush=True)
# Subscribe to events
i3.on('workspace', on_workspace_focus)
# Start the main loop and wait for events to come in.
i3.main()Does anybody have an idea how I to fix that?
Thank you!
Last edited by tritri (2017-01-15 22:22:00)
Offline
I have no idea what the problem is, but you tricked me into looking up "unixporn". You, sir, win 3 internets.
Offline
Hehe.
Still I hope someone can help me ![]()
Offline
I fixed it by myself. I had the wrong locale settings. Sorry.
Offline
If you think others might benefit, post your solution and mark the thread [solved].
Offline
I don't know excatly what I had for a locale configured.
I did:
localectl set-locale LANG=en_US.UTF-8After that it worked.
Thanks for the awesome Forum here
[solved]
Last edited by tritri (2017-01-15 22:20:37)
Offline