From 9d2035a372d96d9bda5d9c4a47a9c8184d197352 Mon Sep 17 00:00:00 2001 From: Filip Znachor Date: Tue, 22 Nov 2022 18:55:01 +0100 Subject: [PATCH] Basic dotfiles --- bash/.bash_logout | 7 ++ bash/.bashrc | 125 +++++++++++++++++++++++++++ bash/.profile | 28 ++++++ etc/.selected_editor | 2 + git/.gitconfig | 5 ++ gnome/export.sh | 3 + gnome/extensions/cpupower.dconf | 10 +++ gnome/extensions/dash-to-panel.dconf | 82 ++++++++++++++++++ gnome/import.sh | 3 + setup.sh | 11 +++ 10 files changed, 276 insertions(+) create mode 100644 bash/.bash_logout create mode 100644 bash/.bashrc create mode 100644 bash/.profile create mode 100644 etc/.selected_editor create mode 100644 git/.gitconfig create mode 100755 gnome/export.sh create mode 100644 gnome/extensions/cpupower.dconf create mode 100644 gnome/extensions/dash-to-panel.dconf create mode 100755 gnome/import.sh create mode 100755 setup.sh diff --git a/bash/.bash_logout b/bash/.bash_logout new file mode 100644 index 0000000..de4f5f7 --- /dev/null +++ b/bash/.bash_logout @@ -0,0 +1,7 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..0dcfa1a --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,125 @@ +# ~/.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 + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +# pnpm +export PNPM_HOME="/home/filip/.local/share/pnpm" +export PATH="$PNPM_HOME:$PATH" +# pnpm end +. "$HOME/.cargo/env" + +export DOT=$HOME/Home/dotfiles diff --git a/bash/.profile b/bash/.profile new file mode 100644 index 0000000..128c4cf --- /dev/null +++ b/bash/.profile @@ -0,0 +1,28 @@ +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + +# if running bash +if [ -n "$BASH_VERSION" ]; then + # include .bashrc if it exists + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi +. "$HOME/.cargo/env" diff --git a/etc/.selected_editor b/etc/.selected_editor new file mode 100644 index 0000000..67f9f4d --- /dev/null +++ b/etc/.selected_editor @@ -0,0 +1,2 @@ +# Generated by /usr/bin/select-editor +SELECTED_EDITOR="/bin/nano" diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..755689c --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,5 @@ +[user] + name = Filip Znachor + email = filip@znachor.cz +[credential] + helper = store diff --git a/gnome/export.sh b/gnome/export.sh new file mode 100755 index 0000000..e08f16a --- /dev/null +++ b/gnome/export.sh @@ -0,0 +1,3 @@ +dconf dump /org/gnome/shell/extensions/dash-to-panel/ > $DOT/gnome/extensions/dash-to-panel.dconf +dconf dump /org/gnome/shell/extensions/cpupower/ > $DOT/gnome/extensions/cpupower.dconf + diff --git a/gnome/extensions/cpupower.dconf b/gnome/extensions/cpupower.dconf new file mode 100644 index 0000000..3c3ad3a --- /dev/null +++ b/gnome/extensions/cpupower.dconf @@ -0,0 +1,10 @@ +[/] +cpufreqctl-backend='automatic' +default-ac-profile='4294455289' +default-battery-profile='1380402808' +frequency-sampling-mode='average' +profiles=[(19, 19, false, 'Energy Saver', '2380936784'), (19, 30, false, 'Quiet', '1380402808'), (20, 80, true, 'Multimedia', '4124301080'), (19, 100, true, 'High Performance', '4294455289')] +show-arrow-in-taskbar=false +show-freq-in-taskbar=false +show-icon-in-taskbar=true +taskbar-freq-unit-ghz=true diff --git a/gnome/extensions/dash-to-panel.dconf b/gnome/extensions/dash-to-panel.dconf new file mode 100644 index 0000000..371a483 --- /dev/null +++ b/gnome/extensions/dash-to-panel.dconf @@ -0,0 +1,82 @@ +[/] +animate-appicon-hover=false +animate-appicon-hover-animation-extent={'RIPPLE': 4, 'PLANK': 4, 'SIMPLE': 1} +appicon-margin=2 +appicon-padding=9 +available-monitors=[0] +desktop-line-use-custom-color=false +dot-color-1='#e92244' +dot-color-2='#da3450' +dot-color-3='#da3450' +dot-color-4='#da3450' +dot-color-dominant=true +dot-color-override=false +dot-color-unfocused-1='#8b1e31' +dot-color-unfocused-different=true +dot-position='BOTTOM' +dot-size=2 +dot-style-focused='DASHES' +dot-style-unfocused='DASHES' +focus-highlight=true +focus-highlight-dominant=false +focus-highlight-opacity=10 +group-apps=true +hide-overview-on-startup=true +hotkeys-overlay-combo='TEMPORARILY' +intellihide=false +intellihide-animation-time=200 +intellihide-behaviour='ALL_WINDOWS' +intellihide-close-delay=400 +intellihide-enable-start-delay=2000 +intellihide-hide-from-windows=false +intellihide-key-toggle=['i'] +intellihide-key-toggle-text='i' +intellihide-only-secondary=true +intellihide-pressure-threshold=100 +intellihide-pressure-time=1000 +intellihide-show-in-fullscreen=true +intellihide-use-pressure=false +isolate-monitors=false +isolate-workspaces=false +leftbox-padding=4 +leftbox-size=0 +overview-click-to-exit=false +panel-anchors='{"0":"MIDDLE"}' +panel-element-positions='{"0":[{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"showAppsButton","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"stackedTL"},{"element":"dateMenu","visible":true,"position":"centerMonitor"},{"element":"centerBox","visible":true,"position":"centered"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":true,"position":"stackedBR"}]}' +panel-lengths='{"0":100}' +panel-positions='{"0":"BOTTOM"}' +panel-sizes='{"0":41}' +preview-custom-opacity=60 +preview-use-custom-opacity=true +primary-monitor=0 +progress-show-count=true +scroll-panel-action='SWITCH_WORKSPACE' +show-appmenu=false +show-apps-icon-file='' +show-apps-icon-side-padding=0 +show-apps-override-escape=true +show-favorites-all-monitors=true +show-showdesktop-hover=false +show-window-previews=true +showdesktop-button-width=8 +status-icon-padding=6 +stockgs-force-hotcorner=false +stockgs-keep-dash=false +stockgs-keep-top-panel=false +stockgs-panelbtn-click-only=false +trans-bg-color='#000000' +trans-dynamic-anim-target=0.59999999999999998 +trans-dynamic-distance=20 +trans-gradient-bottom-opacity=0.14999999999999999 +trans-panel-opacity=0.0 +trans-use-custom-bg=true +trans-use-custom-gradient=true +trans-use-custom-opacity=true +trans-use-dynamic-opacity=false +tray-padding=-1 +tray-size=0 +window-preview-hide-immediate-click=false +window-preview-show-title=true +window-preview-size=240 +window-preview-title-position='TOP' +window-preview-use-custom-icon-size=false diff --git a/gnome/import.sh b/gnome/import.sh new file mode 100755 index 0000000..b83046f --- /dev/null +++ b/gnome/import.sh @@ -0,0 +1,3 @@ +dconf load /org/gnome/shell/extensions/dash-to-panel/ < $DOT/gnome/extensions/dash-to-panel.dconf +dconf load /org/gnome/shell/extensions/cpupower/ < $DOT/gnome/extensions/cpupower.dconf + diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..75dfd6d --- /dev/null +++ b/setup.sh @@ -0,0 +1,11 @@ + +# Bash +ln -sf $DOT/bash/.bash_logout $HOME/ +ln -sf $DOT/bash/.profile $HOME/ +ln -sf $DOT/bash/.bashrc $HOME/ + +# Etc +ln -sf $DOT/etc/.selected_editor $HOME/ + +# Git +ln -sf $DOT/git/.gitconfig $HOME/