Initialize repository, adding makefile, packages list, config and colorscheme for vim, config for sway and wofi, scripts for automatic loading of sway via systemd.

This commit is contained in:
Ananke 2024-04-25 20:22:58 +02:00
commit 57bdfa3aff
15 changed files with 765 additions and 0 deletions

0
README.md Normal file
View file

1
bash_profile Normal file
View file

@ -0,0 +1 @@
[[ -f ~/.bashrc ]] && . ~/.bashrc && sway

43
forest_refuge.vim Normal file
View file

@ -0,0 +1,43 @@
" save & test ':so %'
" reset highlighting
highlight clear
" set default colors
if exists ("syntax_on")
syntax reset
endif
" set background variable
set background=dark
" naming color scheme
let colors_name = "forest_refuge"
" set new highlighting
" normal text foreground, background
hi Normal ctermfg=gray guifg=SeaGreen4 guibg=Black
" synthax highlighting (:help group-name)
hi Comment cterm=NONE ctermfg=darkgreen gui=NONE guifg=honeydew
hi Constant cterm=NONE ctermfg=lightgreen gui=NONE guifg=cornsilk4
hi Identifier cterm=NONE ctermfg=darkred gui=NONE guifg=LavenderBlush1
hi Function cterm=bold ctermfg=cyan gui=NONE guifg=DarkSalmon
hi Statement cterm=bold ctermfg=green gui=NONE guifg=chocolate4
hi PreProc cterm=bold ctermfg=yellow gui=NONE guifg=DarkSeaGreen1
hi Type cterm=bold ctermfg=magenta gui=NONE guifg=OldLace
hi Special cterm=bold ctermfg=lightred gui=NONE guifg=brown
hi Delimiter cterm=NONE ctermfg=brown gui=NONE guifg=tomato
hi Error cterm=underline ctermbg=red ctermfg=yellow guifg=orange

56
makefile Executable file
View file

@ -0,0 +1,56 @@
#!/usr/bin/make -f
# Change the default shell /bin/sh which does not implement 'source'
# source is needed to work in a python virtualenv
SHELL := /bin/bash
##############################
build:
# Build the live system/ISO image↵
sudo lb clean --all
#sudo lb config --debug --distribution bullseye --backports true --archive-areas "main contrib non-free non-free-firmware" --hdd-label NIHAL --uefi-secure-boot disable --image-name NIHAL-bullseye --linux-packages "linux-image li nux-headers"
lb config \
--debian-installer live \
--image-name NIHAL- \
--hdd-label NIHAL \
# add debian installer
mkdir -p config/package-lists
mkdir -p config/includes.installer
mkdir -p config/includes.chroot/lib/live/config
mkdir -p config/includes.chroot/etc/skel/.vim/colors
mkdir -p config/includes.chroot/etc/skel/.config/sway
mkdir -p config/includes.chroot/etc/skel/.config/waybar
mkdir -p config/includes.chroot/etc/skel/.config/wofi
# add debian-installer
echo "debian-installer-launcher" > config/package-lists/installer.list.chroot
echo "d-i debian-installer/locale string en_UK" > config/includes.installer/preseed.cfg
# add packages
cat packages.list > config/package-lists/desktop.list.chroot
# automaticially start sway after start
#echo "exec sway" > config/includes.chroot/etc/skel/rc.local
# add User-Config
cp bash_profile config/includes.chroot/etc/skel/.bash_profile
mkdir -p config/includes.chroot/etc/skel/
mkdir -p config/includes.chroot/etc/systemd/system
#mkdir -p config/includes.chroot/etc/systemd/system/graphical.target.wants
cp vimrc config/includes.chroot/etc/skel/.vimrc
cp swaysystemd config/includes.chroot/etc/systemd/system/sway.service
#cp swaysystemd config/includes.chroot/etc/systemd/system/graphical.target.wants/sway.service
cp startscript.sh config/hooks/live/startscript.hook.chroot
cp forest_refuge.vim config/includes.chroot/etc/skel/.vim/colors/
cp swayconfig config/includes.chroot/etc/skel/.config/sway/config
cp swayaudio.sh config/includes.chroot/etc/skel/.config/sway/audio.sh
cp swayexit.sh config/includes.chroot/etc/skel/.config/sway/exit.sh
#cp rc.local config/includes.chroot/etc/rc.local
cp swaylock_screen.sh config/includes.chroot/etc/skel/.config/sway/lock_screen.sh
#cp waybarconfig config/includes.chroot/etc/skel/.config/waybar/config
#cp waybarstyles.css config/includes.chroot/etc/skel/.config/waybar/syles.css
cp woficonfig config/includes.chroot/etc/skel/.config/wofi/config
cp wofistyles.css config/includes.chroot/etc/skel/.config/wofi/styles.css
cp sirius.png config/includes.chroot/etc/skel/.config/sway/sirius.png
#echo "exec --no-startup-id feh --bg-scale /home/user/.config/sway/sirius.png" >>config/includes.chroot/etc/skel/.config/sway/config
# modify grub -> not in VM with QEMU??
cp -r /usr/share/live/build/bootloaders config/
cp sirius.png config/bootloaders/grub-pc/splash.png
sudo lb build 2>&1 | tee build.log

