mirror of
https://github.com/Keyitdev/dotfiles.git
synced 2026-09-24 01:52:09 +00:00
Update: Changed scipts, updated readme.
This commit is contained in:
@@ -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) ·
|
[Dependecies](https://github.com/keyitdev/dotfiles#Dependecies) ·
|
||||||
[Installation](https://github.com/keyitdev/dotfiles#Installation) ·
|
[Installation](https://github.com/keyitdev/dotfiles#Installation) ·
|
||||||
[Keybinds](https://github.com/keyitdev/dotfiles#Keybinds) ·
|
[Keybinds](https://github.com/keyitdev/dotfiles#Keybinds) ·
|
||||||
|
[Colors](https://github.com/keyitdev/dotfiles#Colors) ·
|
||||||
[Troubleshooting](https://github.com/keyitdev/dotfiles#Troubleshooting)
|
[Troubleshooting](https://github.com/keyitdev/dotfiles#Troubleshooting)
|
||||||
|
|
||||||

|

|
||||||
@@ -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
|
* wm and X11: i3-gaps i3blocks i3lock xorg xorg-xinit xorg-server
|
||||||
* lockscreen: i3lock betterlockscreen feh imagemagick
|
* 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
|
* 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
|
* screenshot script: xclip scrot ffcast slop
|
||||||
pulsemixer
|
|
||||||
* emoji fonts: noto-fonts noto-fonts-emoji noto-fonts-extra noto-fonts-cjk
|
* emoji fonts: noto-fonts noto-fonts-emoji noto-fonts-extra noto-fonts-cjk
|
||||||
|
|
||||||
### Fonts used
|
### Fonts used
|
||||||
@@ -59,9 +59,59 @@ pulsemixer
|
|||||||
|
|
||||||
## 🛠️ Installation
|
## 🛠️ 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:
|
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
|
Clone dotfiles
|
||||||
```
|
```
|
||||||
git clone https://www.github.com/keyitdev/dotfiles.git
|
git clone https://www.github.com/keyitdev/dotfiles.git
|
||||||
@@ -105,11 +155,12 @@ Current=sddm-astronaut-theme
|
|||||||
1. Remove installed packages (see [Dependecies](https://github.com/keyitdev/dotfiles#Dependecies))
|
1. Remove installed packages (see [Dependecies](https://github.com/keyitdev/dotfiles#Dependecies))
|
||||||
2. Remove AUR helper ( ~/.srcs)
|
2. Remove AUR helper ( ~/.srcs)
|
||||||
3. Unistall oh my zsh ` uninstall_oh_my_zsh`
|
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)
|
6. Remove installed scripts (/usr/local/bin)
|
||||||
7. Delete this repo
|
7. Delete this repo
|
||||||
|
|
||||||
@@ -162,8 +213,8 @@ 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).
|
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.
|
2. Black flashing screen : Try changing picom config.
|
||||||
3. Scripts not working : Edit them.
|
3. Scripts not working : Maybe try to edit bang.
|
||||||
4. Mpd not working : Check if any other app isn't using port 6600 (http://127.0.0.1:6600/)
|
4. Mpd not working : Check if any other program isn't using port 6600 (http://127.0.0.1:6600/).
|
||||||
|
|
||||||
## ✨ Big thanks to
|
## ✨ Big thanks to
|
||||||
|
|
||||||
@@ -171,18 +222,11 @@ 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)
|
* [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)
|
* [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)
|
* [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)
|
* [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)
|
* [Milosz](https://github.com/milosz) for [rofi-bookmarks](https://github.com/milosz/rofi-firefox-bookmarks)
|
||||||
|
* [Unnat](https://github.com/UnnatShaneshwar) for [wallpaper](https://github.com/UnnatShaneshwar/OneDarkWallpapers/blob/main/11.png)
|
||||||
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)
|
|
||||||
|
|
||||||
## 🪪 License
|
## 🪪 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.
|
||||||
+2
-2
@@ -136,8 +136,8 @@ bindsym ctrl + F1 exec --no-startup-id kitty
|
|||||||
bindsym ctrl + F2 exec --no-startup-id dmenu_run
|
bindsym ctrl + F2 exec --no-startup-id dmenu_run
|
||||||
|
|
||||||
# toggle microphone
|
# 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 + 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 is now muted" -r 100 -i /usr/local/bin/icons/mic-off.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
|
# toggle touchpad
|
||||||
bindsym ctrl + F9 exec xinput set-prop 15 "Device Enabled" 0 && dunstify -a "Touchpad" "Touchpad" "Touchpad is disabled" -r 100
|
bindsym ctrl + F9 exec xinput set-prop 15 "Device Enabled" 0 && dunstify -a "Touchpad" "Touchpad" "Touchpad is disabled" -r 100
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"oneDarkPro.markdownStyle": false,
|
"oneDarkPro.markdownStyle": false,
|
||||||
"workbench.colorCustomizations": {
|
"workbench.colorCustomizations": {
|
||||||
"[One Dark Pro Darker]": {
|
"[One Dark Pro Darker]": {
|
||||||
|
"terminal.background": "#21222c",
|
||||||
"sideBar.background": "#21222c",
|
"sideBar.background": "#21222c",
|
||||||
"focusBorder": "#343746",
|
"focusBorder": "#343746",
|
||||||
"activityBar.background": "#282A36",
|
"activityBar.background": "#282A36",
|
||||||
|
|||||||
+15
-15
@@ -1,35 +1,35 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
for pid in $(pidof -x battery); do
|
for pid in $(pidof -x battery); do
|
||||||
if [ $pid != $$ ]; then
|
if [ "$pid" != $$ ]; then
|
||||||
kill -9 $pid
|
kill -9 "$pid"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
DIR_ICONS="/usr/local/bin/icons"
|
dir_icons="/usr/local/bin/icons"
|
||||||
|
|
||||||
# Notify when below this percentage
|
# notify when below this percentage
|
||||||
WARNING_LEVEL=15
|
warning_level=15
|
||||||
|
|
||||||
# How often to check battery status, in minutes
|
# how often to check battery status, in minutes
|
||||||
CHECK_INTERVAL=1
|
check_interval=1
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
battery_level=$(acpi -b \
|
battery_level=$(acpi -b \
|
||||||
| cut -d, -f2 | cut --characters=2,3,4 \
|
| cut -d, -f2 | cut --characters=2,3,4 \
|
||||||
| sed 's/%//g')
|
| sed 's/%//g')
|
||||||
charging=$(acpi -b | grep -c "Charging")
|
charging=$(acpi -b | grep -c "charging")
|
||||||
|
|
||||||
# When battery is low, and not already charging
|
# when battery is low, and not already charging
|
||||||
if [ $battery_level -lt $WARNING_LEVEL ] &&
|
if [ "$battery_level" -lt "$warning_level" ] &&
|
||||||
[ $charging -eq 0 ]
|
[ "$charging" -eq 0 ]
|
||||||
then
|
then
|
||||||
dunstify -a "Battery" \
|
dunstify -a "Battery" \
|
||||||
"Low battery: ${battery_level}%" \
|
"Low battery: ${battery_level}%" \
|
||||||
"Battery is running low" \
|
"Battery is running low" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR_ICONS/battery.svg
|
-i $dir_icons/battery.svg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep ${CHECK_INTERVAL}m
|
sleep ${check_interval}m
|
||||||
done
|
done
|
||||||
+10
-10
@@ -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)
|
max_bri=$(cat /sys/class/backlight/*/max_brightness)
|
||||||
CUR_BRI=$(cat /sys/class/backlight/*/brightness)
|
cur_bri=$(cat /sys/class/backlight/*/brightness)
|
||||||
|
|
||||||
# calculating current percentage
|
# 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" \
|
dunstify -a "Brightness" \
|
||||||
"Brightness" \
|
"Brightness" \
|
||||||
"Current brightness is $CUR_PER%" \
|
"Current brightness is $cur_per%" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR_ICONS/sun.svg
|
-i "$dir_icons"/sun.svg
|
||||||
else
|
else
|
||||||
dunstify -a "Brightness" \
|
dunstify -a "Brightness" \
|
||||||
"Brightness" \
|
"Brightness" \
|
||||||
"Current brightness is $CUR_PER%" \
|
"Current brightness is $cur_per%" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR_ICONS/moon.svg
|
-i "$dir_icons"/moon.svg
|
||||||
fi
|
fi
|
||||||
+21
-21
@@ -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:' | \
|
cur_vol=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
|
||||||
head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
|
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)
|
MUTE=$(pacmd list-sinks | awk '/muted/ { print $2 }' | head -1)
|
||||||
affirmative="yes"
|
affirmative="yes"
|
||||||
negative="no"
|
negative="no"
|
||||||
|
|
||||||
VOL_QUIET=33
|
vol_quiet=33
|
||||||
VOL_LOUD=66
|
vol_loud=66
|
||||||
|
|
||||||
if [[ $MUTE = $affirmative ]]; then
|
if [ "$MUTE" = "$affirmative" ]; then
|
||||||
dunstify -a "Mute" \
|
dunstify -a "Mute" \
|
||||||
"Mute" \
|
"Mute" \
|
||||||
"Muted" \
|
"Sink is now muted" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR/volume-x.svg
|
-i "$dir"/volume-x.svg
|
||||||
elif [[ $MUTE = $negative ]]; then
|
elif [ "$MUTE" = "$negative" ]; then
|
||||||
if [ $CUR_VOL -le $VOL_QUIET ]; then
|
if [ "$cur_vol" -le "$vol_quiet" ]; then
|
||||||
dunstify -a "Mute" \
|
dunstify -a "Mute" \
|
||||||
"Mute" \
|
"Mute" \
|
||||||
"Unmuted" \
|
"Sink is now unmuted" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR/volume.svg
|
-i "$dir"/volume.svg
|
||||||
fi
|
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" \
|
dunstify -a "Mute" \
|
||||||
"Mute" \
|
"Mute" \
|
||||||
"Unmuted" \
|
"Sink is now unmuted" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR/volume-1.svg
|
-i "$dir"/volume-1.svg
|
||||||
fi
|
fi
|
||||||
if [ $CUR_VOL -gt $VOL_LOUD ]; then
|
if [ "$cur_vol" -gt "$vol_loud" ]; then
|
||||||
dunstify -a "Mute" \
|
dunstify -a "Mute" \
|
||||||
"Mute" \
|
"Mute" \
|
||||||
"Unmuted" \
|
"Sink is now unmuted" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR/volume-2.svg
|
-i "$dir"/volume-2.svg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
echo $MUTE
|
echo "$MUTE"
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
# take all the cache and remove useless packages
|
# take all the cache and remove useless packages
|
||||||
sudo pacman -Sc
|
sudo pacman -Sc
|
||||||
sudo pacman -Scc
|
sudo pacman -Scc
|
||||||
paccache -r
|
paccache -r
|
||||||
sudo pacman -Rns $(pacman -Qtdq)
|
sudo pacman -Rns "$(pacman -Qtdq)"
|
||||||
|
|
||||||
# list cache
|
# list cache
|
||||||
sudo du -sh ~/.cache/
|
sudo du -sh ~/.cache/
|
||||||
|
|||||||
+32
-32
@@ -1,73 +1,73 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# rofi theme
|
# rofi theme
|
||||||
THEME="$HOME/.config/rofi/compact_without_icons.rasi"
|
theme="$HOME/.config/rofi/compact_without_icons.rasi"
|
||||||
|
|
||||||
get_options() {
|
get_options() {
|
||||||
echo " Capture Region"
|
echo " Capture Region"
|
||||||
echo " Capture Region (without saving)"
|
echo " Capture Region (without saving)"
|
||||||
echo " Capture Screen"
|
echo " Capture Screen"
|
||||||
echo " Capture Screen (without saving)"
|
echo " Capture Screen (without saving)"
|
||||||
echo " Record Region (GIF)"
|
echo " Record Region (GIF)"
|
||||||
echo " Record Screen (GIF)"
|
echo " Record Screen (GIF)"
|
||||||
echo " Record Region (MP4)"
|
echo " Record Region (MP4)"
|
||||||
echo " Record Screen (MP4)"
|
echo " Record Screen (MP4)"
|
||||||
#echo " Record Region (MP4+audio_virt)"
|
#echo " Record Region (MP4+audio_virt)"
|
||||||
#echo " Record Region (MP4+audio_mic)"
|
#echo " Record Region (MP4+audio_mic)"
|
||||||
#echo " Record Audio virt"
|
#echo " Record Audio virt"
|
||||||
#echo " Record Audio mic"
|
#echo " Record Audio mic"
|
||||||
echo " Stop Recording"
|
echo " Stop Recording"
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
||||||
# Get choice from rofi
|
# get choice from rofi
|
||||||
CHOICE=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$THEME")
|
choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$theme")
|
||||||
|
|
||||||
# If user has not picked anything, exit
|
# if user has not picked anything, exit
|
||||||
if [[ -z "${CHOICE// /}" ]]; then
|
if [[ -z "${choice// /}" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# run the selected command
|
# run the selected command
|
||||||
case $CHOICE in
|
case $choice in
|
||||||
' Capture Region (without saving)')
|
' Capture Region (without saving)')
|
||||||
screenshot -crtc
|
screenshot -crtc
|
||||||
;;
|
;;
|
||||||
' Capture Region')
|
' Capture Region')
|
||||||
screenshot -crtf
|
screenshot -crtf
|
||||||
;;
|
;;
|
||||||
' Capture Screen (without saving)')
|
' Capture Screen (without saving)')
|
||||||
screenshot -cstc
|
screenshot -cstc
|
||||||
;;
|
;;
|
||||||
' Capture Screen')
|
' Capture Screen')
|
||||||
screenshot -cstf
|
screenshot -cstf
|
||||||
;;
|
;;
|
||||||
' Record Region (GIF)')
|
' Record Region (GIF)')
|
||||||
screenshot -rrg
|
screenshot -rrg
|
||||||
;;
|
;;
|
||||||
' Record Screen (GIF)')
|
' Record Screen (GIF)')
|
||||||
screenshot -rsg
|
screenshot -rsg
|
||||||
;;
|
;;
|
||||||
' Record Region (MP4)')
|
' Record Region (MP4)')
|
||||||
screenshot -rrv
|
screenshot -rrv
|
||||||
;;
|
;;
|
||||||
' Record Screen (MP4)')
|
' Record Screen (MP4)')
|
||||||
screenshot -rsv
|
screenshot -rsv
|
||||||
;;
|
;;
|
||||||
' Record Region (MP4+audio_virt)')
|
' Record Region (MP4+audio_virt)')
|
||||||
screenshot -rrav
|
screenshot -rrav
|
||||||
;;
|
;;
|
||||||
' Record Region (MP4+audio_mic)')
|
' Record Region (MP4+audio_mic)')
|
||||||
screenshot -rrmv
|
screenshot -rrmv
|
||||||
;;
|
;;
|
||||||
' Record Audio virt')
|
' Record Audio virt')
|
||||||
screenshot -rav
|
screenshot -rav
|
||||||
;;
|
;;
|
||||||
' Record Audio mic')
|
' Record Audio mic')
|
||||||
screenshot -ram
|
screenshot -ram
|
||||||
;;
|
;;
|
||||||
' Stop Recording')
|
' Stop Recording')
|
||||||
screenshot -s
|
screenshot -s
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
+43
-43
@@ -1,9 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Screenshot directory
|
# screenshot directory
|
||||||
SCREENSHOT_DIRECTORY="$HOME/Pictures/screenshots"
|
screenshot_directory="$HOME/Pictures/screenshots"
|
||||||
VIDEOS_DIRECTORY="$HOME/Videos"
|
videos_directory="$HOME/Videos"
|
||||||
AUDIO_DIRECTORY="$HOME/Music"
|
audio_directory="$HOME/Music"
|
||||||
|
|
||||||
# set ffmpeg defaults
|
# set ffmpeg defaults
|
||||||
ffmpeg() {
|
ffmpeg() {
|
||||||
@@ -27,7 +27,7 @@ countdown() {
|
|||||||
# capture region to clipboard
|
# capture region to clipboard
|
||||||
crtc() {
|
crtc() {
|
||||||
notify-send "Screenshot" "Select a region to capture"
|
notify-send "Screenshot" "Select a region to capture"
|
||||||
ffcast -q $(slop -n -f '-g %g ') png /tmp/screenshot_clip.png
|
ffcast -q "$(slop -n -f '-g %g ')" png /tmp/screenshot_clip.png
|
||||||
xclip -selection clipboard -t image/png /tmp/screenshot_clip.png
|
xclip -selection clipboard -t image/png /tmp/screenshot_clip.png
|
||||||
rm /tmp/screenshot_clip.png
|
rm /tmp/screenshot_clip.png
|
||||||
notify-send "Screenshot" "Region copied to Clipboard"
|
notify-send "Screenshot" "Region copied to Clipboard"
|
||||||
@@ -36,10 +36,10 @@ crtc() {
|
|||||||
# capture region to file and clipboard
|
# capture region to file and clipboard
|
||||||
crtf() {
|
crtf() {
|
||||||
notify-send "Screenshot" "Select a region to capture"
|
notify-send "Screenshot" "Select a region to capture"
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
ffcast -q $(slop -n -f '-g %g ') png "$SCREENSHOT_DIRECTORY/$DT.png"
|
ffcast -q "$(slop -n -f '-g %g ')" png "$screenshot_directory/$dt.png"
|
||||||
xclip -selection clipboard -t image/png "$SCREENSHOT_DIRECTORY/$DT.png"
|
xclip -selection clipboard -t image/png "$screenshot_directory/$dt.png"
|
||||||
notify-send "Screenshot" "Region saved to $SCREENSHOT_DIRECTORY"
|
notify-send "Screenshot" "Region saved to $screenshot_directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# capture screenshot to clipboard
|
# capture screenshot to clipboard
|
||||||
@@ -52,96 +52,96 @@ cstc() {
|
|||||||
|
|
||||||
# capture screenshot to file and clipboard
|
# capture screenshot to file and clipboard
|
||||||
cstf() {
|
cstf() {
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
ffcast -q png "$SCREENSHOT_DIRECTORY/$DT.png"
|
ffcast -q png "$screenshot_directory/$dt.png"
|
||||||
xclip -selection clipboard -t image/png "$SCREENSHOT_DIRECTORY/$DT.png"
|
xclip -selection clipboard -t image/png "$screenshot_directory/$dt.png"
|
||||||
notify-send "Screenshot" "Screenshot saved to $SCREENSHOT_DIRECTORY"
|
notify-send "Screenshot" "Screenshot saved to $screenshot_directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# record region (GIF)
|
# record region (GIF)
|
||||||
rrg() {
|
rrg() {
|
||||||
notify-send "Screenshot" "Select a region to record"
|
notify-send "Screenshot" "Select a region to record"
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
ffcast -q $(slop -n -f '-g %g ' && countdown) rec /tmp/screenshot_gif.mp4
|
ffcast -q "$(slop -n -f '-g %g ' && countdown)" rec /tmp/screenshot_gif.mp4
|
||||||
notify-send "Screenshot" "Converting to gif... (this can take a while)"
|
notify-send "Screenshot" "Converting to gif... (this can take a while)"
|
||||||
video_to_gif /tmp/screenshot_gif.mp4 "$SCREENSHOT_DIRECTORY/$DT.gif"
|
video_to_gif /tmp/screenshot_gif.mp4 "$screenshot_directory/$dt.gif"
|
||||||
rm /tmp/screenshot_gif.mp4
|
rm /tmp/screenshot_gif.mp4
|
||||||
notify-send "Screenshot" "Recording saved to $SCREENSHOT_DIRECTORY"
|
notify-send "Screenshot" "Recording saved to $screenshot_directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# record screen (GIF)
|
# record screen (GIF)
|
||||||
rsg() {
|
rsg() {
|
||||||
countdown
|
countdown
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
ffcast -q rec /tmp/screenshot_gif.mp4
|
ffcast -q rec /tmp/screenshot_gif.mp4
|
||||||
notify-send "Screenshot" "Converting to gif... (this can take a while)"
|
notify-send "Screenshot" "Converting to gif... (this can take a while)"
|
||||||
video_to_gif /tmp/screenshot_gif.mp4 "$SCREENSHOT_DIRECTORY/$DT.gif"
|
video_to_gif /tmp/screenshot_gif.mp4 "$screenshot_directory/$dt.gif"
|
||||||
rm /tmp/screenshot_gif.mp4
|
rm /tmp/screenshot_gif.mp4
|
||||||
notify-send "Screenshot" "Recording saved to $SCREENSHOT_DIRECTORY"
|
notify-send "Screenshot" "Recording saved to $screenshot_directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# record region (mp4)
|
# record region (mp4)
|
||||||
rrv() {
|
rrv() {
|
||||||
notify-send "Screenshot" "Select a region to record"
|
notify-send "Screenshot" "Select a region to record"
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
ffcast -q $(slop -n -f '-g %g ' && countdown) rec "$VIDEOS_DIRECTORY/$DT.mp4"
|
ffcast -q "$(slop -n -f '-g %g ' && countdown)" rec "$videos_directory/$dt.mp4"
|
||||||
notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY"
|
notify-send "Screenshot" "Recording saved to $videos_directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# record screen (mp4)
|
# record screen (mp4)
|
||||||
rsv() {
|
rsv() {
|
||||||
countdown
|
countdown
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
ffcast -q rec "$VIDEOS_DIRECTORY/$DT.mp4"
|
ffcast -q rec "$videos_directory/$dt.mp4"
|
||||||
notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY"
|
notify-send "Screenshot" "Recording saved to $videos_directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# record screen (mp4) with audio virt
|
# record screen (mp4) with audio virt
|
||||||
rrav() {
|
rrav() {
|
||||||
notify-send "Screenshot" "Select a region to record"
|
notify-send "Screenshot" "Select a region to record"
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
ffcast -q $(slop -n -f '-g %g ' && countdown) ffmpeg \
|
ffcast -q "$(slop -n -f '-g %g ' && countdown)" ffmpeg \
|
||||||
-hide_banner \
|
-hide_banner \
|
||||||
-loglevel error \
|
-loglevel error \
|
||||||
-f x11grab -show_region 1 -framerate 30 -video_size %wx%h -i :0.0+%x,%y \
|
-f x11grab -show_region 1 -framerate 30 -video_size %wx%h -i :0.0+%x,%y \
|
||||||
-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1 "$VIDEOS_DIRECTORY/$DT.mp4"
|
-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1 "$videos_directory/$dt.mp4"
|
||||||
notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY"
|
notify-send "Screenshot" "Recording saved to $videos_directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# record screen (mp4) with mic audio
|
# record screen (mp4) with mic audio
|
||||||
rrmv() {
|
rrmv() {
|
||||||
notify-send "Screenshot" "Select a region to record"
|
notify-send "Screenshot" "Select a region to record"
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
ffcast -q $(slop -n -f '-g %g ' && countdown) ffmpeg \
|
ffcast -q "$(slop -n -f '-g %g ' && countdown)" ffmpeg \
|
||||||
-hide_banner \
|
-hide_banner \
|
||||||
-loglevel error \
|
-loglevel error \
|
||||||
-f x11grab -show_region 1 -framerate 30 -video_size %wx%h -i :0.0+%x,%y \
|
-f x11grab -show_region 1 -framerate 30 -video_size %wx%h -i :0.0+%x,%y \
|
||||||
-f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 1 "$VIDEOS_DIRECTORY/$DT.mp4"
|
-f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 1 "$videos_directory/$dt.mp4"
|
||||||
notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY"
|
notify-send "Screenshot" "Recording saved to $videos_directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# record audio virt
|
# record audio virt
|
||||||
rav() {
|
rav() {
|
||||||
notify-send "Screenshot" "Starting audio recording." -i sound-recorder
|
notify-send "Screenshot" "Starting audio recording." -i sound-recorder
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
'ffmpeg' \
|
'ffmpeg' \
|
||||||
-loglevel error \
|
-loglevel error \
|
||||||
-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1 "$AUDIO_DIRECTORY/$DT.mp3"
|
-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1 "$audio_directory/$dt.mp3"
|
||||||
notify-send "Screenshot" "Audio saved to $AUDIO_DIRECTORY" -i sound-recorder
|
notify-send "Screenshot" "Audio saved to $audio_directory" -i sound-recorder
|
||||||
}
|
}
|
||||||
|
|
||||||
# record audio mic
|
# record audio mic
|
||||||
ram() {
|
ram() {
|
||||||
notify-send "Screenshot" "Starting audio recording." -i sound-recorder
|
notify-send "Screenshot" "Starting audio recording." -i sound-recorder
|
||||||
DT=$(date '+%d-%m-%Y %H:%M:%S')
|
dt=$(date '+%d-%m-%Y %H:%M:%S')
|
||||||
'ffmpeg' \
|
'ffmpeg' \
|
||||||
-loglevel error \
|
-loglevel error \
|
||||||
-f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 1 "$AUDIO_DIRECTORY/$DT.mp3"
|
-f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 1 "$audio_directory/$dt.mp3"
|
||||||
notify-send "Screenshot" "Audio saved to $AUDIO_DIRECTORY" -i sound-recorder
|
notify-send "Screenshot" "Audio saved to $audio_directory" -i sound-recorder
|
||||||
}
|
}
|
||||||
|
|
||||||
check_deps() {
|
check_deps() {
|
||||||
if ! hash $1 2>/dev/null; then
|
if ! hash "$1" 2>/dev/null; then
|
||||||
echo "Error: This script requires $1"
|
echo "Error: This script requires $1"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -249,5 +249,5 @@ main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# running the program
|
# running the program
|
||||||
main $1 &
|
main "$1" &
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# rofi theme
|
# rofi theme
|
||||||
DIR_THEME="$HOME/.config/rofi/compact_without_icons.rasi"
|
dir_theme="$HOME/.config/rofi/compact_without_icons.rasi"
|
||||||
|
|
||||||
DIR="/usr/local/bin/themes"
|
DIR="/usr/local/bin/themes"
|
||||||
|
|
||||||
@@ -12,14 +12,14 @@ get_options_theme_polybar() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
||||||
# Get THEME_POLYBAR from rofi
|
# Get theme_polybar from rofi
|
||||||
THEME_POLYBAR=$( (get_options_theme_polybar) | rofi -dmenu -i -fuzzy -p "" -theme "$DIR_THEME")
|
theme_polybar=$( (get_options_theme_polybar) | rofi -dmenu -i -fuzzy -p "" -theme "$dir_theme")
|
||||||
|
|
||||||
# If user has not picked anything, exit
|
# If user has not picked anything, exit
|
||||||
if [[ -z "${THEME_POLYBAR// /}" ]]; then
|
if [[ -z "${theme_polybar// /}" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cp -f $DIR/$THEME_POLYBAR/launch.sh ~/.config/polybar
|
cp -f $DIR/$theme_polybar/launch.sh ~/.config/polybar
|
||||||
|
|
||||||
# done
|
# done
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
+15
-15
@@ -1,31 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
DIR_ICONS="/usr/local/bin/icons"
|
dir_icons="/usr/local/bin/icons"
|
||||||
|
|
||||||
CUR_VOL=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
|
cur_vol=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
|
||||||
head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
|
head -n $(( "$SINK" + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
|
||||||
|
|
||||||
VOL_QUIET=33
|
vol_quiet=33
|
||||||
VOL_LOUD=66
|
vol_loud=66
|
||||||
|
|
||||||
if [ $CUR_VOL -le $VOL_QUIET ]; then
|
if [ "$cur_vol" -le "$vol_quiet" ]; then
|
||||||
dunstify -a "Volume" \
|
dunstify -a "Volume" \
|
||||||
"Volume" \
|
"Volume" \
|
||||||
"Current volume is $CUR_VOL%" \
|
"Current volume is $cur_vol%" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR_ICONS/volume.svg
|
-i $dir_icons/volume.svg
|
||||||
fi
|
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 "Volume" \
|
dunstify -a "Volume" \
|
||||||
"Volume" \
|
"Volume" \
|
||||||
"Current volume is $CUR_VOL%" \
|
"Current volume is $cur_vol%" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR_ICONS/volume-1.svg
|
-i $dir_icons/volume-1.svg
|
||||||
fi
|
fi
|
||||||
if [ $CUR_VOL -gt $VOL_LOUD ]; then
|
if [ "$cur_vol" -gt "$vol_loud" ]; then
|
||||||
dunstify -a "Volume" \
|
dunstify -a "Volume" \
|
||||||
"Volume" \
|
"Volume" \
|
||||||
"Current volume is $CUR_VOL%" \
|
"Current volume is $cur_vol%" \
|
||||||
-r 100 \
|
-r 100 \
|
||||||
-i $DIR_ICONS/volume-2.svg
|
-i $dir_icons/volume-2.svg
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user