From 7f39de55f055858864536f1741433cf121f0027c Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Tue, 31 Aug 2021 16:39:02 +0200 Subject: [PATCH] move sway input/output to a dedicated file --- configs/appcfg/sway_template | 68 +---------------------- configs/sway/mobile_inputs_outputs | 86 ++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 67 deletions(-) create mode 100644 configs/sway/mobile_inputs_outputs diff --git a/configs/appcfg/sway_template b/configs/appcfg/sway_template index e938d7a..2d049be 100644 --- a/configs/appcfg/sway_template +++ b/configs/appcfg/sway_template @@ -49,51 +49,7 @@ exec sxmo_idle.sh start # You can get the names of your inputs by running: swaymsg -t get_inputs # Read `man 5 sway-input` for more information about this section. -###### Device-specific -# repeat_delay how much time in milisec to consider it is hold pressed -# should be long enough to trigger simple click easily but -# should be short enough to trigger a repeat before the next threshold -# repeat_rate then how much key per second should be triggered -# adapt it accordingly with the delay. -# prefer a lower but enough value -# This is enough for 4 multikeys long presses - -### PinePhone (pine64-pinephone) / PineTab (pine64-pinetab) -# Power button -input 0:0:axp20x-pek { - repeat_delay 200 - repeat_rate 15 - xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons -} -# Volume buttons -input 1:1:1c21800.lradc { - repeat_delay 200 - repeat_rate 15 - xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons -} - -### BQ Aquaris X5 (bq-paella) -# Power button -input 0:0:pm8941_pwrkey { - repeat_delay 200 - repeat_rate 15 - xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons -} -# Volume up button -input 1:1:GPIO_Buttons { - repeat_delay 200 - repeat_rate 15 - xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons -} -# Volume down button -input 0:0:pm8941_resin { - repeat_delay 200 - repeat_rate 15 - xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons -} -###### End of device-specific - -exec sxmo_multikey.sh clear +include /usr/share/sxmo/sway/mobile_inputs_outputs ### Key bindings # @@ -105,28 +61,6 @@ exec sxmo_multikey.sh clear # Launch appmenu bindsym $mod+p exec sxmo_appmenu.sh - # Multikey handling for power button - bindsym XF86PowerOff exec sxmo_multikey.sh powerbutton \ - "sxmo_inputhandler.sh powerbutton_one" \ - "sxmo_inputhandler.sh powerbutton_two" \ - "sxmo_inputhandler.sh powerbutton_three" - - # Multikey handling for volup button - bindsym XF86AudioRaiseVolume exec sxmo_multikey.sh volup \ - "sxmo_inputhandler.sh volup_one" \ - "sxmo_inputhandler.sh volup_two" \ - "sxmo_inputhandler.sh volup_three" - - # Multikey handling for voldown button - bindsym XF86AudioLowerVolume exec sxmo_multikey.sh voldown \ - "sxmo_inputhandler.sh voldown_one" \ - "sxmo_inputhandler.sh voldown_two" \ - "sxmo_inputhandler.sh voldown_three" - - mode "menu" { - bindsym --input-device=1:1:1c21800.lradc XF86AudioMute exec nothing # placeholder for "menu" mode - } - # Kill focused window bindsym $mod+Shift+q kill diff --git a/configs/sway/mobile_inputs_outputs b/configs/sway/mobile_inputs_outputs new file mode 100644 index 0000000..51dad48 --- /dev/null +++ b/configs/sway/mobile_inputs_outputs @@ -0,0 +1,86 @@ +# repeat_delay how much time in milisec to consider it is hold pressed +# should be long enough to trigger simple click easily but +# should be short enough to trigger a repeat before the next threshold +# repeat_rate then how much key per second should be triggered +# adapt it accordingly with the delay. +# prefer a lower but enough value +# This is enough for 4 multikeys long presses + +### PinePhone (pine64-pinephone) / PineTab (pine64-pinetab) +# Power button +input 0:0:axp20x-pek { + repeat_delay 200 + repeat_rate 15 + xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons +} +# Volume buttons +input 1:1:1c21800.lradc { + repeat_delay 200 + repeat_rate 15 + xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons +} + +### BQ Aquaris X5 (bq-paella) +# Power button +input 0:0:pm8941_pwrkey { + repeat_delay 200 + repeat_rate 15 + xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons +} +# Volume up button +input 1:1:GPIO_Buttons { + repeat_delay 200 + repeat_rate 15 + xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons +} +# Volume down button +input 0:0:pm8941_resin { + repeat_delay 200 + repeat_rate 15 + xkb_file /usr/share/sxmo/sway/xkb_mobile_normal_buttons +} + +exec sxmo_multikey.sh clear + +### PinePhone (pine64-pinephone) / PineTab (pine64-pinetab) +# Multikey handling for power button +bindsym --input-device=0:0:axp20x-pek XF86PowerOff \ + exec sxmo_multikey.sh powerbutton \ + "sxmo_inputhandler.sh powerbutton_one" \ + "sxmo_inputhandler.sh powerbutton_two" \ + "sxmo_inputhandler.sh powerbutton_three" +# Multikey handling for volup button +bindsym --input-device=1:1:1c21800.lradc XF86AudioRaiseVolume \ + exec sxmo_multikey.sh volup \ + "sxmo_inputhandler.sh volup_one" \ + "sxmo_inputhandler.sh volup_two" \ + "sxmo_inputhandler.sh volup_three" +# Multikey handling for voldown button +bindsym --input-device=1:1:1c21800.lradc XF86AudioLowerVolume \ + exec sxmo_multikey.sh voldown \ + "sxmo_inputhandler.sh voldown_one" \ + "sxmo_inputhandler.sh voldown_two" \ + "sxmo_inputhandler.sh voldown_three" + +### BQ Aquaris X5 (bq-paella) +bindsym --input-device=0:0:pm8941_pwrkey XF86PowerOff \ + exec sxmo_multikey.sh powerbutton \ + "sxmo_inputhandler.sh powerbutton_one" \ + "sxmo_inputhandler.sh powerbutton_two" \ + "sxmo_inputhandler.sh powerbutton_three" +# Multikey handling for volup button +bindsym --input-device=1:1:GPIO_Buttons XF86AudioRaiseVolume \ + exec sxmo_multikey.sh volup \ + "sxmo_inputhandler.sh volup_one" \ + "sxmo_inputhandler.sh volup_two" \ + "sxmo_inputhandler.sh volup_three" +# Multikey handling for voldown button +bindsym --input-device=0:0:pm8941_resin XF86AudioLowerVolume \ + exec sxmo_multikey.sh voldown \ + "sxmo_inputhandler.sh voldown_one" \ + "sxmo_inputhandler.sh voldown_two" \ + "sxmo_inputhandler.sh voldown_three" + +mode "menu" { + bindsym --input-device=1:1:1c21800.lradc XF86AudioMute exec nothing # just a placeholder for "menu" mode +}