From 2eff456ae68e4c2976be9f7e339025e9a1325b2f Mon Sep 17 00:00:00 2001 From: rhjr Date: Fri, 9 May 2025 10:27:58 +0200 Subject: [PATCH 01/10] Added: sway configuration; Added: #282828 as solid background colour --- .config/sway/config | 219 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 .config/sway/config diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..3a97ddd --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,219 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term foot +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +set $menu dmenu_path | dmenu | xargs swaymsg exec -- + +include /etc/sway/config-vars.d/* + +### Output configuration +# +# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) +output * background #282828 solid_color +# +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# +# exec swayidle -w \ +# timeout 300 'swaylock -f -c 000000' \ +# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ +# before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec 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' +# +# Moving around: +# + # Move your focus 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: +# + # Switch to workspace + 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 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # 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+s layout stacking + bindsym $mod+w layout tabbed + 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+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 +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + position top + + # When the status_command prints a new line to stdout, swaybar updates. + # The default just shows the current date and time. + status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done + + colors { + statusline #ffffff + background #323232 + inactive_workspace #32323200 #32323200 #5c5c5c + } +} + +include /etc/sway/config.d/* From 16cb09c39c7d33847e180633e4c8a4d91fb86fe3 Mon Sep 17 00:00:00 2001 From: rhjr Date: Fri, 9 May 2025 11:13:27 +0200 Subject: [PATCH 02/10] Changed: vimrc to ~/.config/vim --- .vimrc => .config/vim/vimrc | 3 +++ 1 file changed, 3 insertions(+) rename .vimrc => .config/vim/vimrc (88%) diff --git a/.vimrc b/.config/vim/vimrc similarity index 88% rename from .vimrc rename to .config/vim/vimrc index f912fa5..c3def96 100644 --- a/.vimrc +++ b/.config/vim/vimrc @@ -3,6 +3,9 @@ syntax on set encoding=utf8 set nobackup nowb noswapfile +set viminfo= +set runtimepath^=$HOME/.config/vim + set relativenumber set autoindent expandtab smarttab tabstop=2 shiftwidth=2 set so=7 " keep up to 7 lines visible during scrolling. From f48760bd9e75c0d665583f7c038ab349496c7b7b Mon Sep 17 00:00:00 2001 From: rhjr Date: Fri, 9 May 2025 11:16:58 +0200 Subject: [PATCH 03/10] Added: .bashrc --- .bashrc | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .bashrc diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..35de0b5 --- /dev/null +++ b/.bashrc @@ -0,0 +1,83 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# aliases +alias config='/usr/bin/git --git-dir=$HOME/.config.remote/ --work-tree=$HOME' + +alias cls='clear' +alias ls='ls -la' + +# variables +export VIMINIT='source $HOME/.config/vim/vimrc' +export XDG_CONFIG_HOME=$HOME/.config From e2cba935421829ec2021d3b5641307537575972d Mon Sep 17 00:00:00 2001 From: rhjr Date: Fri, 9 May 2025 11:35:53 +0200 Subject: [PATCH 04/10] Added: install.sh --- install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..2e7a59f --- /dev/null +++ b/install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +## + +apt update +apt upgrade + +## workspace +mkdir -p $HOME/devel +mkdir -p $HOME/documents +mkdir -p $HOME/downloads +mkdir -p $HOME/programs +mkdir -p $HOME/machines +mkdir -p $HOME/scratch From e5c18ec8b02844bc3b5f86d2beb8d68339b8ff68 Mon Sep 17 00:00:00 2001 From: rhjr Date: Fri, 9 May 2025 11:59:18 +0200 Subject: [PATCH 05/10] Fixed: correctly sorting (dot) directories using ls --- .bashrc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.bashrc b/.bashrc index 35de0b5..6c136a8 100644 --- a/.bashrc +++ b/.bashrc @@ -72,12 +72,13 @@ xterm*|rxvt*) ;; esac +# variables +export VIMINIT='source $HOME/.config/vim/vimrc' +export XDG_CONFIG_HOME=$HOME/.config +export LC_COLLATE="C" + # aliases alias config='/usr/bin/git --git-dir=$HOME/.config.remote/ --work-tree=$HOME' alias cls='clear' -alias ls='ls -la' - -# variables -export VIMINIT='source $HOME/.config/vim/vimrc' -export XDG_CONFIG_HOME=$HOME/.config +alias ls='ls -laA --group-directories-first --color=auto' From ba27c84676814b2a0b619061fed5f3a8c22a35f5 Mon Sep 17 00:00:00 2001 From: rhjr Date: Mon, 12 May 2025 21:07:49 +0200 Subject: [PATCH 06/10] Added: minimal waybar config --- .bashrc | 6 +++++- .config/sway/config | 14 +++----------- .config/waybar/config.jsonc | 13 +++++++++++++ .config/waybar/style.css | 4 ++++ install.sh | 36 +++++++++++++++++++++++++++++------- 5 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 .config/waybar/config.jsonc create mode 100644 .config/waybar/style.css diff --git a/.bashrc b/.bashrc index 6c136a8..6587f72 100644 --- a/.bashrc +++ b/.bashrc @@ -73,10 +73,14 @@ xterm*|rxvt*) esac # variables +export PATH=$PATH:/usr/sbin:/sbin + +export LESSHISTFILE=- export VIMINIT='source $HOME/.config/vim/vimrc' -export XDG_CONFIG_HOME=$HOME/.config export LC_COLLATE="C" +export WLR_NO_HARDWARE_CURSORS=1 + # aliases alias config='/usr/bin/git --git-dir=$HOME/.config.remote/ --work-tree=$HOME' diff --git a/.config/sway/config b/.config/sway/config index 3a97ddd..c802775 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -198,22 +198,14 @@ mode "resize" { } bindsym $mod+r mode "resize" +gaps outer 10 + # # Status Bar: # # Read `man 5 sway-bar` for more information about this section. bar { - position top - - # When the status_command prints a new line to stdout, swaybar updates. - # The default just shows the current date and time. - status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done - - colors { - statusline #ffffff - background #323232 - inactive_workspace #32323200 #32323200 #5c5c5c - } + swaybar_command waybar } include /etc/sway/config.d/* diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc new file mode 100644 index 0000000..48587e0 --- /dev/null +++ b/.config/waybar/config.jsonc @@ -0,0 +1,13 @@ +{ + "layer": "top", + "position": "right", + "height": "100%", + "width": 30, + "margin-right": 10, + "margin-top": 10, + "margin-bottom": 10, + + "network": { + "format-wifi": "{icon}" + } +} diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..1cdcd0a --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,4 @@ + +#waybar { + +} diff --git a/install.sh b/install.sh index 2e7a59f..3c76e65 100755 --- a/install.sh +++ b/install.sh @@ -1,14 +1,36 @@ #!/bin/bash -## +set -xe + +## initial apt update apt upgrade +## rights +apt install -y sudo + ## workspace -mkdir -p $HOME/devel -mkdir -p $HOME/documents -mkdir -p $HOME/downloads -mkdir -p $HOME/programs -mkdir -p $HOME/machines -mkdir -p $HOME/scratch +mkdir -p /home/rhjr/devel +mkdir -p /home/rhjr/documents +mkdir -p /home/rhjr/downloads +mkdir -p /home/rhjr/programs +mkdir -p /home/rhjr/machines +mkdir -p /home/rhjr/scratch + +## environment +apt install -y \ + sway mesa-utils + +## development +apt install -y \ + git file \ + vim \ + build-essential + +## user +apt install -y neofetch + +apt install -y \ + sway \ + waybar From 00e1738716eef66bf877cce4bbb61200725e10df Mon Sep 17 00:00:00 2001 From: rhjr Date: Fri, 9 May 2025 13:20:10 +0200 Subject: [PATCH 07/10] Added: assigning sudo permissions to rhjr --- install.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/install.sh b/install.sh index 3c76e65..37eff21 100755 --- a/install.sh +++ b/install.sh @@ -10,6 +10,19 @@ apt upgrade ## rights apt install -y sudo +## group (sudo permissions) +# we create a new group to prevent the annoying .sudo_as_admin_succesfull. + +export PATH=$PATH:/usr/sbin + +groupadd -r wheel +usermod -aG wheel rhjr +usermod -aG input rhjr + +echo "%wheel ALL=(ALL:ALL) ALL" > /etc/sudoers +gpasswd --delete rhjr sudo +gpasswd --delete rhjr admin + ## workspace mkdir -p /home/rhjr/devel mkdir -p /home/rhjr/documents From 89842d1fe61df429ec95dd555d74ba98c95a6317 Mon Sep 17 00:00:00 2001 From: rhjr Date: Thu, 15 May 2025 14:53:33 +0200 Subject: [PATCH 08/10] Added: poweroff command --- .bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.bashrc b/.bashrc index 6587f72..bf991b1 100644 --- a/.bashrc +++ b/.bashrc @@ -83,6 +83,7 @@ export WLR_NO_HARDWARE_CURSORS=1 # aliases alias config='/usr/bin/git --git-dir=$HOME/.config.remote/ --work-tree=$HOME' +alias poweroff='shutdown -h now' alias cls='clear' alias ls='ls -laA --group-directories-first --color=auto' From adbf560f472864c24109aece590dc407e2578995 Mon Sep 17 00:00:00 2001 From: rhjr Date: Thu, 15 May 2025 14:54:11 +0200 Subject: [PATCH 09/10] Added: custom minimal waybar configuration --- .config/waybar/config.jsonc | 23 +++++++++++++++++++++-- .config/waybar/style.css | 29 ++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index 48587e0..e8fca53 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -7,7 +7,26 @@ "margin-top": 10, "margin-bottom": 10, - "network": { - "format-wifi": "{icon}" + "modules-left": [ + "sway/workspaces" + ], + + "modules-right": [ + "clock" + ], + + "sway/workspaces": { + "disable-scroll": true, + "persisten_workspace": { + "1": [], + "2": [], + "3": [] + } + }, + + "clock": { + "timezone": "Europe/Amsterdam", + "format": "{:%H\n%M\n%S}", + "interval": 1 } } diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 1cdcd0a..6c3ce83 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -1,4 +1,31 @@ +* { + border: none; + text-shadow: none; + box-shadow: none; + border-radius: 0; + font-weight: 600; + font-size: 12.7px; + margin: 0; + padding: 0; +} #waybar { - + background-color: rgba(28, 28, 28, 1); + border-radius: 5px; +} + +#workspaces { + margin-top: 5px; + padding: 0; +} + +#workspaces button { + color: #FFFFFF; + margin: 0; + padding: 0; +} + +#clock { + margin-bottom: 5px; + color: #FFFFFF; } From 447d1772494074ff069e0a6d0c592238ee5ed049 Mon Sep 17 00:00:00 2001 From: rhjr Date: Thu, 15 May 2025 14:55:03 +0200 Subject: [PATCH 10/10] Changed: default from super to alt --- .config/sway/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/sway/config b/.config/sway/config index c802775..b067d69 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -7,7 +7,7 @@ ### Variables # # Logo key. Use Mod1 for Alt. -set $mod Mod4 +set $mod Mod1 # Home row direction keys, like vim set $left h set $down j