commit 8f9e6bf1c7e3b6064f3124125e94f9ee6430b25e Author: Yorick Barbanneau Date: Tue Sep 3 11:52:04 2019 +0200 First commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..31e3fb2 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +Sway sesktop configuration +-------------------------- + +This repository contain all configuration for my desktop : [sway][l_sway] (and +swaylock, swayidle), [mako][l_mako] and [waybar][l_waybar]. Execute +`install.sh` install it properly. + +[l_sway]:https://swayvm.org +[l_mako]:https://wayland.emersion.fr/mako/ +[l_waybar]:https://github.com/Alexays/Waybar diff --git a/bin/import-gsettings.sh b/bin/import-gsettings.sh new file mode 100755 index 0000000..dfc2d98 --- /dev/null +++ b/bin/import-gsettings.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# usage: import-gsettings : : ... + +expression="" +for pair in "$@"; do + IFS=:; set -- $pair + expressions="$expressions -e 's:^$2=(.*)$:gsettings set org.gnome.desktop.interface $1 \"\1\":e'" +done +IFS= +eval exec sed --debug -E $expressions "${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini diff --git a/bin/sway.sh b/bin/sway.sh new file mode 100755 index 0000000..00571ac --- /dev/null +++ b/bin/sway.sh @@ -0,0 +1,8 @@ +#/bin/bash +export QT_AUTO_SCREEN_SCALE_FACTOR=0 +export QT_QPA_PLATFORM=wayland-egl +export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 +export MOZ_ENABLE_WAYLAND=1 +export QT_QPA_PLATFORMTHEME=gtk2 + +sway diff --git a/conf/gtk-2.0/gtkfilechooser.ini b/conf/gtk-2.0/gtkfilechooser.ini new file mode 100644 index 0000000..b4e0459 --- /dev/null +++ b/conf/gtk-2.0/gtkfilechooser.ini @@ -0,0 +1,11 @@ +[Filechooser Settings] +LocationMode=filename-entry +ShowHidden=false +ShowSizeColumn=true +GeometryX=0 +GeometryY=0 +GeometryWidth=640 +GeometryHeight=516 +SortColumn=name +SortOrder=descending +StartupMode=recent diff --git a/conf/gtk-3.0/settings.ini b/conf/gtk-3.0/settings.ini new file mode 100644 index 0000000..fd6de8b --- /dev/null +++ b/conf/gtk-3.0/settings.ini @@ -0,0 +1,16 @@ +[Settings] +gtk-theme-name=Arc-Darker-solid +gtk-font-name=DejaVu Sans 10 +gtk-cursor-theme-name=Adwaita +gtk-cursor-theme-size=0 +gtk-button-images=0 +gtk-menu-images=0 +gtk-icon-theme-name=Papirus-Dark +gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintslight +gtk-xft-rgba=none diff --git a/conf/mako/config b/conf/mako/config new file mode 100644 index 0000000..b053c7c --- /dev/null +++ b/conf/mako/config @@ -0,0 +1,31 @@ + +markup=1 +actions=1 +anchor=top-right + +# Format +font=Fira Code 10 +border-color=#1cd180 +border-size=2 +background-color=#353535ff +text-color=#fdfdfd +format=%s (%a)\n%b + +# icons +icon-path=/usr/share/icons/Papirus + +# Hidden format +[hidden] +format=Hidden: %h [%t] + +[urgency=low] + +[urgency=low actionable] + +[urgency=normal actionable] + +[urgency=high] +border-color=#f268b3 + +[urgency=high actionable] +border-color=#6c71c4 diff --git a/conf/sway/config b/conf/sway/config new file mode 100644 index 0000000..9d9a6c4 --- /dev/null +++ b/conf/sway/config @@ -0,0 +1,174 @@ +set $mod Mod4 +set $left h +set $down j +set $up k +set $right l +set $term termite +set $menu rofi -location 0 -show combi ~/.config/i3/rofi.config + +gaps inner 5 + +# Input configuration +input * xkb_layout "us" +input * xkb_variant "altgr-intl" + +# i3 basic operation (reload, menu, menu etc.) +bindsym $mod+Shift+c reload +bindsym $mod+Shift+e exit +bindsym $mod+Return exec $term +bindsym $mod+d exec $menu +bindsym $mod+Alt+l exec swaylock + +# kill focused window +bindsym $mod+Shift+q kill + +# +# Moving around: +# +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right + +# or use $mod+[up|down|left|right] +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# 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 + +# ditto, with arrow keys +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: +# ----------- +set $ws1 "1: " +set $ws2 "2: " +set $ws3 "3: " +set $ws4 "4:  +set $ws5 "5: " + +assign [app_id="^firefox$"] $ws3 +assign [class="keepassxc"] $ws3 +assign [app_id="org.remmina.*"] $ws5 + +# 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 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +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 + +# Layout stuff +# ----------- + +#split +bindsym $mod+b splith +bindsym $mod+v splitv + +# layout +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +bindsym $mod+f fullscreen + +# Toggle floating mode +bindsym $mod+Shift+space floating toggle + +# Swap focus between the tiling area and the floating area +bindsym $mod+space focus mode_toggle + +# move focus to the parent container +bindsym $mod+a focus parent + +# Media keys +# ---------- + +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5% +bindsym XF86AudioLowerVolume exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5% +bindsym XF86AudioMute exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle + +# More resize +# ----------- + +bindsym $mod+r mode "resize" +mode "resize" { + bindsym $left resize shrink width 10 px or 10 ppt + bindsym $down resize grow height 10 px or 10 ppt + bindsym $up resize shrink height 10 px or 10 ppt + bindsym $right resize grow width 10 px or 10 ppt + +# ditto, with arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + +# return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} + +# Workspaces +# ---------- + + +# Appareance +# ---------- + +font pango:FuraCode Nerd Font Mono 10 +default_border pixel 1 +title_align center +client.focused #f268b3 #a82d70 #ffffff #f268b3 #f268b3 +client.unfocused #000000 #4d3d46 #cccccc #000000 #000000 + +output * bg ~/Documents/ressources/wallpapers/building_cyberpunk.jpg fill + +# Status Bar: +bar { +swaybar_command waybar +} + +# Automatic startup +# ----------------- +exec_always import-gsettings.sh \ + icon-theme:gtk-icon-theme-name \ + cursor-theme:gtk-cursor-theme-name \ + gtk-theme:gtk-theme-name \ + font-name:gtk-font-name + +exec swayidle \ + timeout 300 'swaylock' \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock' + +exec mako + diff --git a/conf/sway/i3status.config b/conf/sway/i3status.config new file mode 100644 index 0000000..a37cd44 --- /dev/null +++ b/conf/sway/i3status.config @@ -0,0 +1,76 @@ +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + output_format = "i3bar" + colors = true + interval = 3 + + color_bad = "#cf6a4c" + color_degraded = "#f9ee98" + color_good = "#8f9d6a" +} + +#order += "disk /" +order += "cpu_usage" +#order += "cpu_temperature 0" +order += "wireless _first_" +order += "battery 0" +order += "volume master" +order += "tztime local" + +wireless _first_ { + format_up = " %essid:%quality" + format_down = " ---" +} + +ethernet _first_ { + # if you use %speed, i3status requires root privileges + format_up = " %ip" + format_down = " ---" +} + +battery 0 { + hide_seconds = true + integer_battery_capacity = true + low_threshold = 15 + threshold_type = "percentage" + format = "%status %percentage %remaining" + status_chr = "" + status_bat = "" + status_full = "" +} + +tztime local { + format = " %a %d %b  %I:%M %p" +} + +disk "/" { + format = "%used/%total" + threshold_type = "percentage" + low_threshold = 10 +} + +cpu_usage { + format = " %usage" +} + +volume master { + format = " %volume" + format_muted = " (%volume)" + device = "default" + mixer = "Master" + mixer_idx = 0 +} + +cpu_temperature 0 { + format = "%degrees°C" + max_threshold = 65 +} + + diff --git a/conf/sway/lock.sh b/conf/sway/lock.sh new file mode 100755 index 0000000..4a63e3b --- /dev/null +++ b/conf/sway/lock.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +swaylock -i ~/Documents/ressources/wallpapers/morty.jpg diff --git a/conf/swaylock/config b/conf/swaylock/config new file mode 100644 index 0000000..b0550b6 --- /dev/null +++ b/conf/swaylock/config @@ -0,0 +1,5 @@ +# swaylock configuration file +ignore-empty-password +show-failed-attempts +daemonize +image=~/Documents/ressources/wallpapers/morty.jpg diff --git a/conf/waybar/config b/conf/waybar/config new file mode 100644 index 0000000..09961bd --- /dev/null +++ b/conf/waybar/config @@ -0,0 +1,75 @@ +{ + "layer": "top", + "height":"22", + "disable-toolptips": true, + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": [], + "modules-right": ["network", "cpu", "backlight", "battery", "pulseaudio", "clock", "tray"], + "sway/mode": { + "format": "{}" + }, + "sway/workspace": { + "disable-scroll": true + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "clock": { + "tooltip": false, + "tooltip-format": "{:%Y-%m-%d | %H:%M}", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "backlight": { + //"device": "intel_backlight", + "format": "{percent}% {icon}", + "format-icons": ["", ""], + "tooltip": false + }, + "battery": { + "tooltip": false, + "states": { + "warning": 30, + "critical": 15 + + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""] + }, + "network": { + "tooltip": false, + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + "tooltip": false, + "format": "{volume}% {icon}", + "format-bluetooth": "{volume}% {icon}", + "format-muted": "", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphones": "", + "handsfree": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + } + } + +} diff --git a/conf/waybar/style.css b/conf/waybar/style.css new file mode 100644 index 0000000..d0ac3df --- /dev/null +++ b/conf/waybar/style.css @@ -0,0 +1,71 @@ +* { + border: none; + border-radius: 0; + font-family: "FuraCode Nerd Font"; + font-size: 13px; + min-height:0; +} + +window#waybar { + background:#323232 ; + color:#ddd; +} + +#workspaces { + color:#fff; + +} +#workspaces button { + margin:0 3px; + padding:4px 4px; + background:#323232 ; + color:#9c9c9c; +} + +#workspaces button:hover { + box-shadow:inherit; + text-shadow:inherit; + color:#f268b3; + border-bottom: 1px solid #f268b3; +} + +#workspaces button.focused { + background:#1cd180 ; + color:#000; +} + +#clock, +#cpu, +#memory, +#backlight, +#network, +#tray, +#mode, +#battery, +#idle_inhibitor { + padding: 2px 4px; + margin: 0 6px; + background-color: transparent; +} + +#mode{ + background:red; + font-weight:bold; +} + +#pulseaudio {} +#pulseaudio.muted {} + +#battery { + border-bottom:1px solid transparent; +} + +#battery.charging { + border-color:#1cd180; + color:#1cd180; +} + +#battery.critical:not(.charging) { + border-color:#f268b3; + color:#f268b3; +} diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..cd73287 --- /dev/null +++ b/install.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +required="sway swayidle swaylock waybar" + +printf "Checking required programs :\n" +for p in $required +do + command -v $p >/dev/null 2>&1 || { printf "\t%s is not installed, bye\n" $p; exit 10; } + printf "\t%s found\n" $p +done + +printf "Create symblinks for configurations :\n" +cd conf +while read d +do + printf "\t%s conf folder found\n" $d + rm -rf $HOME/.config/${d%/} + ln -s "$(pwd)/${d%/}" "$HOME/.config/${d%/}" +done < <(ls -d -1 */) +cd .. + +printf "Create symblink for executables\n" +cd bin +while read d +do + printf "\t%s script found\n" "$d" + #rm -rf $HOME/.local/bin/${d} + #ln -s "$(pwd)/${d}" "$HOME/.local/bin/${d}" +done < <(ls -1 *) +exit 0