More sensible setup and add a system file
This commit is contained in:
37
bin/setup-configs.sh
Executable file
37
bin/setup-configs.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# Setup the various configuration files throughout the system and install any additional
|
||||
# git packages or files necessary to make them work.
|
||||
|
||||
CWD=$(pwd)
|
||||
|
||||
link_config_file () {
|
||||
mv $2 $2.bak
|
||||
ln -s $CWD/configs/$1 $2
|
||||
}
|
||||
|
||||
CWD=$(pwd)
|
||||
echo "Current working directory is:"
|
||||
echo $CWD
|
||||
|
||||
# Assume zsh is installed and install oh-my-zsh and change shell
|
||||
curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh > install_zsh.sh
|
||||
chmod +x ./install_zsh.sh
|
||||
RUNZSH='no' ./install_zsh.sh
|
||||
rm ./install_zsh.sh
|
||||
|
||||
# # Install the NERDFonts patched fonts for use in powerline packages
|
||||
# cd $HOME
|
||||
# mkdir -p ./src/git
|
||||
# cd ./src/git
|
||||
# git clone https://github.com/ryanoasis/nerd-fonts --depth=1
|
||||
# cd ./nerd-fonts
|
||||
# ./install.sh
|
||||
# cd $CWD
|
||||
#
|
||||
# # Install Vundle for use with Vim
|
||||
# git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim
|
||||
|
||||
# Symlink necessary config files
|
||||
link_config_file i3config $HOME/.config/i3/config
|
||||
link_config_file vimrc $HOME/.vimrc
|
||||
link_config_file tmux.conf $HOME/.tmux.conf
|
||||
44
bin/setup-packages.sh
Executable file
44
bin/setup-packages.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$EUID" -eq 0 ]
|
||||
then echo "Please do not run this script as root."
|
||||
exit
|
||||
fi
|
||||
|
||||
packages=(
|
||||
# Base Packages
|
||||
"base"
|
||||
|
||||
# Terminal Programs
|
||||
"zsh"
|
||||
"tmux"
|
||||
"screen"
|
||||
"nmon"
|
||||
"htop"
|
||||
"gvim"
|
||||
"terminator"
|
||||
|
||||
# "Desktop Environment" lol
|
||||
"i3"
|
||||
"dmenu"
|
||||
"feh"
|
||||
"nitrogen"
|
||||
"firefox"
|
||||
"xfce4"
|
||||
"xfce4-goodies"
|
||||
"networkmanager"
|
||||
"blueberry"
|
||||
|
||||
# "Development Tools"
|
||||
"base-devel"
|
||||
"cmake"
|
||||
"git"
|
||||
"rustup"
|
||||
)
|
||||
|
||||
package_list=""
|
||||
for package in ${packages[@]}; do
|
||||
package_list="$package_list $package"
|
||||
done
|
||||
|
||||
sudo pacman -Syu $package_list
|
||||
5
bin/setup-sys.sh
Executable file
5
bin/setup-sys.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Fix the power button to hibernate instead of shutdown, hibernate on laptop lid shut
|
||||
mv /etc/systemd/logind.conf /etc/systemd/logind.conf.bak
|
||||
ln -sv ./sys-files/logind.conf /etc/systemd/logind.conf
|
||||
@@ -35,30 +35,11 @@ bindsym $mod+c kill
|
||||
# start program launcher
|
||||
bindsym $mod+p exec --no-startup-id dmenu_run
|
||||
|
||||
# launch categorized menu
|
||||
#bindsym $mod+z exec --no-startup-id morc_menu
|
||||
|
||||
################################################################################################
|
||||
## sound-section - DO NOT EDIT if you wish to automatically upgrade Alsa -> Pulseaudio later! ##
|
||||
################################################################################################
|
||||
|
||||
#exec --no-startup-id volumeicon
|
||||
#bindsym $mod+Ctrl+m exec terminal -e 'alsamixer'
|
||||
#bindsym $mod+Ctrl+m exec pavucontrol
|
||||
|
||||
################################################################################################
|
||||
|
||||
# Screen brightness controls
|
||||
# bindsym XF86MonBrightnessUp exec "xbacklight -inc 10; notify-send 'brightness up'"
|
||||
# bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; notify-send 'brightness down'"
|
||||
bindsym XF86MonBrightnessUp exec "xbacklight -inc 10; notify-send 'brightness up'"
|
||||
bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; notify-send 'brightness down'"
|
||||
|
||||
# Start Applications
|
||||
#bindsym $mod+Ctrl+b exec terminal -e 'bmenu'
|
||||
#bindsym $mod+F2 exec palemoon
|
||||
#bindsym $mod+F3 exec pcmanfm
|
||||
# bindsym $mod+F3 exec ranger
|
||||
#bindsym $mod+Shift+F3 exec pcmanfm_pkexec
|
||||
#bindsym $mod+F5 exec terminal -e 'mocp'
|
||||
#bindsym $mod+t exec --no-startup-id pkill picom
|
||||
#bindsym $mod+Ctrl+t exec --no-startup-id picom -b
|
||||
#bindsym $mod+Shift+d --release exec "killall dunst; exec notify-send 'restart dunst'"
|
||||
@@ -233,6 +214,7 @@ bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcu
|
||||
|
||||
# Set shut down, restart and locking features
|
||||
#bindsym $mod+0 mode "$mode_system"
|
||||
bindsym XF86PowerOff mode "$mode_system"
|
||||
set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown
|
||||
mode "$mode_system" {
|
||||
bindsym l exec --no-startup-id i3exit lock, mode "default"
|
||||
56
setup.sh
56
setup.sh
@@ -1,53 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$EUID" -eq 0 ]
|
||||
then echo "Please do not run this script as root."
|
||||
exit
|
||||
fi
|
||||
# This is the main setup file to be run on a new Arch-based system.
|
||||
# This file only invokes the other files under the bin directory.
|
||||
# Run those individual files if you only need a part of the setup.
|
||||
|
||||
packages=(
|
||||
# Base Packages
|
||||
"base"
|
||||
|
||||
# Terminal Programs
|
||||
"tmux"
|
||||
"screen"
|
||||
"nmon"
|
||||
"htop"
|
||||
"gvim"
|
||||
"terminator"
|
||||
|
||||
# "Desktop Environment" lol
|
||||
"i3"
|
||||
"dmenu"
|
||||
"feh"
|
||||
"nitrogen"
|
||||
"firefox"
|
||||
"xfce4"
|
||||
"xfce4-goodies"
|
||||
"networkmanager"
|
||||
"blueberry"
|
||||
|
||||
# "Development Tools"
|
||||
"base-devel"
|
||||
"cmake"
|
||||
"git"
|
||||
"rustup"
|
||||
)
|
||||
|
||||
package_list=""
|
||||
for package in ${packages[@]}; do
|
||||
package_list="$package_list $package"
|
||||
done
|
||||
|
||||
sudo pacman -Syu $package_list
|
||||
|
||||
cd $HOME
|
||||
mkdir -p ./src/git
|
||||
cd ./src/git
|
||||
git clone https://github.com/ryanoasis/nerd-fonts --depth=1
|
||||
cd ./nerd-fonts
|
||||
./install.sh
|
||||
cd $HOME
|
||||
|
||||
git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim
|
||||
source ./bin/setup-packages.sh
|
||||
source ./bin/setup-configs.sh
|
||||
source ./bin/setup-sys.sh
|
||||
|
||||
50
sys-files/logind.conf
Normal file
50
sys-files/logind.conf
Normal file
@@ -0,0 +1,50 @@
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Entries in this file show the compile time defaults. Local configuration
|
||||
# should be created by either modifying this file, or by creating "drop-ins" in
|
||||
# the logind.conf.d/ subdirectory. The latter is generally recommended.
|
||||
# Defaults can be restored by simply deleting this file and all drop-ins.
|
||||
#
|
||||
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
|
||||
#
|
||||
# See logind.conf(5) for details.
|
||||
|
||||
[Login]
|
||||
#NAutoVTs=6
|
||||
#ReserveVT=6
|
||||
#KillUserProcesses=no
|
||||
#KillOnlyUsers=
|
||||
#KillExcludeUsers=root
|
||||
#InhibitDelayMaxSec=5
|
||||
#UserStopDelaySec=10
|
||||
#HandlePowerKey=poweroff
|
||||
HandlePowerKey=hibernate
|
||||
#HandlePowerKeyLongPress=ignore
|
||||
#HandleRebootKey=reboot
|
||||
#HandleRebootKeyLongPress=poweroff
|
||||
#HandleSuspendKey=suspend
|
||||
#HandleSuspendKeyLongPress=hibernate
|
||||
#HandleHibernateKey=hibernate
|
||||
#HandleHibernateKeyLongPress=ignore
|
||||
#HandleLidSwitch=suspend
|
||||
HandleLidSwitch=hibernate
|
||||
#HandleLidSwitchExternalPower=suspend
|
||||
#HandleLidSwitchDocked=ignore
|
||||
#PowerKeyIgnoreInhibited=no
|
||||
#SuspendKeyIgnoreInhibited=no
|
||||
#HibernateKeyIgnoreInhibited=no
|
||||
#LidSwitchIgnoreInhibited=yes
|
||||
#RebootKeyIgnoreInhibited=no
|
||||
#HoldoffTimeoutSec=30s
|
||||
#IdleAction=ignore
|
||||
#IdleActionSec=30min
|
||||
#RuntimeDirectorySize=10%
|
||||
#RuntimeDirectoryInodesMax=
|
||||
#RemoveIPC=yes
|
||||
#InhibitorsMax=8192
|
||||
#SessionsMax=8192
|
||||
Reference in New Issue
Block a user