Skip to content

Commit

Permalink
Update: Changed scipts, updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyitdev committed Jun 22, 2022
1 parent 35c6ea4 commit c589d31
Show file tree
Hide file tree
Showing 11 changed files with 208 additions and 163 deletions.
80 changes: 62 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ My personal build of dotfiles using i3. Color palette is based on OneDark color
[Dependecies](https://github.com/keyitdev/dotfiles#Dependecies) ·
[Installation](https://github.com/keyitdev/dotfiles#Installation) ·
[Keybinds](https://github.com/keyitdev/dotfiles#Keybinds) ·
[Colors](https://github.com/keyitdev/dotfiles#Colors) ·
[Troubleshooting](https://github.com/keyitdev/dotfiles#Troubleshooting)

![](https://img.shields.io/github/stars/keyitdev/dotfiles?color=dd864a&labelColor=202328&style=for-the-badge)
Expand Down Expand Up @@ -48,8 +49,7 @@ My personal build of dotfiles using i3. Color palette is based on OneDark color
* wm and X11: i3-gaps i3blocks i3lock xorg xorg-xinit xorg-server
* lockscreen: i3lock betterlockscreen feh imagemagick
* programs: kitty rofi dunst (with libnotify) ranger ncmpcpp mpd polybar papirus-icon-theme btop sddm zsh (with oh-my-zsh) picom cava code neovim
* screenshot script: xclip scrot ffcast slop
pulsemixer
* screenshot script: xclip scrot ffcast slop
* emoji fonts: noto-fonts noto-fonts-emoji noto-fonts-extra noto-fonts-cjk

### Fonts used
Expand All @@ -59,9 +59,59 @@ pulsemixer

## 🛠️ Installation

### Arch
I recommend manually installing packages and coping files, but if you are lazy or are a productive person who don't want to waste your time, you can try to use arch install script and commands bellow:

### Arch manually

1. Clone this dotfiles
```sh
git clone -b master --depth 1 https://www.github.com/keyitdev/dotfiles.git
```
1. Install AUR helper (for example yay in ~/.srcs)
```sh
mkdir -p ~/.srcs
git clone https://aur.archlinux.org/$HELPER.git ~/.srcs/$HELPER
(cd ~/.srcs/$HELPER/ && makepkg -si )
```
1. Install packages (see [Dependecies](https://github.com/keyitdev/dotfiles#Dependecies))
1. Make light executable
```sh
sudo chmod +s /usr/bin/light
```
1. Copy files (config folder to `$HOME/.config`, fonts to `/usr/share/fonts/`, wallpaper to `$HOME/Pictures/wallpapers` etc.)
1. Install oh my zsh
```sh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
1. Set zsh as default shell
```sh
chsh -s /bin/zsh
sudo chsh -s /bin/zsh
```
1. Install AstroVim
```sh
git clone --depth 10 https://github.com/kabinspace/AstroVim.git ~/.config/nvim
nvim +PackerSync
```
1. Install gtk3 theme
```sh
git clone https://github.com/EliverLara/ant.git
sudo mv ./Ant /usr/share/themes
```
1. Install sddm astronaut theme
```sh
sudo git clone https://github.com/keyitdev/sddm-astronaut-theme.git /usr/share/
sddm/themes/
```
1. Edit `/etc/sddm.conf`
```
[Theme]
Current=sddm-astronaut-theme
```
1. [Install Firefox theme](https://color.firefox.com/?theme=XQAAAAKGAQAAAAAAAABBqYhm849SCia73laEGccwS-xMDPr5iE6kjVUHIsGRvs0-q94VqJzDmLds0B4GdTFd2KORmhozpED9fKKY97YpmeSVCJcSVB9rwzacQGHhaYG0HJIDBXLbAYUnjpkVXo5LFBoIgdJ4P7MSUoS9tEpFY9l-n8P03V91Kq7BmmKKrjKq9Hi2Jvfl7wBEWz3nWVxnwd4XKskPQ2G_JFlEZFH-xMtfBJ5OSQmfzox2bvycbCOGiDW99yOqfX2u-cPiqZwcshaSPxDSqShJ5_7OhZzPbP5x-BM)

### Arch with script

Clone dotfiles
```
git clone https://www.github.com/keyitdev/dotfiles.git
Expand Down Expand Up @@ -105,11 +155,12 @@ Current=sddm-astronaut-theme
1. Remove installed packages (see [Dependecies](https://github.com/keyitdev/dotfiles#Dependecies))
2. Remove AUR helper ( ~/.srcs)
3. Unistall oh my zsh ` uninstall_oh_my_zsh`
4. Change back shell to bash
4. Change shell back to bash
```
chsh -s /bin/zsh root: sudo chsh -s /bin/zsh
chsh -s /bin/bash
sudo chsh -s /bin/bash
```
5. Remove installed fonts (~/.local/share/fonts/)
5. Remove installed fonts (~/.local/share/fonts/ or /usr/share/fonts/)
6. Remove installed scripts (/usr/local/bin)
7. Delete this repo

Expand Down Expand Up @@ -162,27 +213,20 @@ Note: `Win` refers to the `Super/Mod` key.

1. Polybar modules not working : Try changing variables (For example in battery module from BAT1 to BAT0).
2. Black flashing screen : Try changing picom config.
3. Scripts not working : Edit them.
4. Mpd not working : Check if any other app isn't using port 6600 (http://127.0.0.1:6600/)
3. Scripts not working : Maybe try to edit bang.
4. Mpd not working : Check if any other program isn't using port 6600 (http://127.0.0.1:6600/).

## ✨ Big thanks to

These dotfiles includes some files from others rices. Original sources:
* [Totoro](https://github.com/totoro-ghost) for [polybar frontend](https://github.com/totoro-ghost/dotfiles/tree/master/.config/polybar)
* [Adi1090x](https://github.com/adi1090x) for [rofi backend](https://github.com/adi1090x/rofi)
* [Alexander-Miller](https://github.com/Alexander-Miller) for [ncmpcpp config](https://github.com/Alexander-Miller/dotfiles/blob/master/.config/ncmpcpp/config)
* [Ceuk](https://github.com/ceuk/) for [rofi screenshot script](https://github.com/ceuk/rofi-screenshot)
* [Axarva](https://github.com/Axarva/) for [arch install script](https://github.com/Axarva/dotfiles-2.0/blob/main/install-on-arch.sh)
* [Unnat](https://github.com/UnnatShaneshwar) for [wallpaper](https://github.com/UnnatShaneshwar/OneDarkWallpapers/blob/main/11.png)
* [Ceuk](https://github.com/ceuk/) for [rofi screenshot script](https://github.com/ceuk/rofi-screenshot)
* [Milosz](https://github.com/milosz) for [rofi-bookmarks](https://github.com/milosz/rofi-firefox-bookmarks)

Not modified by me but used in these dotfiles
* [Nvchad team](https://github.com/NvChad/NvChad#chadributors) for [Nvchad](https://github.com/NvChad/NvChad)
* [EliverLara](https://github.com/EliverLara) for [gtk Dracula (ant) theme](https://github.com/EliverLara/alt)
* [Vinceliuice](https://github.com/vinceliuice) for [grub2 theme](https://github.com/vinceliuice/grub2-themes)
* [MarianArlt](https://github.com/MarianArlt) for [sddm theme](https://github.com/MarianArlt/sddm-sugar-dark),
[Totoro](https://github.com/totoro-ghost) for [sddm theme astronaut](https://github.com/totoro-ghost/sddm-astronaut)
* [Unnat](https://github.com/UnnatShaneshwar) for [wallpaper](https://github.com/UnnatShaneshwar/OneDarkWallpapers/blob/main/11.png)

## 🪪 License

Distributed under the [GPLv3+](https://www.gnu.org/licenses/gpl-3.0.html) License.
Distributed under the [GPLv3+](https://www.gnu.org/licenses/gpl-3.0.html) License.
4 changes: 2 additions & 2 deletions config/i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ bindsym ctrl + F1 exec --no-startup-id kitty
bindsym ctrl + F2 exec --no-startup-id dmenu_run

# toggle microphone
bindsym ctrl + F3 exec amixer set Capture cap && dunstify -a "Microphone" "Microphone is now unmuted" -r 100 -i /usr/local/bin/icons/mic.svg
bindsym ctrl + F4 exec amixer set Capture nocap && dunstify -a "Microphone" "Microphone is now muted" -r 100 -i /usr/local/bin/icons/mic-off.svg
bindsym ctrl + F3 exec amixer set Capture cap && dunstify -a "Microphone" "Microphone" "Microphone is now unmuted" -r 100 -i /usr/local/bin/icons/mic.svg
bindsym ctrl + F4 exec amixer set Capture nocap && dunstify -a "Microphone" "Microphone" "Microphone is now muted" -r 100 -i /usr/local/bin/icons/mic-off.svg

# toggle touchpad
bindsym ctrl + F9 exec xinput set-prop 15 "Device Enabled" 0 && dunstify -a "Touchpad" "Touchpad" "Touchpad is disabled" -r 100
Expand Down
1 change: 1 addition & 0 deletions config/vsc/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"oneDarkPro.markdownStyle": false,
"workbench.colorCustomizations": {
"[One Dark Pro Darker]": {
"terminal.background": "#21222c",
"sideBar.background": "#21222c",
"focusBorder": "#343746",
"activityBar.background": "#282A36",
Expand Down
30 changes: 15 additions & 15 deletions scripts/battery
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#!/bin/bash
#!/bin/sh

for pid in $(pidof -x battery); do
if [ $pid != $$ ]; then
kill -9 $pid
if [ "$pid" != $$ ]; then
kill -9 "$pid"
fi
done

DIR_ICONS="/usr/local/bin/icons"
dir_icons="/usr/local/bin/icons"

# Notify when below this percentage
WARNING_LEVEL=15
# notify when below this percentage
warning_level=15

# How often to check battery status, in minutes
CHECK_INTERVAL=1
# how often to check battery status, in minutes
check_interval=1

while true; do
battery_level=$(acpi -b \
| cut -d, -f2 | cut --characters=2,3,4 \
| sed 's/%//g')
charging=$(acpi -b | grep -c "Charging")
charging=$(acpi -b | grep -c "charging")

# When battery is low, and not already charging
if [ $battery_level -lt $WARNING_LEVEL ] &&
[ $charging -eq 0 ]
# when battery is low, and not already charging
if [ "$battery_level" -lt "$warning_level" ] &&
[ "$charging" -eq 0 ]
then
dunstify -a "Battery" \
"Low battery: ${battery_level}%" \
"Battery is running low" \
-r 100 \
-i $DIR_ICONS/battery.svg
-i $dir_icons/battery.svg
fi

sleep ${CHECK_INTERVAL}m
done
sleep ${check_interval}m
done
20 changes: 10 additions & 10 deletions scripts/brightness
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/bash
#!/bin/sh

DIR_ICONS="/usr/local/bin/icons"
dir_icons="/usr/local/bin/icons"

MAX_BRI=$(cat /sys/class/backlight/*/max_brightness)
CUR_BRI=$(cat /sys/class/backlight/*/brightness)
max_bri=$(cat /sys/class/backlight/*/max_brightness)
cur_bri=$(cat /sys/class/backlight/*/brightness)

# calculating current percentage
((CUR_PER = CUR_BRI * 100 / MAX_BRI))
cur_per=$((cur_bri * 100 / max_bri))

if [ $CUR_PER -ge 50 ]; then
if [ "$cur_per" -ge 50 ]; then
dunstify -a "Brightness" \
"Brightness" \
"Current brightness is $CUR_PER%" \
"Current brightness is $cur_per%" \
-r 100 \
-i $DIR_ICONS/sun.svg
-i "$dir_icons"/sun.svg
else
dunstify -a "Brightness" \
"Brightness" \
"Current brightness is $CUR_PER%" \
"Current brightness is $cur_per%" \
-r 100 \
-i $DIR_ICONS/moon.svg
-i "$dir_icons"/moon.svg
fi
42 changes: 21 additions & 21 deletions scripts/mute
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
#!/bin/bash
#!/bin/sh

DIR="/usr/local/bin/icons"
dir="/usr/local/bin/icons"

CUR_VOL=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
MUTE=$(pactl list sinks | grep Mute | sed 's/.*Mute: //g' | sed 1q)
cur_vol=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
head -n $(( SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
MUTE=$(pacmd list-sinks | awk '/muted/ { print $2 }' | head -1)
affirmative="yes"
negative="no"

VOL_QUIET=33
VOL_LOUD=66
vol_quiet=33
vol_loud=66

if [[ $MUTE = $affirmative ]]; then
if [ "$MUTE" = "$affirmative" ]; then
dunstify -a "Mute" \
"Mute" \
"Muted" \
"Sink is now muted" \
-r 100 \
-i $DIR/volume-x.svg
elif [[ $MUTE = $negative ]]; then
if [ $CUR_VOL -le $VOL_QUIET ]; then
-i "$dir"/volume-x.svg
elif [ "$MUTE" = "$negative" ]; then
if [ "$cur_vol" -le "$vol_quiet" ]; then
dunstify -a "Mute" \
"Mute" \
"Unmuted" \
"Sink is now unmuted" \
-r 100 \
-i $DIR/volume.svg
-i "$dir"/volume.svg
fi
if [ $CUR_VOL -gt $VOL_QUIET ] && [ $CUR_VOL -le $VOL_LOUD ]; then
if [ "$cur_vol" -gt "$vol_quiet" ] && [ "$cur_vol" -le "$vol_loud" ]; then
dunstify -a "Mute" \
"Mute" \
"Unmuted" \
"Sink is now unmuted" \
-r 100 \
-i $DIR/volume-1.svg
-i "$dir"/volume-1.svg
fi
if [ $CUR_VOL -gt $VOL_LOUD ]; then
if [ "$cur_vol" -gt "$vol_loud" ]; then
dunstify -a "Mute" \
"Mute" \
"Unmuted" \
"Sink is now unmuted" \
-r 100 \
-i $DIR/volume-2.svg
-i "$dir"/volume-2.svg
fi

fi
echo $MUTE
echo "$MUTE"
4 changes: 2 additions & 2 deletions scripts/pacman-clear
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
#!/bin/sh

# take all the cache and remove useless packages
sudo pacman -Sc
sudo pacman -Scc
paccache -r
sudo pacman -Rns $(pacman -Qtdq)
sudo pacman -Rns "$(pacman -Qtdq)"

# list cache
sudo du -sh ~/.cache/
Expand Down
Loading

0 comments on commit c589d31

Please sign in to comment.