Skip to content

Instantly share code, notes, and snippets.

@97-109-107
Last active September 19, 2019 15:46
Show Gist options
  • Save 97-109-107/a4b802197d8b5ca6f54e to your computer and use it in GitHub Desktop.
Save 97-109-107/a4b802197d8b5ca6f54e to your computer and use it in GitHub Desktop.
get the size of current screen in i3wm
#!/usr/bin/env python
import i3
def getCurrentScreen():
workspace = [ws for ws in i3.get_workspaces() if ws['focused']][0]
screen_w =str(workspace['rect']['width'])
screen_h =str(workspace['rect']['height'])
print(screen_w, screen_h);
getCurrentScreen();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment