diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2020-12-16 02:12:41 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2020-12-16 02:12:41 +0100 |
| commit | 004162c05e42a2f2645ca06702567967b1d88961 (patch) | |
| tree | 18319b9654b8ec561524a58fed0fd3af7131647e /bspwm | |
| parent | 2f694c9ab1416de12d6c5da47d384a625662edf1 (diff) | |
.
Diffstat (limited to 'bspwm')
| -rwxr-xr-x | bspwm/bspwmrc | 8 | ||||
| -rw-r--r-- | bspwm/terminal.py | 46 | ||||
| -rwxr-xr-x | bspwm/terminal.sh | 3 |
3 files changed, 7 insertions, 50 deletions
diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc index f6d3a99..99cc457 100755 --- a/bspwm/bspwmrc +++ b/bspwm/bspwmrc @@ -2,10 +2,14 @@ sxhkd -c ~/.config/bspwm/sxhkdrc & ~/.config/polybar/launch.sh & +wmname compiz -bspc monitor primary -d 1 2 3 4 term -[ $(xrandr --listactivemonitors | wc -l) -gt 2 ] && \ +if [ $(xrandr --listactivemonitors | wc -l) -gt 2 ]; then + bspc monitor primary -d 1 2 3 4 term bspc monitor primary#next -d a s d f +else + bspc monitor primary -d 1 2 3 4 a s d f term +fi bspc config border_width 4 bspc config window_gap 0 diff --git a/bspwm/terminal.py b/bspwm/terminal.py deleted file mode 100644 index eee7875..0000000 --- a/bspwm/terminal.py +++ /dev/null @@ -1,46 +0,0 @@ -import subprocess - - -desktop_name = 'term' -instance_name = 'tmux_term' - - -def is_term_running(): - p = subprocess.run(['xdo', 'id', '-n', instance_name]) - return p.returncode == 0 - - -def run_term(): - subprocess.Popen(['alacritty', '--class', instance_name, - '-e', 'tmux', 'new-session', '-A', '-s', 'default']) - - -def get_focused_desktop(): - p = subprocess.run(['bspc', 'query', '-D', '--names', '-d', 'focused'], - capture_output=True, - check=True) - return p.stdout.decode('utf-8').strip() - - -def hide_term(): - subprocess.run(['bspc', 'desktop', '-f', 'last.local'], check=True) - - -def show_term(): - subprocess.run(['bspc', 'desktop', 'term', '-m', 'focused']) - subprocess.run(['bspc', 'desktop', '-f', 'term'], check=True) - - -def main(): - if not is_term_running(): - run_term() - - focused_desktop = get_focused_desktop() - if focused_desktop == desktop_name: - hide_term() - else: - show_term() - - -if __name__ == '__main__': - main() diff --git a/bspwm/terminal.sh b/bspwm/terminal.sh index 8cd5418..6dcce6e 100755 --- a/bspwm/terminal.sh +++ b/bspwm/terminal.sh @@ -1,4 +1,4 @@ - +#!/bin/sh DESKTOP=term INSTANCE=tmux_term @@ -8,7 +8,6 @@ INSTANCE=tmux_term tmux new-session -A -s default if [ $(bspc query -D --names -d focused) = $DESKTOP ]; then - echo "sakrit" bspc desktop -f last.local else bspc desktop $DESKTOP -m focused |
