Sway : Replace bin dir with shell functions and dmenu support.

This commit is contained in:
Dmitry Voronin 2024-03-30 02:36:34 +03:00
parent f8ea04d40b
commit 8f3899b7bf
16 changed files with 38 additions and 30 deletions

View file

@ -35,8 +35,7 @@
variables = {
FOOT_CONFIG = ./foot/Foot.ini;
SWAY_CONFIG = ./sway/module;
PATH = [ "/etc/swaybin" ];
# PATH = [ "/etc/swaybin" ]; # NOTE: Kept as an example on PATH modification.
};
etc.swaybin.source = ./sway/bin;
};
}

9
module/common/Monitor.sh Normal file
View file

@ -0,0 +1,9 @@
# Enable monitors.
function monon() {
swaymsg 'output "ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165" power on'
}
# Disable monitors.
function monoff() {
swaymsg 'output "ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165" power off'
}

View file

@ -0,0 +1,5 @@
# Wrapped dmenu_path to include my functions.
function _dmenu_path_wrapped() {
dmenu_path
find_function | grep -v ^_
}

View file

@ -0,0 +1,9 @@
# Open bluetooth control panel.
function bluetooth() {
blueman-manager
}
# Open network control panel.
function network() {
nm-connection-editor
}

View file

@ -0,0 +1,4 @@
# Open a sound control panel.
function sound() {
pavucontrol
}

View file

@ -0,0 +1,9 @@
# Enable VRR.
function vrron() {
swaymsg 'output "Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622" adaptive_sync on'
}
# Disable VRR.
function vrroff() {
swaymsg 'output "Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622" adaptive_sync off'
}

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
blueman-manager

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
poweroff

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
swaymsg 'output "ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165" power off'

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
swaymsg 'output "ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165" power on'

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
nm-connection-editor

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
systemctl suspend

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
pavucontrol

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
swaymsg 'output "Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622" adaptive_sync off'

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
swaymsg 'output "Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622" adaptive_sync on'

View file

@ -1,4 +1,4 @@
# Application launcher.
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu dmenu_path | wmenu -S d79921 -s 000000 -f "SF Pro Display Medium 14" | xargs swaymsg exec --
set $menu _dmenu_path_wrapped | wmenu -S d79921 -s 000000 -f "SF Pro Display Medium 14" | xargs swaymsg exec --