120
packages.list Normal file
View file

@ -0,0 +1,120 @@
debian-keyring
debsecan
debsums
packagekit
packagekit-tools
unattended-upgrades
apt-file
apt-listbugs
debian-security-support
packagekit-command-not-found
htop
strace
usbview
sysstat
dstat
memtester
lshw
rsync
thunar
rsbackup
fsarchiver
timeshift
parted
gdisk
gparted
baobab
ecryptfs-utils
exfatprogs
disk-filltest
apparmor
apparmor-profiles
apparmor-utils
sudo
xorg
xinit
xfonts-base
xfonts-scalable
xserver-xorg
xserver-xorg-input-all
xserver-xorg-core
xserver-xorg-input-wacom
xserver-xorg-input-aiptek
xserver-xorg-input-elographics
xserver-xorg-input-joystick
xserver-xorg-input-kbd
xserver-xorg-input-mouse
xserver-xorg-input-multitouch
xserver-xorg-input-synaptics
xserver-xorg-legacy
xserver-xorg-video-all
xserver-xorg-video-intel
xserver-xorg-video-amdgpu
xserver-xorg-video-ati
xserver-xorg-video-fbdev
xserver-xorg-video-nouveau
xfonts-base
hwdata
dkms
build-essential
systemd
os-prober
initramfs-tools
console-setup
user-setup
libpam-systemd
kexec-tools
kthresher
driverctl
feh
sakura
dunst
rofi
firefox-esr-l10n-de
chromium
vim
sway
swaybg
waybar
brightnessctl
gammastep
grim slurp
wev
wlr-randr
xdg-desktop-portal-wlr
swayidle
libwayland-dev
wayland-protocols
libgles2-mesa-dev
libdrm-dev
libgbm-dev
libinput-dev
libxkbcommon-dev
libudev-dev
libpixman-1-dev
libsystemd-dev
libcap-dev
libavutil-dev
libavcodec-dev
libavformat-dev
libpng-dev
libpcre3-dev
libpango1.0-dev
libcairo2-dev
libgdk-pixbuf2.0-dev
blueman
slurp
bc
python3-libiio
feh
python3-tk
python3-netifaces
zip
imagemagick
grim
syncthing
git-crypt
bzip2
secure-delete
jq
terminator

BIN
sirius.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 KiB

10
startscript.sh Normal file
View file

@ -0,0 +1,10 @@
#!/bin/bash
# Autostart Sway via Systemd
/bin/systemctl enable sway.service
/bin/systemctl start sway.service
#/bin/systemctl daemon-reload
# download bumblebee
mkdir -p /usr/bin/bumbleebee
git clone https://git.kraut.space/l.behm/bumblebee-status.git /usr/bin/bumblebee/

32
swayaudio.sh Normal file
View file

@ -0,0 +1,32 @@
#!/bin/bash
current_volume=$(/usr/bin/wpctl get-volume @DEFAULT_AUDIO_SINK@)
volume="$(echo $current_volume | cut -f 2 -d " " | sed 's/\.//g')"
if [[ $current_volume == *"MUTED"* ]]; then
echo " ---"
fi
if [ "$volume" -lt "100" ]; then
volume="${volume:1}"
fi
if [ "$volume" -lt "10" ]; then
volume="${volume:1}"
fi
if [ "$volume" -gt "99" ]; then
echo "$volume%"
elif [ "$volume" -gt "65" ]; then
echo "$volume%"
elif [ "$volume" -gt "30" ]; then
echo "$volume%"
elif [ "$volume" -gt "10" ]; then
echo "$volume%"
elif [ "$volume" -gt "0" ]; then
echo "$volume%"
elif [ "$volume" -lt "1" ]; then
echo " ---"
fi

254
swayconfig Executable file
View file

