From cce6b3dec92b87df030059963db32a3d9ffae82b Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Thu, 18 Jan 2024 12:41:01 -0500 Subject: Initial commit for the cgit platform --- .vimrc | 100 ++++++++++++++++++++++++++++++++++++++++++++++ .xinitrc | 7 ++++ .zshrc | 103 ++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 2 + README.md | 85 +++++++++++++++++++++++++++++++++++++++ dependencies.txt | 80 +++++++++++++++++++++++++++++++++++++ install-dependencies.sh | 14 +++++++ install.sh | 69 ++++++++++++++++++++++++++++++++ mimeapps.list | 15 +++++++ modules.conf | 1 + 10 files changed, 476 insertions(+) create mode 100644 .vimrc create mode 100644 .xinitrc create mode 100644 .zshrc create mode 100644 LICENSE create mode 100644 README.md create mode 100644 dependencies.txt create mode 100755 install-dependencies.sh create mode 100755 install.sh create mode 100644 mimeapps.list create mode 100644 modules.conf diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..87558bd --- /dev/null +++ b/.vimrc @@ -0,0 +1,100 @@ +" Don't try to be vi compatible +set nocompatible + +" Helps force plugins to load correctly when it is turned back on below +filetype off + +" TODO: Load plugins here (pathogen or vundle) + +" Turn on syntax highlighting +syntax on + +" For plugins to load correctly +filetype plugin indent on + +" TODO: Pick a leader key +" let mapleader = "," + +" Security +set modelines=0 + +" Show line numbers +set number + +" Show file stats +set ruler + +" Blink cursor on error instead of beeping (grr) +set visualbell + +" Encoding +set encoding=utf-8 + +" Whitespace +set wrap +set textwidth=79 +set formatoptions=tcqrn1 +set tabstop=2 +set shiftwidth=2 +set softtabstop=2 +set expandtab +set noshiftround + +" Cursor motion +set scrolloff=3 +set backspace=indent,eol,start +set matchpairs+=<:> " use % to jump between pairs +runtime! macros/matchit.vim + +" Move up/down editor lines +nnoremap j gj +nnoremap k gk + +" Allow hidden buffers +set hidden + +" Rendering +set ttyfast + +" Status bar +set laststatus=2 + +" Last line +set showmode +set showcmd + +" Searching +nnoremap / /\v +vnoremap / /\v +set hlsearch +set incsearch +set ignorecase +set smartcase +set showmatch +map :let @/='' " clear search + +" Remap help key. +inoremap :set invfullscreena +nnoremap :set invfullscreen +vnoremap :set invfullscreen + +" Textmate holdouts + +" Formatting +map q gqip + +" Visualize tabs and newlines +set listchars=tab:▸\ ,eol:¬ +" Uncomment this to enable by default: +" set list " To enable by default +" Or use your leader key + l to toggle on/off +map l :set list! " Toggle tabs and EOL + +" Color scheme (terminal) +set t_Co=256 +set background=dark +let g:solarized_termcolors=256 +let g:solarized_termtrans=1 +" put https://raw.github.com/altercation/vim-colors-solarized/master/colors/solarized.vim +" in ~/.vim/colors/ and uncomment: +" colorscheme solarized \ No newline at end of file diff --git a/.xinitrc b/.xinitrc new file mode 100644 index 0000000..2f900f3 --- /dev/null +++ b/.xinitrc @@ -0,0 +1,7 @@ +slstatus & + +# start up picom to avoid screen tearing +picom --vsync & + +# Saving a dwm log +exec dwm > ~/.dwm.log diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..ba49fab --- /dev/null +++ b/.zshrc @@ -0,0 +1,103 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +export ZSH="$HOME/.oh-my-zsh" +export EDITOR="/usr/bin/vim" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="robbyrussell" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" +alias suck="sudo rm -rf config.h ; sudo make install" \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..017baf0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,2 @@ +Mixed License. +I chose to mantain the original LICENSE of the projects I've forked. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9cc2807 --- /dev/null +++ b/README.md @@ -0,0 +1,85 @@ +# Alpine Suck + +Lightweight Desktop installer for Alpine Linux based on the suckless philosophy. + +Includes my own custom set of suckless tools (dwm, slstatus, dmenu, etc.). Ships with `ohmyzsh` and personal `vim` configs. Uses `qutebrowser` for default browser. + +## Downloading + +1. Download the latest Alpine image +2. Run `setup-alpine` +3. Run `setup-xorg-base` +4. [Enable community/edge/testing repos](https://wiki.alpinelinux.org/wiki/Repositories#Enabling_the_community_repository) +5. Install git, vim, bash, & doas +6. Edit doas permissions (`/etc/doas.conf`): + +``` +permit nopass :wheel +``` + +After finishing the above, create a user: + +``` +adduser -g "Real Name" username +``` + +Then add them to all required groups (wheel,users,audio,video,cdrom,input,tty): + +``` +adduser username wheel +``` + +Then logout of `root` user. + +--- + +Login as your newly created user and run the following: + +`git clone https://git.btxx.org/alpine-suck` + +`cd alpine-suck` + +## Installing + +1) Install dependencies by running `./install-dependencies.sh`. The script will simply read required packages from `dependencies.txt` and run apk add. +2) Compile and install suckless software by running the `./install.sh` + +## TLDR + +```sh +cd alpine-suck # CD into this repository +doas ./install-dependencies.sh # Install alpine packages +``` + +Be sure to change the `$ALPINE_USER` variable to match that of your current +user: + +``` +$ALPINE_USER="bt" +``` + +Then run the script to build suckless programs: + +```sh +doas ./install.sh # Install everything +``` + +Reboot the machine. Log in as your main user. Run: + +``` +startx +``` + +## Possible Tweaks / Troubleshooting + +--- + +You might need to check `/proc/asound/cards` to see which sound cards are available to your system. Then, if needed, you should create a `/etc/asound.conf` file with the following inside (where the "1" is your desired card number): + +``` +defaults.pcm.card 1 +defaults.ctl.card 1 +``` + +This will take on the next reboot of the machine. + diff --git a/dependencies.txt b/dependencies.txt new file mode 100644 index 0000000..552c024 --- /dev/null +++ b/dependencies.txt @@ -0,0 +1,80 @@ +# dependencies + +# core dependencies +dbus +xdg-desktop-portal +xdg-desktop-portal-wlr +linux-firmware +linux-headers +util-linux +udisks2 +udisks2-doc +pciutils +xf86-input-evdev +xf86-input-synaptics +mesa-dri-gallium +g++ +shadow +libx11-dev +libxinerama-dev +fontconfig-dev +libxft-dev +ncurses + +# networking +wireless-tools +dhcpcd +iwd +networkmanager +networkmanager-wifi +networkmanager-tui +wireguard-tools +ip6tables + +# audio +alsa-utils +alsa-utils-doc +alsa-lib +alsaconf +alsa-ucm-conf + +# fonts +font-fira-code +font-siji +font-dejavu +font-terminus + +# utilities +aerc +wget +curl +zsh +light +gawk +feh +make +go +picom +dunst +xrandr +bash-doc +bash-completion +zzz +tlp + +# screenshot utilities +scrot +slurp +slop + +# browsers and browser dependencies +qutebrowser +glib-dev +webkit2gtk +webkit2gtk-dev +gcr +gcr-dev + +# nice gui file manager +lf +pcmanfm diff --git a/install-dependencies.sh b/install-dependencies.sh new file mode 100755 index 0000000..cb2a429 --- /dev/null +++ b/install-dependencies.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ "$EUID" -ne 0 ] + then echo "The script has to be run as root." + exit +fi + +echo "This script is designed for Alpine Linux and it will not work with in any other OS" +echo "Installing dependencies listed in dependencies.txt..." + +sed -e 's/#.*$//' -e '/^$/d' dependencies.txt | while read p; do + echo "Running apk add $p" + apk add $p +done diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..dde8c24 --- /dev/null +++ b/install.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +ALPINE_USER="bt" + +if [ "$EUID" -ne 0 ] + then echo "The script has to be run as root." + exit +fi + +cp modules.conf /etc/modules-load.d/ +cp mimeapps.list /usr/share/applications/ +cp .xinitrc /home/$ALPINE_USER/.xinitrc +cp .vimrc /home/$ALPINE_USER/.vimrc +cp .zshrc /home/$ALPINE_USER/.zshrc + +mkdir /home/$ALPINE_USER/.suckless +cd /home/$ALPINE_USER/.suckless + +git clone https://git.btxx.org/dwm +cd dwm +echo "Installing dwm" +rm -rf config.h +make clean install +cd .. + +git clone https://git.btxx.org/dmenu +cd dmenu +echo "Installing dmenu" +rm -rf config.h +make clean install +cd .. + +git clone https://git.btxx.org/slstatus +cd slstatus +echo "Installing slstatus" +rm -rf config.h +make clean install +cd .. + +git clone https://git.btxx.org/st +cd st +echo "Installing st" +rm -rf config.h +make clean install +cd .. + +git clone https://git.btxx.org/surf +cd surf +echo "Installing surf" +rm -rf config.h +make clean install +cd .. + +git clone https://git.btxx.org/slock +cd slock +echo "Installing slock" +rm -rf config.h +make clean install +cd .. +cd .. + +rc-service dbus start +rc-update add dbus +rc-service iwd start +rc-update add iwd +rc-service alsa start +rc-update add alsa + +echo "Install finished. You should reboot your machine." diff --git a/mimeapps.list b/mimeapps.list new file mode 100644 index 0000000..21b9239 --- /dev/null +++ b/mimeapps.list @@ -0,0 +1,15 @@ +[Default Applications] +x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/ftp=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/chrome=org.qutebrowser.qutebrowser.desktop +text/html=org.qutebrowser.qutebrowser.desktop +application/x-extension-htm=org.qutebrowser.qutebrowser.desktop +application/x-extension-html=org.qutebrowser.qutebrowser.desktop +application/x-extension-shtml=org.qutebrowser.qutebrowser.desktop +application/xhtml+xml=org.qutebrowser.qutebrowser.desktop +application/x-extension-xhtml=org.qutebrowser.qutebrowser.desktop +application/x-extension-xht=org.qutebrowser.qutebrowser.desktop +image/jpeg=feh +image/png=feh +image/webp=feh \ No newline at end of file diff --git a/modules.conf b/modules.conf new file mode 100644 index 0000000..1d532ec --- /dev/null +++ b/modules.conf @@ -0,0 +1 @@ +snd_pcm_oss -- cgit v1.2.3-54-g00ecf