-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbspc-cmd
executable file
·82 lines (77 loc) · 1.65 KB
/
bspc-cmd
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
# _ _ ___ _ _
# __ _| | _____ _____ ___ __| | ___ _ __ / _ \| || |
# / _` | |/ _ \ \/ / __/ _ \ / _` |/ _ \ '__| | | | || |_
# | (_| | | __/> < (_| (_) | (_| | __/ | | |_| |__ _|
# \__,_|_|\___/_/\_\___\___/ \__,_|\___|_| \___/ |_|
#
# Copyright (c) 2021 alexcoder04 <https://github.com/alexcoder04>
#
# a rather crappy script to run bspwm commands in a menu
. libsh || exit 1
commands="node\ndesktop\nmonitor\nquery\nrule\nconfig\nsubscribe\nquit"
selected_cmd="$(echo "$commands" | prompt_gui "bspc")"
[ -z "$selected_cmd" ] && exit 0
case "$selected_cmd" in
node)
selected_action="$(echo "-f --focus
-a --activate
-d --to-desktop
-m --to-monitor
-n --to-node
-s --swap
-p --presel-dir
-o --presel-ratio
-v --move
-z --resize
-r --ratio
-R --rotate
-F --flip
-E --equalize
-B --balance
-C --circulate
-t --state
-g --flag
-l --layer
-i --insert-receptacle
-c --close
-k --kill" \
| prompt_gui "bspc node" | cut -d" " -f1)"
selected_node="$(echo "focused
next
west
east
north
south
prev
any
older
newer
pointed
biggest
smallest
brother
parent
first
second" | prompt_gui "bspc node $selected_action")"
bspc $selected_cmd $selected_action $selected_node
;;
desktop)
selected_action="$(echo "-f --focus
-a --activate
-m --to-monitor
-s --swap
-l --layout
-n --rename
-b --bubble
-r --remove" | prompt_gui "bspc desktop" | cut -d" " -f1)"
selected_desktop="$(echo "focused
any
older
newer
next
prev" | prompt_gui "bspc desktop $selected_action")"
bspc $selected_cmd $selected_action $selected_desktop ;;
*)
bspc $selected_cmd $(prompt_gui "bspc $selected_cmd") ;;
esac