@ -0,0 +1,254 @@
#==================================================================================#
# Sway Window Manager Configuration File #
#----------------------------------------------------------------------------------#
# Purpose: This configuration file enables you to tweak keyboard shortcuts, adjust #
# themes and colors, set the wallpaper, and more. #
# #
# License: Creative Commons Attribution 4.0 International #
# #
# Pro-tip: While using Sway, you can trigger this configuration to be re-read by #
# pressing Super + Shift + C. #
#==================================================================================#
#========================#
# Appearance and Theming #
#========================#
# Declare Colors:
set $background #332b2b
set $color_urgent #fb4934
set $text_color #ffffff
set $title_bg_unfocused #666666
set $title_outline_active #0e844e
set $title_outline_unfocused #332b2b
# Set Colors: Border Background Text Indicator Child Border
client.background $background
client.focused $title_outline_active $background $text_color $title_outline_active $title_outline_active
client.focused_inactive $title_outline_unfocused $background $text_color $text_color $title_outline_unfocused
client.unfocused $title_outline_unfocused $title_bg_unfocused $text_color $title_outline_active
client.urgent $color_urgent $color_urgent $color_urgent $color_urgent $color_urgent
# Add gaps in between all application windows:
gaps inner 8
gaps outer 3
# Configure the default border:
default_border pixel 2
# Set the Wallpaper:
output * bg $HOME/.config/sway/sirius.png fill
#====================================#
# Activate the panel #
#====================================#
# Set bumblebee status bar:
bar {
status_command /usr/bin/bumblebee/bumblebee-status -m cpu memory battery time \
pasink pasource -p time.format="%H:%M" -t solarized
}
#====================================#
# Keyboard Shortcuts (Sway-specific) #
#====================================#
# Set the modifier key to super:
set $mod Mod1
# Set the ALT key to $alt (since Mod1 is harder to remember):
set $alt Mod1
# Set up a shortcut to reload this config file:
bindsym $mod+Shift+c reload
# Quit your current session and return to the log-in manager/tty:
bindsym $mod+Shift+e exec $HOME/.config/sway/exit.sh
# Screen locking (automatic, with a timeout)
set $lock swaylock -c 550000
exec swayidle -w \
timeout 600 $lock \
timeout 570 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep $lock
# Screen locking (manual)
set $lock_screen exec bash ~/.config/sway/lock_screen.sh
bindsym $mod+Escape exec $lock_screen
#========================================#
# Keyboard Shortcuts (Window Management) #
#========================================#
# Move focus to another window:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move focus to another window ("cult of vim" version):
bindsym $mod+j focus down
bindsym $mod+h focus left
bindsym $mod+l focus right
bindsym $mod+k focus up
# Move the window:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Move the the window ("cult of vim" version):
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# Hold the modifier key and hold the left/right mouse button
# to drag or resize a window respectively. This isn't exclusive
# to floating windows:
floating_modifier $mod normal
# Resizing containers:
mode "resize" {
# Resize windows 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
# "cult of vim" version:
bindsym h resize shrink width 10px
bindsym j resize grow height 10px
bindsym k resize shrink height 10px
bindsym l resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#=================================#
# Keyboard Shortcuts (Workspaces) #
#=================================#
# Switch to workspace
set $ws1 "1 - Communication"
set $ws2 "2 - Browsing"
set $ws3 "3 - System Administration"
set $ws4 "4 - Learn Linux TV"
set $ws5 "5 - Media"
set $ws6 "6 - Writing"
set $ws7 "7 - Homelab"
set $ws8 "8 - Home Assistant"
set $ws9 "9 - Unwind"
# Move between workspaces
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 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 $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
#=============================#
# Keyboard Shortcuts (Layout) #
#=============================#
# 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+f floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+tab focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
#=================================#
# Keyboard Shortcuts (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
#===============================#
# Keyboard Shortcuts (Hardware) #
#===============================#
# Audio
bindsym XF86AudioRaiseVolume exec "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+; pkill -RTMIN+8 waybar"
bindsym XF86AudioLowerVolume exec "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-; pkill -RTMIN+8 waybar"
bindsym XF86AudioMute exec "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; pkill -RTMIN+8 waybar"
# Brightness
bindsym XF86MonBrightnessDown exec light -U 10
bindsym XF86MonBrightnessUp exec light -A 10
#=============================================#
# Keyboard Shortcuts (launching applications) #
#=============================================#
# Set up wofi to replace dmenu as the launcher of choice:
set $menu wofi --show drun -i | xargs swaymsg exec --
# Launch your browser:
bindsym $mod+shift+b exec firefox
# Open a file manager:
bindsym ctrl+$mod+f exec pcmanfm
# Open a terminal emulator:
set $term alacritty
bindsym $mod+t exec terminator
# Kill focused window:
bindsym $mod+Shift+q kill
# Open the application launcher:
bindsym $mod+space exec $menu
# Open the application launcher (alternate version):
bindsym $mod+d exec $menu
#======#
# Misc #
#======#
include /etc/sway/config-vars.d/*
include /etc/sway/config.d/*

7
swayexit.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
if [[ ! $(pgrep -x "swaynag") ]]; then
swaynag --background 333333 --border 333333 --border-bottom 333333 --button-background 1F1F1F \
--button-border-size 0 --button-padding 8 --text FFFFFF --button-text FFFFFF --edge bottom \
-t warning -m 'Do you really want to log out?' -B 'You heard me!' 'swaymsg exit'
fi

16
swaylock_screen.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/sh
# Credit to the following for comming up with this:
# https://code.krister.ee/lock-screen-in-sway/
# To Do: The fancier screen lock mentioned on that page might be cool to try.
# Times the screen off and puts it to background
swayidle \
timeout 10 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' &
# Locks the screen immediately
swaylock -c 550000
# Kills last background task so idle timer doesn't keep running
kill %%

20
swaysystemd Normal file
View file

@ -0,0 +1,20 @@
# Contents of /etc/systemd/system/myservice.service
[Unit]
Description=sway
Documentation=man::sway(5)
OnFailure=getty@tty1.service
Conflicts=getty@tty1.service
After=graphical.target
[Service]
User=user
ExecStart=/usr/bin/sway
WorkingDirectory=~
TTYPath=/dev/tty1
PAMName=login
TTYReset=yes
TTYVHangup=yes
TTYVTDiallocate=yes
[Install]
WantedBy=graphical.target

149
vimrc Normal file
View file

@ -0,0 +1,149 @@
set shell=/bin/bash
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
" set rtp+=~/.vim/bundle/Vundle.vim
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
#Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
#Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
#Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
#Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
#Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
" Plugin youcompleteme
#Plugin 'git://github.com/ycm-core/YouCompleteMe.git'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
" This happens after /etc/vim/vimrc(.local) are loaded, so it will override
" any settings in these files.
" If you don't want that to happen, uncomment the below line to prevent
" defaults.vim from being loaded.
"let g:skip_defaults_vim = 1
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
filetype plugin indent on
filetype indent on
" set filetyp manually for rust -> errors?
"if &filetyp ==# 'rs'
" setfiletyp='rust'
"endif
"if &filetyp ==# 'py'
" setfiletyp='python'
"endif
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set incsearch " Incremental search
set autowrite " Automatically save before commands like :next and :make
set hidden " Hide buffers when they are abandoned
" set mouse=a " Enable mouse usage (all modes)
" enable clipboard
set clipboard=unnamed
" Y for copy into clipboard, y 'normal yank'
nnoremap Y "+y
vnoremap Y "+y
nnoremap yY ^"+y$
" automatically trigger copy
set guioptions+=a
" line number
set number
" make shortcut
nnoremap <F9> :!%:p
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
" always wrap long lines
set wrap
" define function
function! Myfunc()
echo "Hello World!"
endfunction
" colorscheme
colo forest_refuge
" automatically run with apropriate languages from file-type
autocmd FileType python map <buffer> <F5> :w <CR> :exec '!python3' shellescape(@%, 1)<CR>
autocmd FileType python imap <buffer> <F5> <esc> :w <CR> : exec '!python3' shellescape(@%, 1)<CR>

9
woficonfig Normal file
View file

@ -0,0 +1,9 @@
allow_images=true
image_size=64
width=600
height=200
insensitive=true
mode=drun,run
columns=1
padding:5
lines=6

48
wofistyles.css Normal file
View file

@ -0,0 +1,48 @@
/* Notes below regarding the purpose of each setting is true to the best of my knowledge. */
#input {
margin: 10px; /* how much padding there is around the input box */
border: none; /* border around the input box */
background-color: #453e3d; /* background color of the text input box itself */
color: #ffffff; /* text color as you type inside the input box */
}
#inner-box {
margin: 5px;
border: none; /* horizontal bar that appears above the search results */
background-color: #1f1f1f; /* background color behind the search results */
color: #ffffff; /* text color of each search result */
}
#outer-box {
margin: 5px; /* margin between the outer edges of the main window and its contents inside */
border: none /* border around all the internal window components */
background-color: #1f1f1f; /* background color of entire inner window */
}
#text {
margin: 5px;
border: none; /* border around each individual item within the search results */
background-color: trans; /* background behind each individual item within the search results */
color: ffffff;
}
/* Remove the search icon */
#input > image.left {
-gtk-icon-transform:scaleX(0);
}
#scroll {
margin: 5px;
border: 2px solid #1f1f1f;
background-color: #1f1f1f; /* background color behind the search slider */
}
window {
margin: 15px;
border: 3px solid green; /* border around the entire window */
background-color: #1f1f1f;
}