Personal dotfiles for Linux, mostly for Nixpkgs/NixOS-based and Termux setups. Mirrored using GitLab's push mirroring feature. gitlab.com/andreijiroh-dev/dotfiles
linux dotfiles
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(scripts): import more scripts from legacy codebase

Plus, in this commit:
* updated most of shell rc and then some

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>

+214 -10
+7 -1
.bash_login
··· 6 6 source "$HOME/.env" 7 7 if [[ -f "$HOME/.env.local" ]]; then 8 8 source "$HOME/.env.local" 9 - export LOCAL_DOTENV_LOADED=true 9 + LOCAL_DOTENV_LOADED=true 10 10 fi 11 11 12 + # Stage 1: Source the ~/.profile 12 13 source "$HOME/.profile" 14 + 15 + 16 + # Added by Toolbox App 17 + export PATH="$PATH:/home/ajhalili2006/.local/share/JetBrains/Toolbox/scripts" 18 +
-1
.bashrc
··· 35 35 export EDITOR=nano 36 36 # For compartibility reasons and not to fuck things up on ~/go/bin. 37 37 # Custom path might be also on ~/.env too? 38 - export PATH="$DOTFILES_BIN:$HOME/go/bin:$HOME/.local/bin:$GOPATH/bin:$PATH" 39 38 # It would be nice if I would work on self-hosted reimplementation of 40 39 # proxy.golang.org, but in meanwhile, you need to fuck off Google on this. 41 40 # (Fucking Facebook and Microsoft off your lives are also hard too ICYMI.)
+8 -8
.config/htop/htoprc
··· 32 32 delay=5 33 33 hide_function_bar=0 34 34 header_layout=three_25_25_50 35 - column_meters_0=AllCPUs Memory Swap 36 - column_meter_modes_0=1 1 1 37 - column_meters_1=DiskIO NetworkIO Uptime DateTime 38 - column_meter_modes_1=1 1 2 2 39 - column_meters_2=Hostname Tasks LoadAverage 40 - column_meter_modes_2=2 2 1 35 + column_meters_0=CPU Memory Swap ZFSARC ZFSCARC 36 + column_meter_modes_0=1 1 1 2 2 37 + column_meters_1=DiskIO NetworkIO LoadAverage Tasks Battery 38 + column_meter_modes_1=1 1 1 1 1 39 + column_meters_2=PressureStallIOFull PressureStallMemoryFull Hostname DateTime Uptime 40 + column_meter_modes_2=1 1 2 2 2 41 41 tree_view=1 42 42 sort_key=46 43 - tree_sort_key=48 43 + tree_sort_key=47 44 44 sort_direction=-1 45 45 tree_sort_direction=1 46 46 tree_view_always_by_pid=0 47 47 all_branches_collapsed=0 48 48 screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command 49 49 .sort_key=PERCENT_CPU 50 - .tree_sort_key=USER 50 + .tree_sort_key=PERCENT_MEM 51 51 .tree_view=1 52 52 .tree_view_always_by_pid=0 53 53 .sort_direction=-1
+29
.config/konsolerc
··· 1 + [Desktop Entry] 2 + DefaultProfile=~ajhalili2006 - bash.profile 3 + 4 + [General] 5 + ConfigVersion=1 6 + 7 + [KonsoleWindow] 8 + ShowWindowTitleOnTitleBar=true 9 + 10 + [MainWindow] 11 + MenuBar=Disabled 12 + State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAvsAAAAiAFEAdQBpAGMAawBDAG8AbQBtAGEAbgBkAHMARABvAGMAawAAAAAA/////wAAAAAAAAAA+wAAABwAUwBTAEgATQBhAG4AYQBnAGUAcgBEAG8AYwBrAAAAAAD/////AAAA1QEAAAMAAAVWAAACjwAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAAAAAAAAAABwAcwBlAHMAcwBpAG8AbgBUAG8AbwBsAGIAYQByAQAAAOj/////AAAAAAAAAAA= 13 + ToolBarsMovable=Disabled 14 + eDP-1 Height 1366x768=701 15 + eDP-1 Height 768=698 16 + eDP-1 Width 1366=1366 17 + eDP-1 Width 1366x768=1366 18 + eDP-1 Window-Maximized 1366x768=true 19 + eDP-1 XPosition=0 20 + eDP-1 XPosition 1366x768=0 21 + eDP-1 YPosition=24 22 + eDP-1 YPosition 1366x768=67 23 + 24 + [TabBar] 25 + NewTabButton=true 26 + TabBarVisibility=AlwaysShowTabBar 27 + 28 + [UiSettings] 29 + ColorScheme=Default
+3
.env
··· 14 14 # on my public GPG key btw, so YOLO it. 15 15 export DEBEMAIL="ajhalili2006@gmail.com" 16 16 17 + # Customized PATH + Jetbrains Toolbox 18 + export PATH="$DOTFILES_BIN:$HOME/go/bin:$HOME/.local/bin:$GOPATH/bin:$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts" 19 + 17 20 ########################################################################################## 18 21 # Code snippets from https://git.sr.ht/~sircmpwn/dotfiles/tree/db5945a4/item/.env 19 22 ##########################################################################################
+6
.profile
··· 13 13 # then import the rest 14 14 source "$HOME/.env" 15 15 source "$HOME/.config/aliases" 16 + export POSIX_PROFILE_SOURCED=true 17 + 18 + 19 + # Added by Toolbox App 20 + export PATH="$PATH:/home/ajhalili2006/.local/share/JetBrains/Toolbox/scripts" 21 +
+25
bin/fix-wrong-emails
··· 1 + #!/bin/bash 2 + 3 + if [[ $1 != "" ]]; then 4 + git filter-branch --env-filter ' 5 + WRONG_EMAIL=$1 6 + NEW_NAME="Andrei Jiroh Eugenio Halili" 7 + NEW_EMAIL="andreijiroh@madebythepins.tk" 8 + 9 + if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ] 10 + then 11 + export GIT_COMMITTER_NAME="$NEW_NAME" 12 + export GIT_COMMITTER_EMAIL="$NEW_EMAIL" 13 + fi 14 + if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ] 15 + then 16 + export GIT_AUTHOR_NAME="$NEW_NAME" 17 + export GIT_AUTHOR_EMAIL="$NEW_EMAIL" 18 + fi 19 + ' --tag-name-filter cat -- --branches --tags 20 + else 21 + echo "Usage $0 <wrong-email@host.me>" 22 + echo "Easily fix wrong emails in Git commit history. It is advised to use this script only" 23 + echo "on non-public commits, since this might be distaterous for forks to pull any changes" 24 + echo "in the public commits." 25 + fi
+92
bin/open-editor
··· 1 + #!/bin/env bash 2 + 3 + # SPDX-License-Identifier: MPL-2.0 4 + # An bloody script for opening text editors from the command line via $EDITOR and 5 + # command flags, work in progress and probably abandoned. 6 + 7 + # shellcheck disable=SC2034 8 + VSCODE_PATH=$(command -v code) # TODO: Add PATH detection for VS Code Desktop+Server/OpenVSCode Server/VSCodium/code-server 9 + NANO_PATH=$(command -v nano) 10 + VI_PATH=$(command -v vi) # maybe neovim? 11 + OPEN_EDITOR_LOCKFILE=$HOME/.dotfiles/config/open-editor 12 + 13 + if [[ $1 == "" ]]; then 14 + echo "open-editor: Want to learn more how to use me? Use the '--help' flag to see the docs." 15 + exit 16 + fi 17 + 18 + # Stack Overflow: https://stackoverflow.com/questions/7069682/how-to-get-arguments-with-flags-in-bash#21128172 19 + while test $# -gt 0; do 20 + case "$1" in 21 + -h|--help) 22 + echo "$0 - shortcut to open editors within and from command line" 23 + echo "By default, the script will attempt to guess what text editor to use as much" 24 + echo "as possible. You can lock with the ~/.dotfiles/config/open-editor file." 25 + echo 26 + echo "$0 [options] filename" 27 + echo " " 28 + echo "options:" 29 + echo "-h, --help show brief help" 30 + echo "-c, --use-code use Visual Studio Code, with the 'wait' flag" 31 + echo "-n, --use-nano use GNU Nano" 32 + echo "--lockfile Generate a lockfile within your home directory" 33 + echo " or edit if found." 34 + exit 0 35 + ;; 36 + -c|--use-code) 37 + shift 38 + echo "open-editor: Firing up your editor, please wait..." 39 + sleep 3 40 + if test $# -gt 0; then 41 + # shellcheck disable=SC2086 42 + code --wait $1 43 + else 44 + echo "error: no file specified, aborting..." 45 + exit 1 46 + fi 47 + shift 48 + ;; 49 + -n|--use-nano) 50 + shift 51 + echo "open-editor: Firing up your editor, please wait..." 52 + sleep 3 53 + if test $# -gt 0; then 54 + # shellcheck disable=SC2086 55 + nano $1 56 + exit 57 + fi 58 + shift 59 + ;; 60 + --lockfile) 61 + shift 62 + if test $# -gt 0; then 63 + export OUTPUT=$1 64 + else 65 + echo "no output dir specified" 66 + exit 1 67 + fi 68 + shift 69 + ;; 70 + -*) 71 + echo "open-editor: Unsupported flag, edit the script file to customize." 72 + exit 1 73 + ;; 74 + esac 75 + done 76 + 77 + if [[ $VSCODE_PATH != "" ]]; then 78 + echo "open-editor: Firing up your editor, please wait..." 79 + sleep 3 80 + code --wait "$1" 81 + exit 82 + elif [[ $NANO_PATH != "" ]]; then 83 + echo "open-editor: Firing up your editor, please wait..." 84 + sleep 3 85 + nano "$1" 86 + exit 87 + else 88 + echo "open-editor: Firing up your editor, please wait..." 89 + sleep 3 90 + vi "$1" 91 + exit 92 + fi
+36
bin/setup-chroot
··· 1 + #!/usr/bin/bash 2 + 3 + # Chroot command is optional and assume login binary 4 + CHROOT_COMMAND=${2:-"/usr/bin/login"} 5 + TARGET_DIR=$1 6 + 7 + if [[ $TARGET_DIR == "" ]]; then 8 + echo "Usage: $0 TARGET_DIR [CHROOT_COMMAND]" 9 + exit 1 10 + fi 11 + 12 + if [ $EUID != "0" ]; then 13 + echo "error: Must be root to proceed!" 14 + exit 1 15 + fi 16 + 17 + echo "===> Mounting required parts for chroot operation..." 18 + mount -o bind /dev "$TARGET_DIR/dev" 19 + mount -t proc none "$TARGET_DIR/proc" 20 + mount -o bind /sys "$TARGET_DIR/sys" 21 + echo " Kernel and device mount setup done!" 22 + sleep 3 23 + 24 + if [[ -f "$TARGET_DIR/setup-chroot-env.sh" ]]; then 25 + echo "===> Preparing chroot environment..." 26 + if ! bash "$TARGET_DIR/setup-chroot-env.sh"; then 27 + echo "! Chroot env setup failed, please proceed at your own risk." 28 + else 29 + echo " Setup done!" 30 + fi 31 + sleep 3 32 + fi 33 + 34 + echo "===> Teleporting to the chroot environment in 3 seconds..." 35 + sleep 3 36 + exec chroot "$TARGET_DIR" ${CHROOT_COMMAND}
+8
bin/update-discord
··· 1 + #!/bin/bash 2 + set -e 3 + 4 + # An script to automate upgrading Discord via the deb download link. 5 + # TODO:Implement checks and flags to support for rpms and tar.gz setups 6 + 7 + wget "https://discord.com/api/download?platform=linux&format=deb" -O /tmp/discord-linux-amd64.deb 8 + sudo apt install /tmp/discord-linux-amd64.deb