diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2024-02-18 17:36:51 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2024-02-18 17:36:51 +0400 |
commit | d1e8f727620479a98ad568e8e3dc98e84bef45b2 (patch) | |
tree | 56a8dedb74e9e8a6f8692027e3eadd201eb37c5f | |
parent | f40c73f3b30547f7267c84bd22677dec65029dc4 (diff) |
version 0.2
32 files changed, 548 insertions, 252 deletions
diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..8ab088c --- /dev/null +++ b/build.sh @@ -0,0 +1,93 @@ +#!/bin/sh + +as_sudo(){ + SUDO=sudo + $@ + SUDO="" +} + +config_dir="${XDG_CONFIG_HOME:-$HOME/.config}" +home_dir="${XDG_DATA_HOME:-$HOME}" + +dotfiles_install() { + [ -d $config_dir ] || mkdir -v $config_dir + COPY ./src/dotfiles/* "$config_dir" + COPY ./src/dotfiles/zsh/zshrc "$home_dir" + COPY ./src/dotfiles/Xresources "$home_dir"/.Xresources +} + +scripts_install() { + [ -d /usr/local/bin ] || sudo mkdir -v /usr/local/bin + as_sudo COPY ./src/scripts/* /usr/local/bin/ +} + +archlinux_install() { + as_sudo COPY ./src/distros/arch-linux/pacman.conf /etc +} + +profile_install() { + COPY ./src/dotfiles/zsh/user_profile "$home_dir/.profile" + LINK "$home_dir/.profile" "$home_dir/.zprofile" || echo "WARNING: Couldn't link .zprofile to .profile" + LINK "$home_dir/.profile" "$home_dir/.bash_profile" || echo "WARNING: Couldn't link .bash_profile to .profile" + + [ -d /etc/profile.d ] || { sudo mkdir /etc/profile.d && printf "/etc/profile.d directory created" ; } + as_sudo COPY ./src/etc/profile.d/theion.sh /etc/profile.d || echo "Couldn't install to /etc/profile.d" +} + +help() { + cat <<EOF +Usage $0: + -d Install dotfiles to .config + -s Install scripts to /usr/local/bin + -ds Install scripts and dotfiles + + --profile Install profile files + --archlinux Install Arch linux specific files + --fix-profile make /etc/profile.d sourced + --force Overwrite the existing files + --all Install everything (except Arch linux specific files) +EOF +exit 2 +} + +[ $# = 0 ] && help + +for argument in $@;do + if [ $argument = "--force" ];then + COPY(){ $SUDO cp -r $@; } + LINK(){ ln -sf $@; } + break + fi + LINK(){ ln -s $@; } + COPY(){ $SUDO cp -nr $@; } +done + +for argument in $@;do + case "$argument" in + "-d") dotfiles_install;; + + "-s") + scripts_install;; + + "-ds") + dotfiles_install + scripts_install + ;; + + "--profile") + profile_install;; + + "--archlinux") + as_sudo archlinux_install + ;; + + "--all") + dotfiles_install + scripts_install + profile_install + ;; + "--force");; + + *) help ;; + esac +done diff --git a/src/distros/arch-linux/pacman.conf b/src/distros/arch-linux/pacman.conf index 6175191..5f31540 100644 --- a/src/distros/arch-linux/pacman.conf +++ b/src/distros/arch-linux/pacman.conf @@ -1,98 +1,23 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# [options] + ILoveCandy -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = auto -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = +HoldPkg = pacman glibc -#NoUpgrade = -#NoExtract = +Architecture = auto -# Misc options -#UseSyslog -#Color -#NoProgressBar CheckSpace + VerbosePkgLists + ParallelDownloads = 5 -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all official Arch Linux -# packagers with `pacman-key --populate archlinux`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# - -# The testing repositories are disabled by default. To enable, uncomment the -# repo name header and Include lines. You can add preferred servers immediately -# after the header, and they will be used before the default mirrors. - -#[core-testing] -#Include = /etc/pacman.d/mirrorlist +LocalFileSigLevel = Optional [core] Include = /etc/pacman.d/mirrorlist -#[extra-testing] -#Include = /etc/pacman.d/mirrorlist - [extra] Include = /etc/pacman.d/mirrorlist - -# If you want to run 32 bit applications on your x86_64 system, -# enable the multilib repositories as required here. - -#[multilib-testing] -#Include = /etc/pacman.d/mirrorlist - -#[multilib] -#Include = /etc/pacman.d/mirrorlist - -# An example of a custom package repository. See the pacman manpage for -# tips on creating your own repositories. -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs diff --git a/src/dotfiles/Xresources b/src/dotfiles/Xresources new file mode 100644 index 0000000..42259ae --- /dev/null +++ b/src/dotfiles/Xresources @@ -0,0 +1,34 @@ +! Black + DarkGrey +*color0: #000000 +*color8: #555753 +! DarkRed + Red +*color1: #ff6565 +*color9: #ff8d8d +! DarkGreen + Green +*color2: #93d44f +*color10: #c8e7a8 +! DarkYellow + Yellow +*color3: #eab93d +*color11: #ffc123 +! DarkBlue + Blue +*color4: #204a87 +*color12: #3465a4 +! DarkMagenta + Magenta +*color5: #ce5c00 +*color13: #f57900 +!DarkCyan + Cyan (both not tango) +*color6: #89b6e2 +*color14: #46a4ff +! LightGrey + White +*color7: #cccccc +*color15: #ffffff + +XTerm.vt100.background: black +XTerm.vt100.foreground: grey +XTerm.vt100.foreground: grey + +Sxiv.background: #282828 +Sxiv.foreground: #ebdbb2 + +Nsxiv.window.foreground: #4E3524 +Nsxiv.window.background: #282828 diff --git a/src/dotfiles/alacritty/alacritty.toml b/src/dotfiles/alacritty/alacritty.toml new file mode 100644 index 0000000..f558b57 --- /dev/null +++ b/src/dotfiles/alacritty/alacritty.toml @@ -0,0 +1,43 @@ +# Gruvbox themed alacritty config + +[colors.bright] +black = "#928374" +blue = "#83a598" +cyan = "#8ec07c" +green = "#b8bb26" +magenta = "#d3869b" +red = "#fb4934" +white = "#ebdbb2" +yellow = "#fabd2f" + +[colors.normal] +black = "#282828" +blue = "#458588" +cyan = "#689d6a" +green = "#98971a" +magenta = "#b16286" +red = "#cc241d" +white = "#a89984" +yellow = "#d79921" + +[colors.primary] +background = "#282828" +foreground = "#ebdbb2" + +[font] +size = 9 + +[font.bold] +family = "JetBrainsMono Nerd Font" +style = "Bold" + +[font.bold_italic] +family = "monospace" +style = "Bold Italic" + +[font.italic] +family = "monospace" +style = "Italic" + +[font.normal] +family = "JetBrainsMono Nerd Font" diff --git a/src/dotfiles/alacritty/alacritty.yml b/src/dotfiles/alacritty/alacritty.yml deleted file mode 100755 index 1381bab..0000000 --- a/src/dotfiles/alacritty/alacritty.yml +++ /dev/null @@ -1,45 +0,0 @@ -colors: - primary: - background: '#282828' - foreground: '#ebdbb2' - - # Normal colors - normal: - black: '#282828' - red: '#cc241d' - green: '#98971a' - yellow: '#d79921' - blue: '#458588' - magenta: '#b16286' - cyan: '#689d6a' - white: '#a89984' - - # Bright colors - bright: - black: '#928374' - red: '#fb4934' - green: '#b8bb26' - yellow: '#fabd2f' - blue: '#83a598' - magenta: '#d3869b' - cyan: '#8ec07c' - white: '#ebdbb2' - - -font: - normal: - family: JetBrainsMono Nerd Font - - bold: - family: JetBrainsMono Nerd Font - style: Bold - - italic: - family: monospace - style: Italic - - bold_italic: - family: monospace - style: Bold Italic - - size: 9 diff --git a/src/dotfiles/bspwm/bspwmrc b/src/dotfiles/bspwm/bspwmrc index f3a6adc..75bb794 100755 --- a/src/dotfiles/bspwm/bspwmrc +++ b/src/dotfiles/bspwm/bspwmrc @@ -1,5 +1,10 @@ #!/bin/sh +# Gruvbox themed bspwm config + +[ -z $XDG_COLOR_TRANSFORM ] && XDG_COLOR_TRANSFORM="#4E3524" +[ -z $XDG_COLOR_INACTIVE_TRANSFORM ] && XDG_COLOR_INACTIVE_TRANSFORM="#262626" + pgrep -x sxhkd > /dev/null || sxhkd & @@ -11,8 +16,8 @@ bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9 #borders and colors -bspc config normal_border_color "#262626" -bspc config focused_border_color "#4E3524" +bspc config normal_border_color $XDG_COLOR_INACTIVE_TRANSFORM +bspc config focused_border_color $XDG_COLOR_TRANSFORM bspc config border_width 10 bspc config window_gap 3 bspc config single_monocle true @@ -20,34 +25,19 @@ bspc config borderless_monocle true bspc config gapless_monocle true -#to switch caps with escape -setxkbmap -option "caps:escape" - - -: ' -Uncomment the following line to make the Caps Lock button -work as Escape when pressed alone, and as Ctrl when pressed -with another key. -' -#xcape -e 'Caps_Lock=Escape' -#setxkbmap -option "caps:ctrl_modifier" +# setxkbmap -option "caps:escape" #to switch caps with escape -#increase cursor speed -xset r rate 300 50 +# Uncomment the following 2 lines to make the Caps Lock button +# work as Escape when pressed alone, and as Ctrl when pressed +# with another key. -#disable screen blackening -xset s off && xset -dpms - -#hide mouse cursor if it is inactive -unclutter & - -#turns touchpad off -synclient TouchpadOff=1 - -#turn keyboard layout to United States -setxkbmap us +# xcape -e 'Caps_Lock=Escape' +setxkbmap -option "caps:ctrl_modifier" +xset r rate 300 50 #increase cursor speed +xset s off && xset -dpms #disable screen blackening +unclutter & #hide mouse cursor if it is inactive +setxkbmap us #turn keyboard layout to United States xgamma -gamma 0.8 picom & - diff --git a/src/dotfiles/dunst/dunstrc b/src/dotfiles/dunst/dunstrc new file mode 100644 index 0000000..19c55b4 --- /dev/null +++ b/src/dotfiles/dunst/dunstrc @@ -0,0 +1,33 @@ +# Very minimal dunst config + +[global] + width = 300 + height = 300 + origin = bottom-right + offset = 10x10 + scale = 0 + notification_limit = 6 + separator_height = 2 + alignment = left + stack_duplicates = true + frame_width = 3 + frame_color = "#4E3524" + gap_size = 6 + separator_color = frame + font = JetBrainsMono Nerd Font 10 + line_height = 3 + +[urgency_normal] + foreground = "#a89984" + background = "#282828" + timeout = 5 + +[urgency_low] + foreground = "#a89984" + background = "#282828" + timeout = 3 + +[urgency_critical] + foreground = "#a89984" + background = "#282828" + timeout = 8 diff --git a/src/dotfiles/i3/config b/src/dotfiles/i3/config index b7f5ccd..61db90b 100755 --- a/src/dotfiles/i3/config +++ b/src/dotfiles/i3/config @@ -1,4 +1,4 @@ -#Theion's i3-wm config +# Theion's i3-wm config font pango: JetBrainsMono Nerd Font 0 set $bg #282828 @@ -213,4 +213,3 @@ bindsym $mod+Shift+m exec killall kitty bindsym $mod+Shift+n exec --no-startup-id kitty --class=floating bindsym $mod+Shift+p exec ~/.config/polybar/launch.sh - diff --git a/src/dotfiles/kitty/kitty.conf b/src/dotfiles/kitty/kitty.conf index bba1e35..07c905b 100644 --- a/src/dotfiles/kitty/kitty.conf +++ b/src/dotfiles/kitty/kitty.conf @@ -1,7 +1,9 @@ +enable_audio_bell no remember_window_size no initial_window_width 840 initial_window_height 600 + background_opacity 0.75 font_size 14 diff --git a/src/dotfiles/lf/lfrc b/src/dotfiles/lf/lfrc new file mode 100644 index 0000000..ebfffa3 --- /dev/null +++ b/src/dotfiles/lf/lfrc @@ -0,0 +1,44 @@ +# Suleyman's gruvbox themed lf config at "https://github.com/thei0n/slcf" +# Due to the facts that ueberzug is no longer maintained and adds extra complexity it is not included in the config + +# Options +set incsearch +set scrolloff 4 #smooth scrolling + +# Key-maps +map <enter> shell +map m push $mkdir<space> +map t push $touch<space> +map D trash +map gf $lf -remote "send $id select $(fzf --layout=reverse --height=10)" +map x $$f # execute current file (must be executable) + +map zb :{{ set sortby natural; set info size; set preview; set ratios 5:2; }} +map zz :{{ set preview; set ratios 1:2:3; }} + +# Directory change +map gp cd ~/proj +map gt cd ~/testProj +map gc cd ~/.config +map gh cd ~ +map gu cd /usr/local/bin + +# Colors +set cursoractivefmt "\033[0;1;7m" #white +# set cursoractivefmt "\033[32;1;7m" #yellowish green +# set cursoractivefmt "\033[33;1;7m" #orange +# set cursoractivefmt "\033[36;1;7m" #green + +set cursorparentfmt "\033[0;1;7m" +set tagfmt "\033[32;1;7m" +set rulerfmt "\033[32;1;7m" + +set promptfmt "\033[48;1;234m %w/%f" + + +cmd trash !{{ + [ ! -d ~/.trash ] && mkdir -p ~/.trash + set -f + printf "\nItems to be trashed:\n$fx\n\nTrash? [y/N]" && read ans + [ $ans == "y" ] && mv $fx ~/.trash && echo "Trash complete!" || echo "Failed! Use y to trash." +}} diff --git a/src/dotfiles/mimeapps.list b/src/dotfiles/mimeapps.list index a000b00..5efa139 100644 --- a/src/dotfiles/mimeapps.list +++ b/src/dotfiles/mimeapps.list @@ -1,6 +1,17 @@ [Default Applications] application/pdf=org.pwmt.zathura.desktop + [Default Applications] -image/jpeg=sxiv.desktop +image/jpeg=nsxiv.desktop +image/png=nsxiv.desktop +image/jpg=nsxiv.desktop + [Default Applications] text/plain=nvim.desktop + +[Default Applications] +text/html=org.qutebrowser.qutebrowser.desktop + +[Default Application] +x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop diff --git a/src/dotfiles/nsxiv/exec/key-handler b/src/dotfiles/nsxiv/exec/key-handler new file mode 100755 index 0000000..a3880e4 --- /dev/null +++ b/src/dotfiles/nsxiv/exec/key-handler @@ -0,0 +1,43 @@ +#!/bin/sh + +# For theme to be applied ~/.Xresource file must be present + +while read -r file +do + case "$1" in + + "m") + [ -z $destdir ] && destdir="$(echo "$HOME/Pictures" | dmenu -p "Move directory: " | sed "s|~|$HOME|g")" + + [ ! -d $destdir ] && { nsend "Not a directory" ; exit 2 ;} + + mv "$file" "$destdir" && nsend "$file moved to $destdir" & + ;; + + "c") + + [ -z $destdir ] && destdir="$(echo "$HOME/Pictures" | dmenu -p "Copy directory: " | sed "s|~|$HOME|g")" + + [ ! -d $destdir ] && { nsend "Not a directory" ; exit 2 ;} + + cp "$file" "$destdir" && nsend "$file copied to $destdir" & + ;; + + "w") + setwp "$file" && nsend "Wallpaper changed to $file" ;; + "d") + [ ! -d ~/.trash ] && { mkdir ~/.trash && nsend "~/.trash created";} + mv "$file" ~/.trash && nsend "$file is moved to ~/.trash" ;; + "r") + convert -rotate 90 "$file" "$file" ;; + "R") + convert -rotate -90 "$file" "$file" ;; + "f") + convert -flop "$file" "$file" ;; + "y") + echo -n "$file" | xclip -selection clipboard && nsend "Copied to clipboard" & ;; + "Y") + readlink -f "$file" | tr -d '\n' | xclip -selection clipboard && nsend "Copied to clipboard" & ;; + + esac + done diff --git a/src/dotfiles/nvim/init.lua b/src/dotfiles/nvim/init.lua index d74eada..1f4b737 100644 --- a/src/dotfiles/nvim/init.lua +++ b/src/dotfiles/nvim/init.lua @@ -1 +1,2 @@ +-- Suleyman's gruvbox themed neovim config at "https://github.com/thei0n/slcf" require("master") diff --git a/src/dotfiles/picom/picom.conf b/src/dotfiles/picom/picom.conf index f3815b2..9f942af 100644 --- a/src/dotfiles/picom/picom.conf +++ b/src/dotfiles/picom/picom.conf @@ -1,3 +1,25 @@ +# Minimal picom config + +backend = "glx"; + +#Shadows +shadow = true; +shadow-radius = 7; +shadow-offset-x = -7; +shadow-offset-y = -7; + +#Fadings fading = true; -fade-out-step = 0.05; -fade-in-step = 0.05; +fade-in-step = 0.03; +fade-out-step = 0.03; + +vsync = true; + + wintypes: + { + tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + dock = { shadow = false; clip-shadow-above = true; } + dnd = { shadow = false; } + popup_menu = { opacity = 0.8; } + dropdown_menu = { opacity = 0.8; } + }; diff --git a/src/dotfiles/polybar/config.ini b/src/dotfiles/polybar/config.ini index fb996e9..14c4852 100755 --- a/src/dotfiles/polybar/config.ini +++ b/src/dotfiles/polybar/config.ini @@ -1,15 +1,12 @@ +# Compatiable with environmental color variables, fallback theme is set to be gruvbox + [colors] -grayish = #928374 -background = #282828 -foreground = #ebdbb2 -red = #fb4934 -green = #b8bb26 -yellow = #fcf55f -blue = #83a598 -purple = #d3869b -teal = #8ec07c -orange = #fe8019 -gray = #a89984 +background_inactive = ${env:XDG_COLOR_INACTIVE_FOREGROUND:#a89984} +background = ${env:XDG_COLOR_BACKGROUND:#282828} +foreground = ${env:XDG_COLOR_FOREGROUND:#ebdbb2} +warning = ${env:XDG_COLOR_WARNING:#cc241d} +non_warning = ${env:XDG_COLOR_NON_WARNING:#458588} +interactive = ${env:XDG_COLOR_INTERACTIVE:#98971a} [bar/example] width = 100% @@ -63,8 +60,8 @@ label-urgent-padding = 2 label-empty-padding = 2 label-occupied-padding=2 -label-urgent-foreground = ${colors.gray} -label-occupied-foreground = ${colors.gray} +label-urgent-foreground = ${colors.background_inactive} +label-occupied-foreground = ${colors.background_inactive} label-active-font = 1 [module/bspwm] @@ -75,11 +72,11 @@ label-focused = %index% label-focused-padding = 2 label-occupied = %index% -label-occupied-foreground = ${colors.gray} +label-occupied-foreground = ${colors.background_inactive} label-occupied-padding = 2 label-urgent = %index% -label-urgent-foreground = ${colors.red} +label-urgent-foreground = ${colors.warning} label-urgent-padding = 2 label-empty = @@ -95,7 +92,7 @@ format-discharging=Battery: <label-discharging> label-discharging=%percentage%% format-charging=Charging: <label-charging> label-charging=%percentage%% -format-discharging-foreground=${colors.grayish} +format-discharging-foreground=${colors.background_inactive} label-discharging-foreground=${colors.foreground} [module/backlight] @@ -105,7 +102,7 @@ use-actual-brightness = true enable-scroll = true format = Brightness: <label> label=%percentage%% -format-foreground=${colors.grayish} +format-foreground=${colors.background_inactive} label-foreground=${colors.foreground} [module/date] @@ -117,7 +114,7 @@ date-alt = %A, %d %B %Y time-alt = %H:%M:%S format=<label> label=%time% -format-foreground=${colors.blue} +format-foreground=${colors.non_warning} [module/cpu] type = internal/cpu @@ -126,7 +123,7 @@ warn-percentage = 95 format= cpu: <label> label=%percentage%% -format-foreground=${colors.grayish} +format-foreground=${colors.background_inactive} label-foreground=${colors.foreground} [module/memory] @@ -136,7 +133,7 @@ warn-percentage = 95 format=ram: <label> label=%gb_used% -format-foreground=${colors.grayish} +format-foreground=${colors.background_inactive} label-foreground=${colors.foreground} [module/pulseaudio] @@ -145,8 +142,8 @@ format-volume-prefix = "VOL " format-volume = <label-volume> label-muted = VOL %percentage%% label-volume = %percentage%% -label-muted-foreground = ${colors.gray} -format-volume-prefix-foreground = ${colors.gray} +label-muted-foreground = ${colors.background_inactive} +format-volume-prefix-foreground = ${colors.background_inactive} [network-base] type = internal/network @@ -159,14 +156,13 @@ label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected inherit = network-base interface-type = wireless label-connected = %essid% -label-connected-foreground = ${colors.yellow} +label-connected-foreground = ${colors.interactive} [module/eth] inherit = network-base interface-type = wired label-connected = %{F#F0C674}%ifname%%{F-} %local_ip% -[module/wired-networjk] +[module/wired-network] type = internal/network interface = enp2s0 - diff --git a/src/dotfiles/sxhkd/sxhkdrc b/src/dotfiles/sxhkd/sxhkdrc index 2ee72e2..e8928da 100755 --- a/src/dotfiles/sxhkd/sxhkdrc +++ b/src/dotfiles/sxhkd/sxhkdrc @@ -1,26 +1,26 @@ -######################################################## -######### General keybinds ########## -######################################################## +# For some keybinds to work properly some scripts from "https://github.com/thei0n/slcf" must be installed + +######### General keybinds ########## #Launch terminal alt + Return - alacritty + [ -z $TERMINAL ] && alacritty || $TERMINAL #Launch browser alt + shift + Return - qutebrowser + [ -z $BROWSER ] && qutebrowser || $BROWSER #Change wallpaper alt + shift + v - nitrogen --set-zoom-fill --random ~/.config/wallpapers + setwp ~/.config/wallpapers #Launch terminal alternative alt + shift + n - kitty + [ -z $TERMINAL_ALTERNATIVE ] && kitty || $TERMINAL_ALTERNATIVE #Kill all the alternative terminal instances alt + shift + m - killall kitty + [ -z $TERMINAL_ALTERNATIVE ] && killall kitty || killall $TERMINAL_ALTERNATIVE #Open gruvbox themed dmenu alt + d @@ -32,28 +32,26 @@ alt+p #Volume buttons XF86AudioRaiseVolume - pactl set-sink-volume @DEFAULT_SINK@ +10% + sVolume +10 + XF86AudioLowerVolume - pactl set-sink-volume @DEFAULT_SINK@ -10% + sVolume -10 + XF86AudioMute - pactl set-sink-mute @DEFAULT_SINK@ toggle -XF86AudioMute - pactl set-source-mute @DEFAULT_SINK@ + sVolume --toggle #Brightness buttons XF86MonBrightnessUp - brightnessctl -c backlight set +5% + sBrightness +5 XF86MonBrightnessDown - brightnessctl -c backlight set 5%- + sBrightness -5 #Screenshot alt + shift + s - maim ~/Pictures/screenshots/$(date +%s).png + sScreenshot -######################################################## ######### BSPWM specific keybinds ########## -######################################################## #Change workspaces alt + {_,shift + }{1-9} @@ -105,4 +103,3 @@ alt + shift + {h,j,k,l} alt + r bspc node @/ -R 90 - diff --git a/src/dotfiles/zathura/zathurarc b/src/dotfiles/zathura/zathurarc index 152867f..e2a5e11 100755 --- a/src/dotfiles/zathura/zathurarc +++ b/src/dotfiles/zathura/zathurarc @@ -1,3 +1,5 @@ +# Gruvbox themed zathura theme at "https://github.com/eastack/zathura-gruvbox" + set notification-error-bg "#282828" # bg set notification-error-fg "#fb4934" # bright:red set notification-warning-bg "#282828" # bg diff --git a/src/dotfiles/zsh/user_profile b/src/dotfiles/zsh/user_profile new file mode 100644 index 0000000..fab1b0e --- /dev/null +++ b/src/dotfiles/zsh/user_profile @@ -0,0 +1,19 @@ +# Aliases +[ -f $XINITRC ] && alias startx="startx $XINITRC" +[ -x "$(command -v nvim)" ] && alias vim="nvim" +alias ls="ls -A --color=auto" +alias ping="ping -c 2" +alias clear="clear -x" +alias open="xdg-open" +alias lf="lfcd" +alias vim="nvim" +alias touchOn="synclient TouchpadOff=0" +alias touchOff="synclient TouchpadOff=1" + +# Systemd and Arch linux specific aliases +alias pacman="sudo pacman" +alias systemctl="sudo systemctl" +alias arch-wiki="cd /usr/share/doc/arch-wiki/html/en/" +alias is="systemctl stop NetworkManager" +alias blue="sudo systemctl start bluetooth" +alias net="sudo systemctl start NetworkManager" diff --git a/src/dotfiles/zshrc b/src/dotfiles/zsh/zshrc index d65bb44..873f29d 100755 --- a/src/dotfiles/zshrc +++ b/src/dotfiles/zsh/zshrc @@ -1,23 +1,15 @@ -#Theion's zsh config - -# Enable colors and change prompt: -autoload -U colors && colors # Load colors -PROMPT="%B%F{cyan}%~ %F{none}$%b " +# This config is a fork of Luke Smith's zshrc at "https://github.com/LukeSmithxyz/voidrice" +PROMPT="%B%F{red}%(?..%? )%B%F{blue}%n%b%f@%m %B%~ %% %b" #git integration autoload -Uz vcs_info precmd_vcs_info() { vcs_info } precmd_functions+=( precmd_vcs_info ) setopt prompt_subst -RPROMPT='%(?..[%?] ) ${vcs_info_msg_0_}' +RPROMPT='%B${vcs_info_msg_0_}' zstyle ':vcs_info:git:*' formats '%b' - -setopt autocd # Automatically cd into typed directory. -stty stop undef # Disable ctrl-s to freeze terminal. -setopt interactive_comments - # History in cache directory: HISTSIZE=10000000 SAVEHIST=10000000 @@ -31,8 +23,10 @@ zmodload zsh/complist compinit _comp_options+=(globdots) # Include hidden files. + # vi mode bindkey -v +bindkey '^R' history-incremental-search-backward export KEYTIMEOUT=1 # Use vim keys in tab complete menu: @@ -43,15 +37,9 @@ bindkey -M menuselect 'j' vi-down-line-or-history bindkey -v '^?' backward-delete-char -#function to quit in the direcory changed by lf lfcd () { - tmp="$(mktemp -uq)" - trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT - lf -last-dir-path="$tmp" "$@" - if [ -f "$tmp" ]; then - dir="$(cat "$tmp")" - [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" - fi + # `command` is needed in case `lfcd` is aliased to `lf` + cd "$(command lf -print-last-dir "$@")" } # Change cursor shape for different vi modes. @@ -61,6 +49,8 @@ function zle-keymap-select () { viins|main) echo -ne '\e[5 q';; # beam esac } + + zle -N zle-keymap-select zle-line-init() { zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) @@ -70,20 +60,11 @@ zle -N zle-line-init echo -ne '\e[5 q' # Use beam shape cursor on startup. preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. -#aliases -alias pacman='sudo pacman' -alias systemctl='sudo systemctl' -alias arch-wiki='cd /usr/share/doc/arch-wiki/html/en/' -alias ls='ls --color=auto' -alias open='xdg-open' -alias is="systemctl stop NetworkManager" -alias blue="sudo systemctl start bluetooth" -alias net="sudo systemctl start NetworkManager" -alias lf="lfcd" -alias touchOff='synclient TouchpadOff=1' -alias ping='ping -c 2' -alias clear='clear -x' -alias vim='nvim' +# Options +setopt autocd # Automatically cd into typed directory. +# stty stop undef # Disable ctrl-s to freeze terminal. +setopt interactive_comments unsetopt nomatch -LFS=/mnt/lfs +setopt INC_APPEND_HISTORY # Adds command to history when they are run +setopt HIST_FIND_NO_DUPS # Doesn't show duplicate commands when backward searching diff --git a/src/etc/profile b/src/etc/profile new file mode 100644 index 0000000..93b503d --- /dev/null +++ b/src/etc/profile @@ -0,0 +1,10 @@ +# If the /etc/profile.d directory is not sourced automatically +# append this code to /etc/profile + +# Load profiles from /etc/profile.d +if test -d /etc/profile.d/; then + for profile in /etc/profile.d/*.sh; do + test -r "$profile" && . "$profile" + done + unset profile +fi diff --git a/src/etc/profile.d/theion.sh b/src/etc/profile.d/theion.sh new file mode 100644 index 0000000..5a6d6f5 --- /dev/null +++ b/src/etc/profile.d/theion.sh @@ -0,0 +1,43 @@ +export XDG_COLOR_DARK_GRAY="#282828" +export XDG_COLOR_LESS_DARK_GRAY="#262626" +export XDG_COLOR_CREAM="#ebdbb2" +export XDG_COLOR_BROWN="#4E3524" +export XDG_COLOR_LIGHT_GRAY="#a89984" +export XDG_COLOR_ORANGE="#d79921" +export XDG_COLOR_RED="#cc241d" +export XDG_COLOR_MAGENTA="#b16286" +export XDG_COLOR_YELLOW_GREEN="#98971a" +export XDG_COLOR_LIGHT_GREEN="#689d6a" +export XDG_COLOR_CYAN="#458588" + +# Theme +export XDG_COLOR_FOREGROUND=$XDG_COLOR_CREAM +export XDG_COLOR_BACKGROUND=$XDG_COLOR_DARK_GRAY + +export XDG_COLOR_INACTIVE_FOREGROUND=$XDG_COLOR_LIGHT_GRAY +export XDG_COLOR_INACTIVE_BACKGROUND=$XDG_COLOR_LESS_DARK_GRAY + +export XDG_COLOR_TRANSFORM=$XDG_COLOR_BROWN +export XDG_COLOR_INACTIVE_TRANSFORM=$XDG_COLOR_LESS_DARK_GRAY + +export XDG_COLOR_WARINING=$XDG_COLOR_RED +export XDG_COLOR_NON_WARNING=$XDG_COLOR_CYAN +export XDG_COLOR_INTERACTIVE=$XDG_COLOR_YELLOW_GREEN + +#Directories +export XDG_CACHE_HOME=$HOME/.cache +export XDG_CONFIG_HOME=$HOME/.config +export XDG_DATA_HOME=$HOME/.local/share +export XDG_STATE_HOME=$HOME/.local/state +export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" +export ZSHRC="$XDG_CONFIG_HOME/zsh/zshrc" + + +# Environment variables +[ -x "$(command -v nvim)" ] && export EDITOR="nvim" +[ -x "$(command -v alacritty)" ] && export TERMINAL="alacritty" +[ -x "$(command -v qutebrowser)" ] && export BROWSER="qutebrowser" + +export MAKEFLAGS="-j8" # Reduce compile times +export LFS=/mnt/lfs # For building Linux From Scratch +export LS_COLORS="di=01;36" # Change the color of ls output to green for directory diff --git a/src/scripts/border b/src/scripts/border index 6cc5150..6738acd 100755 --- a/src/scripts/border +++ b/src/scripts/border @@ -3,4 +3,3 @@ bspc config border_width $1 [ $1 = "blue" ] && bspc config focused_border_color "#099999" - diff --git a/src/scripts/linkbuds b/src/scripts/linkbuds deleted file mode 100755 index 3880fe1..0000000 --- a/src/scripts/linkbuds +++ /dev/null @@ -1 +0,0 @@ -bluetoothctl connect F8:4E:17:E7:02:51 diff --git a/src/scripts/nocomment b/src/scripts/nocomment index 9c62cc8..cd5f0c2 100755 --- a/src/scripts/nocomment +++ b/src/scripts/nocomment @@ -1,3 +1,6 @@ #!/bin/sh +# Remove all the commments in the given file +# Comments are considered to start with "#" + sed -i "s/\s*#.*//g; /^$/ d" $1 diff --git a/src/scripts/nospac b/src/scripts/nospac index d69003d..3dee5de 100755 --- a/src/scripts/nospac +++ b/src/scripts/nospac @@ -1,3 +1,5 @@ #!/bin/sh +# Replace all the spaces in file names with "_" in the current working directory + for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done diff --git a/src/scripts/sBrightness b/src/scripts/sBrightness new file mode 100755 index 0000000..9f2363a --- /dev/null +++ b/src/scripts/sBrightness @@ -0,0 +1,13 @@ +#!/bin/sh + +# Wrapper script for backlight control + +arg=$1 + +[ $# -eq 0 ] && { echo "Error: No argument" ; exit 2 ;} + +[ $# -gt 1 ] && { echo Too much arguments ; exit 2 ; } + +[ $arg -lt 0 ] && positive_arg=$(echo $arg | tr -d "-") && brightnessctl -c backlight set $positive_arg%- && exit 0 + +brightnessctl -c backlight set $arg% diff --git a/src/scripts/sScreenshot b/src/scripts/sScreenshot new file mode 100755 index 0000000..33fda01 --- /dev/null +++ b/src/scripts/sScreenshot @@ -0,0 +1,7 @@ +#!/bin/sh + +# Wrapper script for screenshots + +[ -d ~/Pictures/screenshots ] || mkdir -p ~/Pictures/screenshots + +maim ~/Pictures/screenshots/$(date +%s).png diff --git a/src/scripts/sTouchpad b/src/scripts/sTouchpad new file mode 100755 index 0000000..b34abd8 --- /dev/null +++ b/src/scripts/sTouchpad @@ -0,0 +1,15 @@ +#!/bin/sh + +# Wrapper script for activating and deactivating touchpad + +[ -d ~/.cache ] && mkdir ~/.cache || { echo "Couldn't create ~/.cache " && exit 2; } + +file=~/.cache/touchpad_on + +if [ -f $file ];then + rm $file + xinput disable "$(xinput list --name-only | grep Touchpad)" +else + touch $file + xinput enable "$(xinput list --name-only | grep Touchpad)" +fi diff --git a/src/scripts/sVolume b/src/scripts/sVolume new file mode 100755 index 0000000..1a433d4 --- /dev/null +++ b/src/scripts/sVolume @@ -0,0 +1,11 @@ +#!/bin/sh + +# Wrapper script for volume control + +arg=$1 +[ $# = 0 ] && { echo ERROR: No argument ; exit 2; } +[ $# -gt 1 ] && { echo Too much arguments ; exit 2 ; } + +[ $arg = '--toggle' ] && { pactl set-sink-mute @DEFAULT_SINK@ toggle ; exit 0 ;} + +pactl set-sink-volume @DEFAULT_SINK@ $1% diff --git a/src/scripts/setwp b/src/scripts/setwp new file mode 100755 index 0000000..d80c10e --- /dev/null +++ b/src/scripts/setwp @@ -0,0 +1,18 @@ +#!/bin/sh + +# Wrapper script for setting wallpaper + +program_name=setwp + +for argument in $@; +do + [ ! -e $argument ] && { echo $program_name: cannot access "'$argument'": No such file or directory && exit 2; } + + [ -d $argument ] && wallpaper_list="$wallpaper_list $(ls -d $argument/*)" + + [ -f $argument ] && wallpaper_list="$wallpaper_list $argument" + +done + + +xwallpaper --zoom $(shuf -en 1 $wallpaper_list) diff --git a/src/scripts/touchOn b/src/scripts/touchOn deleted file mode 100755 index dbcf803..0000000 --- a/src/scripts/touchOn +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -synclient TouchpadOff=0 diff --git a/src/scripts/wal b/src/scripts/wal deleted file mode 100755 index 86fc452..0000000 --- a/src/scripts/wal +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - - - -cd ~/.config/wallpapers/ -[ -z $1 ] && \ -ls ~/.config/wallpapers | \ -dmenu -l 5 -i -nb '#282828' -nf '#ebdbb2' -sb '#ebdbb2' -sf '#1f222d' -fn 'Roboto:bold:pixelsize=14'| \ -xargs nitrogen --set-zoom-fill --random \ -|| nitrogen --set-zoom-fill $1 - |