From 8fae57dbeab4e49ca2ef8e0806ef9a25789d5157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 20 Jan 2022 15:40:02 +0100 Subject: sway: various fixes and updates --- config/sway/config | 87 +++++++++++++++++++++--------------- config/sway/scripts/notes | 5 +++ config/sway/scripts/pass | 6 +++ config/xdg-desktop-portal-wlr/config | 5 +++ install | 2 + local/bin/startsway | 5 ++- local/bin/wlr-select-screen | 9 ++++ private | 2 +- vim/ftdetect/lua.vim | 1 + vim/ftplugin/python.vim | 2 +- 10 files changed, 83 insertions(+), 41 deletions(-) create mode 100755 config/sway/scripts/notes create mode 100755 config/sway/scripts/pass create mode 100644 config/xdg-desktop-portal-wlr/config mode change 100644 => 100755 local/bin/startsway create mode 100755 local/bin/wlr-select-screen create mode 100644 vim/ftdetect/lua.vim diff --git a/config/sway/config b/config/sway/config index 914895c..20a02a9 100644 --- a/config/sway/config +++ b/config/sway/config @@ -1,5 +1,8 @@ # Sway config +exec --no-startup-id dbus-update-activation-environment --all +exec --no-startup-id gentoo-pipewire-launcher exec --no-startup-id myswaylock +exec --no-startup-id swaybackground ################################################################################## input type:keyboard { @@ -7,20 +10,17 @@ input type:keyboard { xkb_options 'grp:alt_shift_toggle,caps:escape' xkb_numlock enabled } -bindsym Alt+space input '*' xkb_layout next input type:touchpad { tap enabled } -output '*' { - background '/usr/share/backgrounds/vim-card-black-2560x1440.png' fit +seat '*' { + xcursor_theme Adwaita + hide_cursor 10000 + hide_cursor when-typing disable } -seat * xcursor_theme Adwaita -seat * hide_cursor 10000 -seat * hide_cursor when-typing disable - ################################################################################## smart_borders on @@ -41,6 +41,7 @@ set $mod Mod4 # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod +tiling_drag disable # kill focused window bindsym $mod+q kill @@ -95,36 +96,42 @@ bindsym $mod+Shift+x move workspace to output right bindsym $mod+Shift+z move workspace to output left # switch to workspace -bindsym $mod+1 workspace 1 -bindsym $mod+2 workspace 2 -bindsym $mod+3 workspace 3 -bindsym $mod+4 workspace 4 -bindsym $mod+5 workspace 5 -bindsym $mod+6 workspace 6 -bindsym $mod+7 workspace 7 -bindsym $mod+8 workspace 8 -bindsym $mod+9 workspace 9 -bindsym $mod+0 workspace 10 -bindsym $mod+grave workspace web -bindsym $mod+minus workspace t +bindsym --to-code $mod+1 workspace 1 +bindsym --to-code $mod+2 workspace 2 +bindsym --to-code $mod+3 workspace 3 +bindsym --to-code $mod+4 workspace 4 +bindsym --to-code $mod+5 workspace 5 +bindsym --to-code $mod+6 workspace 6 +bindsym --to-code $mod+7 workspace 7 +bindsym --to-code $mod+8 workspace 8 +bindsym --to-code $mod+9 workspace 9 +bindsym --to-code $mod+0 workspace 10 +bindsym --to-code $mod+grave workspace web +bindsym --to-code $mod+minus workspace t # move focused container to workspace -bindsym $mod+Shift+1 move container to workspace 1 -bindsym $mod+Shift+2 move container to workspace 2 -bindsym $mod+Shift+3 move container to workspace 3 -bindsym $mod+Shift+4 move container to workspace 4 -bindsym $mod+Shift+5 move container to workspace 5 -bindsym $mod+Shift+6 move container to workspace 6 -bindsym $mod+Shift+7 move container to workspace 7 -bindsym $mod+Shift+8 move container to workspace 8 -bindsym $mod+Shift+9 move container to workspace 9 -bindsym $mod+Shift+0 move container to workspace 10 -bindsym $mod+Shift+grave move container to workspace web -bindsym $mod+Shift+minus move container to workspace t +bindsym --to-code $mod+Shift+1 move container to workspace 1 +bindsym --to-code $mod+Shift+2 move container to workspace 2 +bindsym --to-code $mod+Shift+3 move container to workspace 3 +bindsym --to-code $mod+Shift+4 move container to workspace 4 +bindsym --to-code $mod+Shift+5 move container to workspace 5 +bindsym --to-code $mod+Shift+6 move container to workspace 6 +bindsym --to-code $mod+Shift+7 move container to workspace 7 +bindsym --to-code $mod+Shift+8 move container to workspace 8 +bindsym --to-code $mod+Shift+9 move container to workspace 9 +bindsym --to-code $mod+Shift+0 move container to workspace 10 +bindsym --to-code $mod+Shift+grave move container to workspace web +bindsym --to-code $mod+Shift+minus move container to workspace t # reload the configuration file bindsym $mod+Shift+r reload +# Notifications +bindsym --to-code ctrl+space exec --no-startup-id dunstctl close +bindsym --to-code ctrl+Shift+space exec --no-startup-id dunstctl close-all +bindsym --to-code ctrl+grave exec --no-startup-id dunstctl history-pop +bindsym --to-code ctrl+Shift+grave exec --no-startup-id dunstctl context + set $mode_system System (l) lock, (e) logout, (s) suspend, (r) reboot, (Shift+s) shutdown mode "$mode_system" { bindsym l exec --no-startup-id loginctl lock-session $XDG_SESSION_ID, mode "default" @@ -167,6 +174,15 @@ mode "resize" { } bindsym $mod+r mode "resize" +set $mode_layout Set keyboard layout (u)s or (c)z +mode "$mode_layout" { + bindsym u input type:keyboard xkb_layout us, mode "default" + bindsym c input type:keyboard xkb_layout cz_qwerty, mode "default" + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym --to-code $mod+slash mode "$mode_layout" + ################################################################################## # Start a terminal bindsym $mod+Return exec alacritty @@ -174,11 +190,11 @@ bindsym $mod+Return exec alacritty bindsym $mod+Shift+Return exec firefox # start a program -bindsym $mod+d exec --no-startup-id wofi -S drun +bindsym $mod+d exec --no-startup-id wofi -Imi -S drun # Type emoji -bindsym $mod+period exec rofimoji --skin-tone neutral -bindsym $mod+Shift+period exec rofimoji --skin-tone neutral --action copy +bindsym --to-code $mod+period exec rofimoji --skin-tone neutral +bindsym --to-code $mod+Shift+period exec rofimoji --skin-tone neutral --action copy # Top bindsym $mod+t exec alacritty -e htop @@ -234,9 +250,6 @@ for_window [class="Florence"] floating enable # Start daemons exec --no-startup-id kanshi exec --no-startup-id swayidle -exec --no-startup-id /usr/libexec/xdg-desktop-portal-wlr -exec --no-startup-id /usr/libexec/polkit-gnome-authentication-agent-1 -exec --no-startup-id gentoo-pipewire-launcher exec --no-startup-id dunst exec --no-startup-id /usr/lib64/libexec/kdeconnectd diff --git a/config/sway/scripts/notes b/config/sway/scripts/notes new file mode 100755 index 0000000..ebe2684 --- /dev/null +++ b/config/sway/scripts/notes @@ -0,0 +1,5 @@ +#!/bin/sh +cd ~/notes +find * -type f | wofi -d -p 'notes' | while read -r note; do + nohup alacritty -e vim ~/notes/"$note" >/dev/null 2>&1 & +done diff --git a/config/sway/scripts/pass b/config/sway/scripts/pass new file mode 100755 index 0000000..06383b3 --- /dev/null +++ b/config/sway/scripts/pass @@ -0,0 +1,6 @@ +#!/bin/sh +find ~/.password-store -name .git -prune -o -type f -printf '%P\n' | \ + sed 's/\.gpg$//' | wofi -d -p 'Pass:' | \ + while read -r psw; do + pass -c "$psw" +done diff --git a/config/xdg-desktop-portal-wlr/config b/config/xdg-desktop-portal-wlr/config new file mode 100644 index 0000000..33d7468 --- /dev/null +++ b/config/xdg-desktop-portal-wlr/config @@ -0,0 +1,5 @@ +[screencast] +output_name=Monitor +max_fps=30 +chooser_type=dmenu +chooser_cmd=wlr-select-screen diff --git a/install b/install index df76e90..c1de175 100755 --- a/install +++ b/install @@ -103,6 +103,8 @@ if ask "wayland" "Install Wayland (sway)"; then inst config/wofi/ ~/.config/wofi [ -f "private/kanshi/$(hostname)" ] \ && inst "private/kanshi/$(hostname)" ~/.config/kanshi/config + inst config/xdg-desktop-portal-wlr/ ~/.config/xdg-desktop-portal-wlr + inst local/bin/wlr-select-screen ~/.local/bin/wlr-select-screen fi if ask "alacritty" "Install configurations for terminal emulator"; then diff --git a/local/bin/startsway b/local/bin/startsway old mode 100644 new mode 100755 index a162deb..995362e --- a/local/bin/startsway +++ b/local/bin/startsway @@ -1,5 +1,6 @@ -#!/bin/sh +#!/bin/bash set -eu +exec 1> >(logger -s -t "${0##*/}") 2>&1 # Declare the current desktop export XDG_CURRENT_DESKTOP=sway @@ -14,4 +15,4 @@ export force_s3tc_enable=true export MOZ_USE_XINPUT2=1 export MOZ_ENABLE_WAYLAND=1 -exec dbus-launch --exit-with-session sway +exec dbus-run-session sway diff --git a/local/bin/wlr-select-screen b/local/bin/wlr-select-screen new file mode 100755 index 0000000..9eedeb4 --- /dev/null +++ b/local/bin/wlr-select-screen @@ -0,0 +1,9 @@ +#!/bin/sh +set -eu + +screens="$(cat)" +if [ "$(echo "$screens" | wc -l)" -gt 1 ]; then + echo "$screens" | wofi -d -p "Select screen to share" +else + echo "$screens" +fi diff --git a/private b/private index e1aadc7..25d88b1 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit e1aadc797c0350dd77ad01c5de224056279e1934 +Subproject commit 25d88b1cc753ab9c2b0ef51a39be04c8fc888902 diff --git a/vim/ftdetect/lua.vim b/vim/ftdetect/lua.vim new file mode 100644 index 0000000..63d54d4 --- /dev/null +++ b/vim/ftdetect/lua.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.lua.m4 set filetype=lua diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim index 3edc7b5..1eda902 100644 --- a/vim/ftplugin/python.vim +++ b/vim/ftplugin/python.vim @@ -1,6 +1,6 @@ setlocal colorcolumn=120 setlocal textwidth=120 -let b:ale_linters = ['pylsp', 'pylint', 'mypy'] +let b:ale_linters = ['pylsp', 'pylint', 'mypy', 'pydocstyle'] let b:ale_fixers = ['isort', 'black', 'remove_trailing_lines', 'trim_whitespace'] let g:ale_python_black_options = '-l 120' -- cgit v1.2.3