From c82ef3eb3a437854f39f3fc95286b661f5975342 Mon Sep 17 00:00:00 2001 From: lara Date: Mon, 15 Feb 2021 00:02:01 +0100 Subject: [PATCH] [sway] Bring config up to date --- bin/import-gsettings | 19 +++++++++++++++++++ config/dunst/dunstrc | 2 +- config/i3/common | 38 ++++++++++++++++++++++++++++++++------ config/i3/config | 3 +++ config/sway/config | 21 ++++++++++++++++----- 5 files changed, 71 insertions(+), 12 deletions(-) create mode 100755 bin/import-gsettings diff --git a/bin/import-gsettings b/bin/import-gsettings new file mode 100755 index 0000000..112f6c3 --- /dev/null +++ b/bin/import-gsettings @@ -0,0 +1,19 @@ +#!/bin/sh + +# Inspired from https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland + +# usage: import-gsettings +config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" +if [ ! -f "$config" ]; then exit 1; fi + +gnome_schema="org.gnome.desktop.interface" + +gtk_theme="$(sed -nE '/^gtk-theme-name/s/^gtk-theme-name\s*=\s*//p' "$config")" +icon_theme="$(sed -nE '/^gtk-icon-theme-name/s/^gtk-icon-theme-name\s*=\s*//p' "$config")" +cursor_theme="$(sed -nE '/^gtk-cursor-theme-name/s/^gtk-cursor-theme-name\s*=\s*//p' "$config")" +font_theme="$(sed -nE '/^gtk-font-name/s/^gtk-font-name\s*=\s*//p' "$config")" + +gsettings set "$gnome_schema" gtk-theme "$gtk_theme" +gsettings set "$gnome_schema" icon-theme "$icon_theme" +gsettings set "$gnome_schema" cursor-theme "$cursor_theme" +gsettings set "$gnome_schema" font-name "$font_name" diff --git a/config/dunst/dunstrc b/config/dunst/dunstrc index 555617f..d94083b 100644 --- a/config/dunst/dunstrc +++ b/config/dunst/dunstrc @@ -41,7 +41,7 @@ # The transparency of the window. Range: [0; 100]. # This option will only work if a compositing window manager is # present (e.g. xcompmgr, compiz, etc.). - transparency = 30 + transparency = 20 # The height of the entire notification. If the height is smaller # than the font height and padding combined, it will be raised diff --git a/config/i3/common b/config/i3/common index e03009e..1d93676 100644 --- a/config/i3/common +++ b/config/i3/common @@ -34,7 +34,18 @@ set $ws8 "8:8" set $ws9 "9:9" set $ws10 "10:10" # Your preferred terminal emulator -set $term kitty --single-instance +set $term kitty --single-instance --instance-group i3 + +# Other utilities +set $backlightinc light -A 5 +set $backlightdec light -U 5 +set $volinc volcont --up +set $voldec volcont --down +set $voltog volcont --toggle +set $cliplumber cliplumber +set $mpdtoggle mpc toggle +set $mpdnext mpc next +set $mpdprev mpc prev # Font for window titles and bar font pango:Hack 8 @@ -60,7 +71,7 @@ client.background $base07 # Basics: # exit i3/sway - bindsym $mod+Shift+e exec $exit + bindsym $mod+Shift+q exec $exit # lock session bindsym Mod4+l exec $lock @@ -72,12 +83,24 @@ client.background $base07 bindsym $mod+Return exec $term # call clipboard plumber - bindsym $mod+v exec cliplumber + bindsym $mod+v exec $cliplumber # volume control - bindsym XF86AudioRaiseVolume exec amixer -q set Master 1%+ unmute - bindsym XF86AudioLowerVolume exec amixer -q set Master 1%- unmute - bindsym XF86AudioMute exec amixer -q set Master toggle + bindsym XF86AudioRaiseVolume exec $volinc + bindsym XF86AudioLowerVolume exec $voldec + bindsym XF86AudioMute exec $voltog + + # MPD control + bindsym $mod+greater exec $mpdnext + bindsym $mod+less exec $mpdprev + bindsym $mod+p exec $mpdtoggle + bindsym XF86AudioNext exec $mpdnext + bindsym XF86AudioPrev exec $mpdprev + bindsym XF86AudioPlay exec $mpdtoggle + + # brightness control (using Super because MSI weirdness) + bindsym Mod4+Up exec $backlightinc + bindsym Mod4+Down exec $backlightdec # reload the configuration file bindsym $mod+Shift+r reload @@ -208,6 +231,9 @@ bindsym $mod+Ctrl+$down resize grow height 5 px or 5 ppt bindsym $mod+Ctrl+$up resize shrink height 5 px or 5 ppt bindsym $mod+Ctrl+$right resize grow width 5 px or 5 ppt +# App specific settings +for_window [class="mpv"] floating enable + ### Status Bar # # Read `man 5 sway-bar` for more information about this section. diff --git a/config/i3/config b/config/i3/config index f527334..7bc053e 100644 --- a/config/i3/config +++ b/config/i3/config @@ -269,3 +269,6 @@ set $lock i3lock -c 000000 # Application launcher set $menu dmenu_run + +# App specific settings +for_window [class="mpv"] floating enable diff --git a/config/sway/config b/config/sway/config index 1f526fc..16f2f75 100644 --- a/config/sway/config +++ b/config/sway/config @@ -7,7 +7,7 @@ include ../i3/common # exit sway (logs you out of your Wayland session) -set $exit swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' +set $exit swaymsg exit # Screen locker set $lock swaylock -f -c 000000 @@ -16,17 +16,28 @@ set $lock swaylock -f -c 000000 # Note: it's recommended that you pass the final command to sway set $menu dmenu_path | bemenu | xargs swaymsg exec -- +# App specific settings +for_window [app_id="mpv"] floating enable + # Default wallpaper output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill +# Apps autostart (run on each config reload) +exec_always { + import-gsettings +} + # Set keyboard layout -input * xkb_layout fr,ru -input * xkb_variant ,phonetic +input * xkb_layout fr,ru,fr +input * xkb_variant oss,phonetic,bepo input * xkb_options grp:shift_caps_toggle input * xkb_numlock enable -# Configure touchpad -input * tap enabled +# Configure touchpad (man 5 sway-input) +input type:touchpad { + tap enabled + tap_button_map lmr +} ############ # Examples #