From dab0614bc2a0107b13021f21577a78c88649e612 Mon Sep 17 00:00:00 2001 From: AngeD Date: Mon, 15 Nov 2021 16:21:32 +0100 Subject: [PATCH] feat: sway config --- .config/gammastep/config.ini | 6 + .config/sway/config | 9 + .config/sway/config.d/bar.conf | 16 ++ .config/sway/config.d/hotkeys.conf | 84 +++++++++ .config/sway/config.d/input.conf | 15 ++ .config/sway/config.d/output.conf | 3 + .config/sway/config.d/startup.conf | 16 ++ .config/sway/config.d/variables.conf | 35 ++++ .config/waybar/config | 72 ++++++++ .config/waybar/style.css | 255 +++++++++++++++++++++++++++ 10 files changed, 511 insertions(+) create mode 100644 .config/gammastep/config.ini create mode 100644 .config/sway/config create mode 100644 .config/sway/config.d/bar.conf create mode 100644 .config/sway/config.d/hotkeys.conf create mode 100644 .config/sway/config.d/input.conf create mode 100644 .config/sway/config.d/output.conf create mode 100644 .config/sway/config.d/startup.conf create mode 100644 .config/sway/config.d/variables.conf create mode 100644 .config/waybar/config create mode 100644 .config/waybar/style.css diff --git a/.config/gammastep/config.ini b/.config/gammastep/config.ini new file mode 100644 index 0000000..c3c2b21 --- /dev/null +++ b/.config/gammastep/config.ini @@ -0,0 +1,6 @@ +[general] +location-provider=manual + +[manual] +lat=44 +lon=2 diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..a698e17 --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,9 @@ +# Config for sway +# Read `man 5 sway` for a complete reference. + +include "$HOME"/.config/sway/config.d/variables.conf +include "$HOME"/.config/sway/config.d/output.conf +include "$HOME"/.config/sway/config.d/startup.conf +include "$HOME"/.config/sway/config.d/input.conf +include "$HOME"/.config/sway/config.d/hotkeys.conf +#include "$HOME"/.config/sway/config.d/bar.conf diff --git a/.config/sway/config.d/bar.conf b/.config/sway/config.d/bar.conf new file mode 100644 index 0000000..c7271ad --- /dev/null +++ b/.config/sway/config.d/bar.conf @@ -0,0 +1,16 @@ +# Read `man 5 sway-bar` for more information about this section. +bar { + position top + #tray_output primary + + # Date + status_command while date +'%a %b %d, %R'; do sleep $(($clock_refresh_rate-$(date +%S)%$clock_refresh_rate)); done + + strip_workspace_numbers yes + colors { + statusline #ffffff + background #323232 + inactive_workspace #32323200 #32323200 #5c5c5c + } +} + diff --git a/.config/sway/config.d/hotkeys.conf b/.config/sway/config.d/hotkeys.conf new file mode 100644 index 0000000..dc652d8 --- /dev/null +++ b/.config/sway/config.d/hotkeys.conf @@ -0,0 +1,84 @@ +## Basics: + # Default apps + bindsym $mod+Return exec $term + bindsym $mod+b workspace $ws2; exec $browser + bindsym $mod+e exec $files + bindsym $mod+l exec $lock + bindsym $mod+Print exec screenshot + bindsym $mod+Shift+Print exec screenshot_gui + + # Hotkeys + bindsym XF86AudioRaiseVolume exec $raise_volume + bindsym XF86AudioLowerVolume exec $lower_volume + bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle + bindsym Ctrl+XF86AudioMute exec pactl set-source-mute 0 toggle + bindsym XF86AudioPlay exec playerctl play-pause + bindsym XF86AudioPrev exec playerctl previous + bindsym XF86AudioNext exec playerctl next + bindsym Ctrl+F4 input type:touchpad events toggle + bindsym XF86MonBrightnessDown exec $lower_backlight + bindsym XF86MonBrightnessUp exec $raise_backlight + + # Kill focused window + bindsym $mod+Shift+c kill + + # Start your launcher + bindsym $mod+r exec $menu + + # Drag window $mod + left + # Resize window $mod + right + floating_modifier $mod normal + + # Reload config + bindsym $mod+Ctrl+r reload + + # Exit sway + bindsym $mod+Ctrl+q exit + +## Moving around: + # Move your focus around + bindsym $mod+$down focus prev + bindsym $mod+$up focus next + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + +## Workspaces: + # Switch to workspace + bindsym $mod+1 workspace $ws1 + bindsym $mod+2 workspace $ws2 + bindsym $mod+3 workspace $ws3 + bindsym $mod+4 workspace $ws4 + bindsym $mod+5 workspace $ws5 + bindsym $mod+6 workspace $ws6 + bindsym $mod+7 workspace $ws7 + bindsym $mod+8 workspace $ws8 + bindsym $mod+9 workspace $ws9 + # Move focused client to workspace + bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1 + bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2 + bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3 + bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4 + bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5 + bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6 + bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7 + bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8 + bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9 + + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + #bindsym $mod+b splith + #bindsym $mod+v splitv + + # Switch the current container between different layout styles + #bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+space floating toggle diff --git a/.config/sway/config.d/input.conf b/.config/sway/config.d/input.conf new file mode 100644 index 0000000..260d3d5 --- /dev/null +++ b/.config/sway/config.d/input.conf @@ -0,0 +1,15 @@ +input type:keyboard { + xkb_layout "us" + xkb_variant "altgr-intl" + xkb_numlock "enable" +} + +input type:pointer { + accel_profile "flat" +} + +input type:touchpad { + tap "enabled" + click_method "clickfinger" + natural_scroll "enabled" +} diff --git a/.config/sway/config.d/output.conf b/.config/sway/config.d/output.conf new file mode 100644 index 0000000..e184fdc --- /dev/null +++ b/.config/sway/config.d/output.conf @@ -0,0 +1,3 @@ +output HDMI-A-1 position 1920,0 +output eDP-1 mode --custom 1920x1080@120Hz position 0,0 +output * bg $wallpapers/landscape.png fill diff --git a/.config/sway/config.d/startup.conf b/.config/sway/config.d/startup.conf new file mode 100644 index 0000000..ed0e4bb --- /dev/null +++ b/.config/sway/config.d/startup.conf @@ -0,0 +1,16 @@ +# Lock after $screen_timeout +# Turn off screen after $screem_timeout - 10 +# Lock if screen off + +workspace $ws1 +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +exec swayidle -w \ + timeout $(($screen_timeout+10)) $lock \ + timeout $screen_timeout 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep $lock +exec gammastep +exec waybar +exec nm-applet --indicator +exec flameshot +exec alacritty diff --git a/.config/sway/config.d/variables.conf b/.config/sway/config.d/variables.conf new file mode 100644 index 0000000..1521abc --- /dev/null +++ b/.config/sway/config.d/variables.conf @@ -0,0 +1,35 @@ +set $mod Mod4 +# direction keys +set $left h +set $down j +set $up k +set $right l + +set $menu dmenu_path | dmenu | xargs swaymsg exec -- +set $term alacritty +set $browser brave +set $file pcmanfm +set $wallpapers "$HOME/.config/wallpapers" +set $lock "swaylock -F -f -i $wallpapers/lock.png" +set $screenshot "flameshot full -c" +set $screenshot_gui "flameshot gui" +set $raise_volume "pactl set-sink-mute 0 0 && pactl set-sink-volume 0 +2%" +set $lower_volume "pactl set-sink-mute 0 0 && pactl set-sink-volume 0 -2%" +set $raise_backlight "xbacklight +10" +set $lower_backlight "xbacklight -10" + +set $ws1 1:TTY +set $ws2 2:WEB +set $ws3 3:DEV +set $ws4 4:SBX +set $ws5 5:GAM +set $ws6 6:MED +set $ws7 7:DOC +set $ws8 8:DFX +set $ws9 9:ETC + +default_border pixel +gaps inner 4 +gaps outer 4 + +set $screen_timeout 600 diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..70940b0 --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,72 @@ +{ + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": ["sway/window"], + "modules-right": ["idle_inhibitor", "pulseaudio", "cpu", "memory", "temperature", "backlight", "battery", "tray", "clock"], + //"sway/mode": { + // "format": "{mode}" + //}, + "sway/workspaces": { + "format": "{name}" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + "icon-size": 22, + "spacing": 10 + }, + "clock": { + "format": "{:%a %b %d, %R}", + "tooltip-format": "{calendar}", + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + "critical-threshold": 80, + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + "format": "{percent}% {icon}", + "format-icons": ["", ""] + }, + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""] + }, + "pulseaudio": { + "scroll-step": 2, + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, +} diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..c0d4d9b --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,255 @@ +* { + border: none; + border-radius: 0; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; + min-height: 0; +} + +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#mpd { + padding: 0 10px; + margin: 0 4px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +}