File: panels.py

package info (click to toggle)
kitty 0.42.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 28,564 kB
  • sloc: ansic: 82,787; python: 55,191; objc: 5,122; sh: 1,295; xml: 364; makefile: 143; javascript: 78
file content (32 lines) | stat: -rwxr-xr-x 1,340 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# License: GPLv3 Copyright: 2025, Kovid Goyal <kovid at kovidgoyal.net>

import shlex
import subprocess


def r(msg: str, cmdline: str) -> None:
    try:
        q = input('Test ' + msg + '? (y/n): ').lower()
        if q in ('y', 'yes'):
            try:
                subprocess.run(['kitten'] + shlex.split(cmdline))
            except KeyboardInterrupt:
                pass
    except KeyboardInterrupt:
        raise SystemExit(1)

if __name__ == '__main__':
    r('top panel check transpareny, no input focus, margins and struts',
    'panel -o background_opacity=0.2 --edge=top --lines=2 --margin-left=50 --margin-right=100')

    r('bottom panel, check struts', 'panel -o background_opacity=0.2 --edge=bottom --lines=2 --margin-left=100 --margin-right=50')

    r('left panel, check struts', 'panel -o background_opacity=0.2 --edge=left --columns=2 --margin-top=50 --margin-bottom=100')

    r('right panel, check struts', 'panel -o background_opacity=0.2 --edge=right --columns=2 --margin-top=50 --margin-bottom=100')

    r('background, check transparency and margins and no input focus',
    'panel -o background_opacity=0.2 --edge=background --margin-top=50 --margin-bottom=50 --margin-left=100 --margin-right=100')

    r('quake, check transparency and focus on show/re-show', 'quick-access-terminal')