Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
button bar w/ custom menu
Browse files Browse the repository at this point in the history
  • Loading branch information
nwg-piotr committed Jan 21, 2020
1 parent d85e561 commit d8d2bda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions dist/sgtk-bar-arch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

cd /usr/lib/python3.8/site-packages/sgtk-menu
exec /usr/bin/python3 sgtk-bar.py "$@"
12 changes: 8 additions & 4 deletions sgtk-menu/sgtk-bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def main():
placement = parser.add_mutually_exclusive_group()
placement.add_argument("-b", "--bottom", action="store_true", help="display bar at the bottom (sway & i3 only)")
placement.add_argument("-t", "--top", action="store_true", help="display bar at the top (sway & i3 only)")
parser.add_argument("-bw", type=int, default=90, help="minimum button width (default: 90)")
parser.add_argument("-bh", type=int, default=90, help="minimum button height (default: 90)")
parser.add_argument("-p", type=int, default=20, help="button padding (default: 20)")
parser.add_argument("-s", type=int, default=32, help="icon size (min: 16, max: 48, default: 32)")

parser.add_argument("-v", "--vertically", action="store_true", help="arrange buttons vertically")

Expand All @@ -98,7 +102,7 @@ def main():
appendix.add_argument("-af", type=str, help="append custom menu from {}".format(os.path.join(config_dir, '<AF>')))

parser.add_argument("-l", type=str, help="force language (e.g. \"de\" for German)")
parser.add_argument("-s", type=int, default=32, help="bar icon size (min: 16, max: 48, default: 32)")

parser.add_argument("-d", type=int, default=100, help="bar delay in milliseconds (default: 100; sway & i3 only)")
parser.add_argument("-o", type=float, default=0.3, help="overlay opacity (min: 0.0, max: 1.0, default: 0.3; "
"sway & i3 only)")
Expand Down Expand Up @@ -347,10 +351,10 @@ def build_bar():
button.set_image(image)
button.set_image_position(Gtk.PositionType.TOP)
button.set_label(name)
button.set_property("width_request", 90)
button.set_property("height_request", 90)
button.set_property("width_request", args.bw)
button.set_property("height_request", args.bh)
button.connect('clicked', launch, exec)
box.pack_start(button, False, False, 10)
box.pack_start(button, False, False, int(args.p / 2))

return box

Expand Down

0 comments on commit d8d2bda

Please sign in to comment.