From c97df6b70a475a67c1fd52d1d496fd642bf7a983 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Wed, 6 Jan 2021 08:41:25 +0100 Subject: [PATCH] [WIP] Gentoo / Sway --- Bin/build-kernel.sh | 9 ++ Bin/rebuild-world.sh | 4 + config/htop/htoprc | 13 ++- config/khard/khard.conf | 2 +- config/sway/config | 240 ++++++++++++++++++++++++++++++++++++++++ config/termite/config | 42 +++++++ config/wofi/config | 8 ++ config/wofi/style.css | 49 ++++++++ dotfiles/aliases | 4 +- dotfiles/profile | 10 -- dotfiles/tmux.conf | 9 +- dotfiles/zshrc | 46 ++++---- 12 files changed, 385 insertions(+), 51 deletions(-) create mode 100755 Bin/build-kernel.sh create mode 100755 Bin/rebuild-world.sh create mode 100644 config/sway/config create mode 100644 config/termite/config create mode 100644 config/wofi/config create mode 100644 config/wofi/style.css diff --git a/Bin/build-kernel.sh b/Bin/build-kernel.sh new file mode 100755 index 0000000..041da65 --- /dev/null +++ b/Bin/build-kernel.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +cd /usr/src/linux + +make menuconfig + +make -j17 +make modules_install +make install diff --git a/Bin/rebuild-world.sh b/Bin/rebuild-world.sh new file mode 100755 index 0000000..1f9fe2c --- /dev/null +++ b/Bin/rebuild-world.sh @@ -0,0 +1,4 @@ +#! /bin/bash + +emerge --ask --verbose --update --changed-use --deep @world + diff --git a/config/htop/htoprc b/config/htop/htoprc index 778dd3d..dbf5c98 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -12,15 +12,18 @@ show_program_path=1 highlight_base_name=0 highlight_megabytes=1 highlight_threads=1 -tree_view=0 +tree_view=1 header_margin=1 detailed_cpu_time=0 cpu_count_from_zero=0 +show_cpu_usage=1 +show_cpu_frequency=0 update_process_names=0 account_guest_in_cpu_meter=0 color_scheme=0 +enable_mouse=1 delay=15 -left_meters=AllCPUs -left_meter_modes=1 -right_meters=Hostname Tasks LoadAverage Uptime Battery Blank Memory Swap -right_meter_modes=2 2 2 2 2 2 1 1 +left_meters=Hostname Tasks Blank Blank LeftCPUs4 Memory +left_meter_modes=2 2 2 2 1 1 +right_meters=Clock Uptime LoadAverage Blank RightCPUs4 Swap +right_meter_modes=2 2 2 2 1 1 diff --git a/config/khard/khard.conf b/config/khard/khard.conf index 6e49efb..423151b 100644 --- a/config/khard/khard.conf +++ b/config/khard/khard.conf @@ -19,7 +19,7 @@ preferred_phone_number_type = pref, cell, home preferred_email_address_type = pref, home, work [vcard] -private_objects = +private_objects = Jabber, Skype, Twitter preferred_version = 3.0 search_in_source_files = no skip_unparsable = no diff --git a/config/sway/config b/config/sway/config new file mode 100644 index 0000000..0723966 --- /dev/null +++ b/config/sway/config @@ -0,0 +1,240 @@ +# Keyboard definition +input "type:keyboard" { + xkb_layout us + xkb_variant intl + xkb_options "compose:rwin" +} + +# Screens definitions +output HDMI-A-3 resolution 2560x1080@75Hz position 0,0 adaptive_sync on +output DP-1 resolution 1920x1080@75Hz position 2560,0 + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 + +# Your preferred terminal emulator +set $term /usr/bin/termite + +# Your preferred application launcher +set $menu wofi -c ~/.config/wofi/config -s ~/.config/wofi/style.css -I + +# Screen capture +set $ps1 Print +set $ps2 Control+Print + +# Wallpaper +set $wallpapers_path $HOME/Nextcloud/images/Wallpaper/Rotation + +# Modals +set $modalWidth 1280 +set $modalHeight 800 + +### Gnome settings +# TODO: à vérifier/modifier +set $gnome-schema org.gnome.desktop.interface +exec_always { + gsettings set $gnome-schema gtk-theme 'NordSur-dark' + gsettings set $gnome-schema icon-theme 'Tela-circle-grey-dark' + gsettings set $gnome-schema font-name 'Roboto 10' + gsettings set $gnome-schema monospace-font-name 'Roboto Mono 10' + gsettings set $gnome-schema document-font-name 'Roboto 10' + gsettings set org.gnome.desktop.wm.preferences titlebar-font 'Roboto Bold 10' + gsettings set org.gnome.desktop.wm.preferences button-layout '' + gsettings set org.gnome.desktop.default-applications.terminal exec $term + gsettings set org.gnome.desktop.default-applications.terminal exec-arg '' +} + + +### Idle configuration +exec swayidle -w \ + timeout 300 'swaylock -f' \ + timeout 305 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f' + +### Autostart +exec nm-applet --indicator + +### Window config +for_window [app_id=".*"] border pixel 4 +for_window [class="Spotify"] move container to workspace 4 +for_window [class="Geeqie"] floating enable +for_window [app_id="termite" title="Pulse Mixer"] floating enable, resize set $modalWidth $modalHeight +for_window [app_id="termite" title="Calendar"] floating enable, resize set $modalWidth $modalHeight +for_window [app_id="termite" title="File Browser"] floating enable, resize set $modalWidth $modalHeight +for_window [app_id="termite" title="Ncdu"] floating enable, resize set $modalWidth $modalHeight +for_window [app_id="termite" title="Top"] floating enable, resize set $modalWidth $modalHeight + +### Key bindings +# +# Basics: +# + +# Start a terminal +bindsym $mod+Return exec $term + +# Kill focused window +bindsym control+q kill + +# Start your launcher +bindsym Alt+space exec $menu + +# lock screen +bindsym $mod+Alt+l exec swaylock -f + +# Reload the configuration file +bindsym $mod+Shift+r reload + +# Exit sway (logs you out of your Wayland session) +bindsym $mod+Shift+x exec swaynag -t warning -m 'End session?' -b 'Yes, exit sway' 'swaymsg exit' + +# File Browser +bindsym $mod+f exec "$term -t 'File Browser' -e ranger" + +# Disk Usage +bindsym $mod+Shift+f exec "$term -t 'Ncdu' -e 'ncdu --color=dark'" + +# Top +bindsym $mod+t exec "$term -t 'Top' -e bpytop" + +# Calendar +bindsym $mod+c exec "$term -t 'Calendar' -e khal interactive" + +# +# Multimedia keys +# + +bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym $mod+shift+p exec "$term -t 'Pulse Mixer' -e pulsemixer" + +bindsym XF86MonBrightnessDown exec brightnessctl set 5%- +bindsym XF86MonBrightnessUp exec brightnessctl set +5% + + + +# +# Screenshots +# +bindsym $ps1 exec grim ~/Pictures/ps_$(date +"%Y%m%d%H%M%S").png +bindsym $ps2 exec grim -g "$(slurp)" ~/Pictures/ps_$(date +"%Y%m%d%H%M%S").png + +# +# Moving around: +# +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# Move focussed workspace +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# +# Workspaces: +# +bindsym $mod+1 workspace number 1 +bindsym $mod+2 workspace number 2 +bindsym $mod+3 workspace number 3 +bindsym $mod+4 workspace number 4 +bindsym $mod+5 workspace number 5 +bindsym $mod+6 workspace number 6 +bindsym $mod+7 workspace number 7 +bindsym $mod+8 workspace number 8 +bindsym $mod+9 workspace number 9 +bindsym $mod+0 workspace number 10 +# Move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number 1 +bindsym $mod+Shift+2 move container to workspace number 2 +bindsym $mod+Shift+3 move container to workspace number 3 +bindsym $mod+Shift+4 move container to workspace number 4 +bindsym $mod+Shift+5 move container to workspace number 5 +bindsym $mod+Shift+6 move container to workspace number 6 +bindsym $mod+Shift+7 move container to workspace number 7 +bindsym $mod+Shift+8 move container to workspace number 8 +bindsym $mod+Shift+9 move container to workspace number 9 +bindsym $mod+Shift+0 move container to workspace number 10 +# switch to previous/next workspace +bindsym Mod1+Control+a workspace prev_on_output +bindsym Mod1+Control+d workspace next_on_output + + +# +# Layout stuff: +# +bindsym $mod+backslash splith +bindsym $mod+minus splitv + +# Switch the current container between different layout styles +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# Make the current focus fullscreen +bindsym $mod+Mod1+f fullscreen + +# Toggle the current focus between tiling and floating mode +bindsym $mod+Shift+space floating toggle + +# Swap focus between the tiling area and the floating area +bindsym $mod+space focus mode_toggle + +# Toggle second screen (home / homeoffice mode) +bindsym $mod+p output DP-1 toggle + +# +# Resizing containers: +# +bindsym $mod+r mode "resize" + +mode "resize" { + bindsym h resize shrink width 10px + bindsym j resize grow height 10px + bindsym k resize shrink height 10px + bindsym l resize grow width 10px + + bindsym Return mode "default" + bindsym Escape mode "default" +} + +# +# Status Bar: +# +bar { + swaybar_command waybar +} + +# +# gaps +# +gaps inner 10 +gaps outer -5 +smart_gaps off + +# +# Titlebars +# +default_border pixel 4 +default_floating_border normal +hide_edge_borders smart +titlebar_padding 5 2 + +# +# Colors +# +client.focused #5e81ac #2e3440 #d8dee9 #5e81ac #5e81ac +client.focused_inactive #3b4252 #3b4252 #d8dee9 #4c566a #4c566a +client.unfocused #434c5e #434c5e #d8dee9 #4c566a #4c566a +client.urgent #bf616a #bf616a #d8dee9 #d08770 #d08770 + +# +# Background +# +output * bg $(find $wallpapers_path -type f | shuf -n 1) fill + +include /etc/sway/config.d/* diff --git a/config/termite/config b/config/termite/config new file mode 100644 index 0000000..a8b7582 --- /dev/null +++ b/config/termite/config @@ -0,0 +1,42 @@ +# Copyright (c) 2016-present Arctic Ice Studio +# Copyright (c) 2016-present Sven Greb + +# Project: Nord Termite +# Repository: https://github.com/arcticicestudio/nord-termite +# License: MIT + +[options] +allow_bold = true +bold_is_bright = true +clickable_url = true +cursor_shape = block +font = Droid Sans Mono Slashed for Powerline 9 + +[colors] +cursor = #d8dee9 +cursor_foreground = #2e3440 + +foreground = #d8dee9 +foreground_bold = #d8dee9 +background = #2e3440 + +highlight = #4c566a + +color0 = #3b4252 +color1 = #bf616a +color2 = #a3be8c +color3 = #ebcb8b +color4 = #81a1c1 +color5 = #b48ead +color6 = #88c0d0 +color7 = #e5e9f0 +color8 = #4c566a +color9 = #bf616a +color10 = #a3be8c +color11 = #ebcb8b +color12 = #81a1c1 +color13 = #b48ead +color14 = #8fbcbb +color15 = #eceff4 + +# vim: ft=dosini cms=#%s diff --git a/config/wofi/config b/config/wofi/config new file mode 100644 index 0000000..6fbd620 --- /dev/null +++ b/config/wofi/config @@ -0,0 +1,8 @@ +show=run +term=termite +layer=overlay +always_parse_args=true +allow_images=true +image_size=16 +width=25% +insensitive=true diff --git a/config/wofi/style.css b/config/wofi/style.css new file mode 100644 index 0000000..44d447c --- /dev/null +++ b/config/wofi/style.css @@ -0,0 +1,49 @@ +* { + font-family: "Sarasa Term SC"; + font-size: 18px; +} + +window { + margin: 0px; + border: 2px solid #8fbcbb; + background-color: #2e3440; + border-radius: 16px; +} + +#input { + margin: 5px; + color: #e5e9f0; + background-color: #2e3440; + border-radius: 16px; +} + +#inner-box { + margin: 5px; + border: none; + background-color: #2e3440; +} + +#outer-box { + margin: 5px; + border: none; + background-color: #2e3440; + border-radius: 16px; +} + +#scroll { + margin: 0px; + border: none; +} + +#text { + margin: 5px; + border: none; + color: #d8dee9; +} + +#entry:selected { + font-weight: bold; + border-radius: 0; + outline: none; + background-color: #3b4252; +} diff --git a/dotfiles/aliases b/dotfiles/aliases index 83be26e..6588aae 100644 --- a/dotfiles/aliases +++ b/dotfiles/aliases @@ -31,6 +31,6 @@ alias radioDoom='mpv -playlist http://kuorinka.duckdns.org:2718/doom.m3u' alias dh="dfc -t xfs,ext2 2>/dev/null" -alias vim="nvim" - alias irc="ssh malpartida -t tmux attach-session -t irc" + +alias getClass="swaymsg -t get_tree| grep $1" diff --git a/dotfiles/profile b/dotfiles/profile index a835bb0..611e068 100644 --- a/dotfiles/profile +++ b/dotfiles/profile @@ -26,13 +26,3 @@ if [ -n "$DISPLAY" ]; then fi export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/openssh_agent" - -# QMK HHKB -setxkbmap -option compose:rctrl -# True HHKB -setxkbmap -option compose:rwin - -# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. -export PATH="$PATH:$HOME/.rvm/bin" - -[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf index 9e813a4..9eff1f5 100644 --- a/dotfiles/tmux.conf +++ b/dotfiles/tmux.conf @@ -3,8 +3,6 @@ set -g base-index 1 set -g pane-base-index 1 # Status bar styling and content. -#set -g status-bg black -#set -g status-fg white set -g status-left '#S ' # Plugins @@ -25,10 +23,6 @@ bind-key J resize-pane -D bind-key K resize-pane -U bind-key L resize-pane -R -# Highlight the active window in the status bar. -set-window-option -g window-status-current-bg cyan -set-window-option -g window-status-current-fg black - # Don't prompt to kill panes/windows. bind-key x kill-pane bind-key & kill-window @@ -40,6 +34,9 @@ bind - split-window -v # Maximize pane, e.g. for copying. bind-key z resize-pane -Z +# Window title string (uses statusbar variables) +set -g set-titles-string '#T' + # Reload tmux conf. unbind r bind r source-file ~/.tmux.conf\; display "Reloaded conf." diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 425869c..7c4c998 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -83,6 +83,9 @@ plugins=( node ) +#zstyle :omz:plugins:ssh-agent agent-forwarding on +#zstyle :omz:plugins:ssh-agent identities id_rsa + source $ZSH/oh-my-zsh.sh # User configuration @@ -111,12 +114,6 @@ source $ZSH/oh-my-zsh.sh # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -if [[ -n $SSH_CONNECTION ]]; then - export EDITOR='vim' -else - export EDITOR="mvim" -fi - zstyle -s ':completion:*:hosts' hosts _ssh_config [[ -r ~/.ssh/config ]] && _ssh_config+=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) zstyle ':completion:*:hosts' hosts $_ssh_config @@ -125,24 +122,6 @@ if [ $TILIX_ID ] || [ $VTE_VERSION ]; then source /etc/profile.d/vte.sh fi -#if [ -f ~/.ssh/agent.env ] ; then -# . ~/.ssh/agent.env > /dev/null -# if ! kill -0 $SSH_AGENT_PID > /dev/null 2>&1; then -# echo "Stale agent file found. Spawning a new agent. " -# eval `ssh-agent | tee ~/.ssh/agent.env` -# ssh-add -# fi -#else -# echo "Starting ssh-agent" -# eval `ssh-agent | tee ~/.ssh/agent.env` -# ssh-add -#fi - -if [ -z "$SSH_AUTH_SOCK" ] ; then - eval `ssh-agent -s` - ssh-add ~/.ssh/id_rsa -fi - # Load dircolors test -r "~/.dir_colors" && eval $(dircolors ~/.dir_colors) @@ -167,7 +146,20 @@ ssh() { tmux rename-window "zsh" } +if test -z "${XDG_RUNTIME_DIR}"; then + export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir + if ! test -d "${XDG_RUNTIME_DIR}"; then + mkdir "${XDG_RUNTIME_DIR}" + chmod 0700 "${XDG_RUNTIME_DIR}" + fi +fi -# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. -source /home/dbroqua/.rvm/scripts/rvm -export PATH="$PATH:$HOME/.rvm/bin" +export SSH_AUTH_SOCK=${HOME}/.ssh/agent +if ! pgrep -u ${USER} ssh-agent > /dev/null; then + rm -f ${SSH_AUTH_SOCK} +fi + +if [ ! -S ${SSH_AUTH_SOCK} ]; then + eval $(ssh-agent -a ${SSH_AUTH_SOCK} 2> /dev/null) + ssh-add +fi