Skip to content

Commit a319d67

Browse files
committed
Add -l option to towofidmenu.py
1 parent 7ffe150 commit a319d67

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

linux/.config/hypr/hyprland.d/binds.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bind = ALT, F4, killactive,
1212
bind = $mainMod, M, exit,
1313
bind = $mainMod, E, exec, $fileManager
1414
bind = $mainMod, T, togglefloating,
15-
bind = $mainMod, R, exec, python3 /usr/local/bin/towofidmenu.py $menu -Cc "$(python3 /usr/local/bin/towofidmenu.py $menu -C | wofi -dnp 'Application Launcher' -O default)" | bash
15+
bind = $mainMod, R, exec, python3 /usr/local/bin/towofidmenu.py $menu -lCc "$(python3 /usr/local/bin/towofidmenu.py $menu -C | wofi -dnp 'Application Launcher' -O default)" | bash
1616
bind = $mainMod, P, pseudo,
1717
bind = $mainMod, J, togglesplit,
1818
bind = $mainMod, B, exec, $browser

linux/.config/wofi/menu.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# General programs
22
Firefox|firefox # Web Browser
3-
Alacritty (Terminal Emulator)|alacritty|SHLVL=0 alacritty # Terminal
3+
Alacritty (Terminal Emulator)|alacritty|alacritty # Terminal
44
Thunar (File Manager)|thunar # File manager
55
VLC Media Player|vlc # Media player
66
Neovim|nvim|alacritty -e nvim # Text editor

linux/towofidmenu.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
argparser.add_argument(
1414
"-C", help="use command as prefix if not explicitly specified", action="store_true"
1515
)
16+
argparser.add_argument(
17+
"-l", help="always clear SHLVL variable for process", action="store_true"
18+
)
1619
args = argparser.parse_args()
1720

1821
with open(args.file, "rb") as f:
@@ -41,7 +44,7 @@
4144

4245
if args.c: # If -c argument specified, test for match
4346
if args.c == display:
44-
print(command)
47+
print(("SHLVL=0 " if args.l else "") + command)
4548
raise SystemExit(0)
4649
else:
4750
print(display)

0 commit comments

Comments
 (0)