From 7c07a971b328c3d8d08e9d69ca5c3e4e4ae7ec67 Mon Sep 17 00:00:00 2001 From: RenatoXSR Date: Mon, 18 Mar 2019 03:31:32 -0300 Subject: [PATCH] sway and waybar configs for fedora 29 --- polybar/config.fc29.vjf15511x | 3 +- sway/config.vaio-vjf155f11x.fc29 | 39 ++++++++---- sway/fullscreen.sh | 14 +++++ waybar/config.fc29 | 103 +++++++++++++++++++++++++++++++ 4 files changed, 147 insertions(+), 12 deletions(-) create mode 100755 sway/fullscreen.sh create mode 100644 waybar/config.fc29 diff --git a/polybar/config.fc29.vjf15511x b/polybar/config.fc29.vjf15511x index 631b6da..d3e8932 100644 --- a/polybar/config.fc29.vjf15511x +++ b/polybar/config.fc29.vjf15511x @@ -23,6 +23,7 @@ alert = #bd2c40 locale = pt_BR.UTF-8 [bar/default] +enable-ipc = true inherit = bar/general ;monitor = ${env:MONITOR:HDMI-1} width = 100% @@ -76,7 +77,7 @@ tray-background = ${colors.background} ;wm-restack = bspwm wm-restack = i3 -;override-redirect = true +override-redirect = true ;scroll-up = bspwm-desknext ;scroll-down = bspwm-deskprev diff --git a/sway/config.vaio-vjf155f11x.fc29 b/sway/config.vaio-vjf155f11x.fc29 index de5dd93..0acf388 100644 --- a/sway/config.vaio-vjf155f11x.fc29 +++ b/sway/config.vaio-vjf155f11x.fc29 @@ -19,7 +19,8 @@ set $Right ccedilla # Your preferred terminal emulator #set $term urxvt256c-ml -set $term konsole +set $term gnome-terminal +#set $term konsole # Your preferred application launcher set $menu-alt dmenu_run @@ -37,9 +38,14 @@ set $menu i3-dmenu-desktop # This font is widely installed, provides lots of unicode glyphs, right-to-left # text rendering and scalability on retina/hidpi displays (thanks to pango). -font pango:DejaVu Sans Mono 10 +font pango:DejaVu Sans Mono 9 -gaps 20 +### GAPS AND STATUS BAR +#gaps 20 +#gaps bottom 40 + +#exec $HOME/.config/polybar/launch.sh +#for_window [class="Polybar"] sticky enable, floating enable, border none ### SWAY SETUP ### @@ -60,7 +66,9 @@ output "*" bg ~/src/wallpapers/default.jpg fill ### Input configuration # -input "2:7:SynPS\/2_Synaptics_TouchPad" { +#input "2:7:SynPS\/2_Synaptics_TouchPad" { +#input "*" { +input "2:7:SynPS/2_Synaptics_TouchPad" { dwt enabled tap enabled scroll_method two_finger @@ -72,7 +80,12 @@ input "2:7:SynPS\/2_Synaptics_TouchPad" { # `swaymsg -t get_inputs` # Read `man 5 sway-input` for more information about this section. - +#input "*" { +input "1:1:AT_Translated_Set_2_keyboard" { + xkb_layout br,us + xkb_variant abnt2,altgr-intl + xkb_options grp:alt_caps_toggle,compose:menu,eurosign:e,nbsp:level2,nbsp:zwnj3nb4,terminate:ctrl_alt_bksp +} @@ -120,7 +133,8 @@ bindsym $mod+h split h bindsym $mod+v split v # enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle +#bindsym $mod+f fullscreen toggle +bindsym $mod+f exec /home/renato/.config/sway/fullscreen.sh # change container layout (stacked, tabbed, toggle split) bindsym $mod+s layout stacking @@ -179,7 +193,7 @@ bindsym $mod+Shift+0 move container to workspace $ws10 # reload the configuration file bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -#bindsym $mod+Shift+r restart +#bindsym $mod+Shift+rmestart # exit i3 (logs you out of your X session) @@ -232,9 +246,9 @@ bindsym $mod+r mode "resize" # Polybar #status_command $HOME/.config/polybar/launch.sh #status_command i3status + status_command waybar } -for_window [class="Polybar"] sticky enable, floating enable, border none include /etc/sway/config.d/* @@ -255,12 +269,17 @@ bindsym $mod+z exec $lock bindsym $mod+Shift+z mode "$mode_exit" # Exit + +# exit i3 (logs you out of your X session) +set $exit "swaynag -t warning -m 'Do you really want to exit your current session? All unsaved work will be lost!' -s 'No! Cancel!' -b 'Yes, exit!' 'swaymsg exit'" + #bindsym $mod+Shift+e mode "$mode_exit" # exit sway (logs you out of your wayland session) -bindsym $mod+Shift+e exit +bindsym $mod+Shift+e exec $exit bindsym $mod+Shift+Escape exit + # dmenu bindsym $mod+d exec --no-startup-id $menu # Move: `Mod+\` Show: `Mod+|` @@ -291,8 +310,6 @@ mode "$mode_exit" { bindsym Escape mode "default" } -# exit i3 (logs you out of your X session) -#bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" # XKBOPTIONS compose key exec_always --no-startup-id setxkbmap -option "compose:menu" diff --git a/sway/fullscreen.sh b/sway/fullscreen.sh new file mode 100755 index 0000000..e235238 --- /dev/null +++ b/sway/fullscreen.sh @@ -0,0 +1,14 @@ +#!/bin/sh +flag=$XDG_RUNTIME_DIR/.sway_fullscreen_flag-$XDG_SEAT + +# fullscreen -> normal +if [ -f $flag ]; then + polybar-msg cmd show + rm $flag +# normal -> fullscreen +else + polybar-msg cmd hide + touch $flag +fi + +swaymsg fullscreen diff --git a/waybar/config.fc29 b/waybar/config.fc29 new file mode 100644 index 0000000..312a265 --- /dev/null +++ b/waybar/config.fc29 @@ -0,0 +1,103 @@ +{ + "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar at the bottom of your screen + // "height": 30, // Waybar height + // "width": 1280, // Waybar width + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/mode", "custom/spotify"], + "modules-center": ["sway/window"], + "modules-right": ["idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "battery#bat2", "clock", "tray"], + // Modules configuration + // "sway/workspaces": { + // "disable-scroll": true, + // "all-outputs": true, + // "format": "{name}: {icon}", + // "format-icons": { + // "1": "", + // "2": "", + // "3": "", + // "4": "", + // "5": "", + // "urgent": "", + // "focused": "", + // "default": "" + // } + // }, + "sway/mode": { + "format": "{}" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + "tooltip-format": "{:%Y-%m-%d | %H:%M}", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% " + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C ", + "format": "{temperatureC}°C " + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2s0", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-disconnected": "Disconnected ⚠" + }, + "pulseaudio": { + //"scroll-step": 1, + "format": "{volume}% {icon}", + "format-bluetooth": "{volume}% {icon}", + "format-muted": "", + "format-icons": { + "headphones": "", + "handsfree": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", ""] + }, + "on-click": "pavucontrol" + }, + "custom/spotify": { + "format": " {}", + "max-length": 40, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + } +}