mirror of
https://github.com/artizirk/dotfiles.git
synced 2024-11-22 08:20:59 +02:00
Update things
This commit is contained in:
parent
c3796928c1
commit
1545673b88
39
.bin/sway-apps.py
Executable file
39
.bin/sway-apps.py
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
# source https://gitlab.com/snippets/1832968
|
||||||
|
|
||||||
|
import json
|
||||||
|
from subprocess import Popen, PIPE, run
|
||||||
|
|
||||||
|
|
||||||
|
def get_tree():
|
||||||
|
proc = run(['swaymsg', '-t', 'get_tree'], capture_output=True)
|
||||||
|
return json.loads(proc.stdout)
|
||||||
|
|
||||||
|
|
||||||
|
def traverse(data, out):
|
||||||
|
if 'nodes' not in data:
|
||||||
|
return
|
||||||
|
|
||||||
|
if data['type'] == 'con' and 'window_properties' in data:
|
||||||
|
props = data['window_properties']
|
||||||
|
out.append((f'{props["class"]}: {props["title"]}'))
|
||||||
|
|
||||||
|
for node in data['nodes']:
|
||||||
|
if 'nodes' in node:
|
||||||
|
traverse(node, out)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
apps = []
|
||||||
|
traverse(get_tree(), apps)
|
||||||
|
in_data = '\n'.join(apps).encode()
|
||||||
|
|
||||||
|
with Popen(['fzf'], stdout=PIPE, stdin=PIPE) as proc:
|
||||||
|
stdout, _ = proc.communicate(in_data)
|
||||||
|
app = stdout.decode().split(':')[1].strip()
|
||||||
|
|
||||||
|
run(['swaymsg', f'[title="{app}"] focus'])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
@ -16,10 +16,12 @@ set $right l
|
|||||||
# Your preferred terminal emulator
|
# Your preferred terminal emulator
|
||||||
set $term gnome-terminal
|
set $term gnome-terminal
|
||||||
# Your preferred application launcher
|
# Your preferred application launcher
|
||||||
# Note: it's recommended that you pass the final command to sway
|
# None: it's recommended that you pass the final command to sway
|
||||||
#set $menu dmenu_path | dmenu | xargs swaymsg exec
|
#set $menu dmenu_path | dmenu | xargs swaymsg exec
|
||||||
set $menu gnome-terminal --title=swayapplauncher -- ~/.bin/desktop_launcher.sh
|
set $menu gnome-terminal --title=swayapplauncher -- ~/.bin/desktop_launcher.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Output configuration
|
### Output configuration
|
||||||
#
|
#
|
||||||
# Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/)
|
# Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/)
|
||||||
@ -59,6 +61,8 @@ bindsym Scroll_Lock exec swaylock -c 333333AA -s tile -i ~/Pildid/background.png
|
|||||||
exec ~/code/dropbox-filesystem-fix/dropbox_start.py
|
exec ~/code/dropbox-filesystem-fix/dropbox_start.py
|
||||||
|
|
||||||
|
|
||||||
|
bindsym Alt+Tab exec gnome-terminal --title=swayapplauncher -- ~/.bin/sway-apps.py
|
||||||
|
|
||||||
### Input configuration
|
### Input configuration
|
||||||
#
|
#
|
||||||
# Example configuration:
|
# Example configuration:
|
||||||
@ -225,6 +229,7 @@ bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl --quiet set 5%-
|
|||||||
|
|
||||||
# launcher float
|
# launcher float
|
||||||
for_window [title=".*swayapplauncher.*"] floating enable
|
for_window [title=".*swayapplauncher.*"] floating enable
|
||||||
|
for_window [title="Authy"] floating enable
|
||||||
|
|
||||||
# screenshots
|
# screenshots
|
||||||
bindsym Print exec grim $(xdg-user-dir PICTURES)/$(date +'screenshot_%Y-%m-%d-%H%M%S_grim.png')
|
bindsym Print exec grim $(xdg-user-dir PICTURES)/$(date +'screenshot_%Y-%m-%d-%H%M%S_grim.png')
|
||||||
@ -259,17 +264,17 @@ input * {
|
|||||||
xkb_layout ee,ee
|
xkb_layout ee,ee
|
||||||
xkb_variant us,
|
xkb_variant us,
|
||||||
xkb_options caps:escape
|
xkb_options caps:escape
|
||||||
|
xkb_numlock enabled
|
||||||
tap enabled
|
tap enabled
|
||||||
natural_scroll disabled
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input 1133:4123:Logitech_M705 {
|
input 1133:4123:Logitech_M705 {
|
||||||
pointer_accel -0.6
|
pointer_accel -0.6
|
||||||
|
natural_scroll disabled
|
||||||
accel_profile adaptive
|
accel_profile adaptive
|
||||||
}
|
}
|
||||||
|
|
||||||
input 1267:32:Elan_Touchpad {
|
input 1267:32:Elan_Touchpad {
|
||||||
natural_scroll enabled
|
|
||||||
pointer_accel 0.1
|
pointer_accel 0.1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user