diff --git a/README.md b/README.md index 22ef0a5..e432af8 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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 @@ -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 @@ -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). 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 @@ -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) * [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. \ No newline at end of file diff --git a/config/i3/config b/config/i3/config index 162dbf7..04d1557 100644 --- a/config/i3/config +++ b/config/i3/config @@ -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 diff --git a/config/vsc/settings.json b/config/vsc/settings.json index c9a7e01..5626cae 100644 --- a/config/vsc/settings.json +++ b/config/vsc/settings.json @@ -6,6 +6,7 @@ "oneDarkPro.markdownStyle": false, "workbench.colorCustomizations": { "[One Dark Pro Darker]": { + "terminal.background": "#21222c", "sideBar.background": "#21222c", "focusBorder": "#343746", "activityBar.background": "#282A36", diff --git a/scripts/battery b/scripts/battery index 22481c3..f18c274 100755 --- a/scripts/battery +++ b/scripts/battery @@ -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 \ No newline at end of file diff --git a/scripts/brightness b/scripts/brightness index ae04b29..d82e32c 100755 --- a/scripts/brightness +++ b/scripts/brightness @@ -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 \ No newline at end of file diff --git a/scripts/mute b/scripts/mute index a5e7698..21d5a4b 100755 --- a/scripts/mute +++ b/scripts/mute @@ -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" \ No newline at end of file diff --git a/scripts/pacman-clear b/scripts/pacman-clear index 9ef5d51..7f5f936 100755 --- a/scripts/pacman-clear +++ b/scripts/pacman-clear @@ -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/ diff --git a/scripts/rofi-screenshot b/scripts/rofi-screenshot index 843aab6..1ade66b 100755 --- a/scripts/rofi-screenshot +++ b/scripts/rofi-screenshot @@ -1,73 +1,73 @@ #!/usr/bin/env bash # rofi theme -THEME="$HOME/.config/rofi/compact_without_icons.rasi" +theme="$HOME/.config/rofi/compact_without_icons.rasi" get_options() { - echo " Capture Region" - echo " Capture Region (without saving)" - echo " Capture Screen" - echo " Capture Screen (without saving)" - echo " Record Region (GIF)" - echo " Record Screen (GIF)" - echo " Record Region (MP4)" - echo " Record Screen (MP4)" - #echo " Record Region (MP4+audio_virt)" - #echo " Record Region (MP4+audio_mic)" - #echo " Record Audio virt" - #echo " Record Audio mic" - echo " Stop Recording" + echo " Capture Region" + echo " Capture Region (without saving)" + echo " Capture Screen" + echo " Capture Screen (without saving)" + echo " Record Region (GIF)" + echo " Record Screen (GIF)" + echo " Record Region (MP4)" + echo " Record Screen (MP4)" + #echo " Record Region (MP4+audio_virt)" + #echo " Record Region (MP4+audio_mic)" + #echo " Record Audio virt" + #echo " Record Audio mic" + echo " Stop Recording" } main() { - # Get choice from rofi - CHOICE=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$THEME") + # get choice from rofi + choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "" -theme "$theme") - # If user has not picked anything, exit - if [[ -z "${CHOICE// /}" ]]; then + # if user has not picked anything, exit + if [[ -z "${choice// /}" ]]; then exit 1 fi # run the selected command - case $CHOICE in - ' Capture Region (without saving)') + case $choice in + ' Capture Region (without saving)') screenshot -crtc ;; - ' Capture Region') + ' Capture Region') screenshot -crtf ;; - ' Capture Screen (without saving)') + ' Capture Screen (without saving)') screenshot -cstc ;; - ' Capture Screen') + ' Capture Screen') screenshot -cstf ;; - ' Record Region (GIF)') + ' Record Region (GIF)') screenshot -rrg ;; - ' Record Screen (GIF)') + ' Record Screen (GIF)') screenshot -rsg ;; - ' Record Region (MP4)') + ' Record Region (MP4)') screenshot -rrv ;; - ' Record Screen (MP4)') + ' Record Screen (MP4)') screenshot -rsv ;; - ' Record Region (MP4+audio_virt)') + ' Record Region (MP4+audio_virt)') screenshot -rrav ;; - ' Record Region (MP4+audio_mic)') + ' Record Region (MP4+audio_mic)') screenshot -rrmv ;; - ' Record Audio virt') + ' Record Audio virt') screenshot -rav ;; - ' Record Audio mic') + ' Record Audio mic') screenshot -ram ;; - ' Stop Recording') + ' Stop Recording') screenshot -s ;; esac diff --git a/scripts/screenshot b/scripts/screenshot index 2a1426d..8cec9c0 100755 --- a/scripts/screenshot +++ b/scripts/screenshot @@ -1,9 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -# Screenshot directory -SCREENSHOT_DIRECTORY="$HOME/Pictures/screenshots" -VIDEOS_DIRECTORY="$HOME/Videos" -AUDIO_DIRECTORY="$HOME/Music" +# screenshot directory +screenshot_directory="$HOME/Pictures/screenshots" +videos_directory="$HOME/Videos" +audio_directory="$HOME/Music" # set ffmpeg defaults ffmpeg() { @@ -27,7 +27,7 @@ countdown() { # capture region to clipboard crtc() { 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 rm /tmp/screenshot_clip.png notify-send "Screenshot" "Region copied to Clipboard" @@ -36,10 +36,10 @@ crtc() { # capture region to file and clipboard crtf() { notify-send "Screenshot" "Select a region to capture" - DT=$(date '+%d-%m-%Y %H:%M:%S') - ffcast -q $(slop -n -f '-g %g ') png "$SCREENSHOT_DIRECTORY/$DT.png" - xclip -selection clipboard -t image/png "$SCREENSHOT_DIRECTORY/$DT.png" - notify-send "Screenshot" "Region saved to $SCREENSHOT_DIRECTORY" + dt=$(date '+%d-%m-%Y %H:%M:%S') + ffcast -q "$(slop -n -f '-g %g ')" png "$screenshot_directory/$dt.png" + xclip -selection clipboard -t image/png "$screenshot_directory/$dt.png" + notify-send "Screenshot" "Region saved to $screenshot_directory" } # capture screenshot to clipboard @@ -52,96 +52,96 @@ cstc() { # capture screenshot to file and clipboard cstf() { - DT=$(date '+%d-%m-%Y %H:%M:%S') - ffcast -q png "$SCREENSHOT_DIRECTORY/$DT.png" - xclip -selection clipboard -t image/png "$SCREENSHOT_DIRECTORY/$DT.png" - notify-send "Screenshot" "Screenshot saved to $SCREENSHOT_DIRECTORY" + dt=$(date '+%d-%m-%Y %H:%M:%S') + ffcast -q png "$screenshot_directory/$dt.png" + xclip -selection clipboard -t image/png "$screenshot_directory/$dt.png" + notify-send "Screenshot" "Screenshot saved to $screenshot_directory" } # record region (GIF) rrg() { notify-send "Screenshot" "Select a region to record" - DT=$(date '+%d-%m-%Y %H:%M:%S') - ffcast -q $(slop -n -f '-g %g ' && countdown) rec /tmp/screenshot_gif.mp4 + dt=$(date '+%d-%m-%Y %H:%M:%S') + ffcast -q "$(slop -n -f '-g %g ' && countdown)" rec /tmp/screenshot_gif.mp4 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 - notify-send "Screenshot" "Recording saved to $SCREENSHOT_DIRECTORY" + notify-send "Screenshot" "Recording saved to $screenshot_directory" } # record screen (GIF) rsg() { countdown - DT=$(date '+%d-%m-%Y %H:%M:%S') + dt=$(date '+%d-%m-%Y %H:%M:%S') ffcast -q rec /tmp/screenshot_gif.mp4 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 - notify-send "Screenshot" "Recording saved to $SCREENSHOT_DIRECTORY" + notify-send "Screenshot" "Recording saved to $screenshot_directory" } # record region (mp4) rrv() { notify-send "Screenshot" "Select a region to record" - DT=$(date '+%d-%m-%Y %H:%M:%S') - ffcast -q $(slop -n -f '-g %g ' && countdown) rec "$VIDEOS_DIRECTORY/$DT.mp4" - notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY" + dt=$(date '+%d-%m-%Y %H:%M:%S') + ffcast -q "$(slop -n -f '-g %g ' && countdown)" rec "$videos_directory/$dt.mp4" + notify-send "Screenshot" "Recording saved to $videos_directory" } # record screen (mp4) rsv() { countdown - DT=$(date '+%d-%m-%Y %H:%M:%S') - ffcast -q rec "$VIDEOS_DIRECTORY/$DT.mp4" - notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY" + dt=$(date '+%d-%m-%Y %H:%M:%S') + ffcast -q rec "$videos_directory/$dt.mp4" + notify-send "Screenshot" "Recording saved to $videos_directory" } # record screen (mp4) with audio virt rrav() { notify-send "Screenshot" "Select a region to record" - DT=$(date '+%d-%m-%Y %H:%M:%S') - ffcast -q $(slop -n -f '-g %g ' && countdown) ffmpeg \ + dt=$(date '+%d-%m-%Y %H:%M:%S') + ffcast -q "$(slop -n -f '-g %g ' && countdown)" ffmpeg \ -hide_banner \ -loglevel error \ -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" - notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY" + -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" } # record screen (mp4) with mic audio rrmv() { notify-send "Screenshot" "Select a region to record" - DT=$(date '+%d-%m-%Y %H:%M:%S') - ffcast -q $(slop -n -f '-g %g ' && countdown) ffmpeg \ + dt=$(date '+%d-%m-%Y %H:%M:%S') + ffcast -q "$(slop -n -f '-g %g ' && countdown)" ffmpeg \ -hide_banner \ -loglevel error \ -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" - notify-send "Screenshot" "Recording saved to $VIDEOS_DIRECTORY" + -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" } # record audio virt rav() { 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' \ -loglevel error \ - -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 + -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 } # record audio mic ram() { 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' \ -loglevel error \ - -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 + -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 } check_deps() { - if ! hash $1 2>/dev/null; then + if ! hash "$1" 2>/dev/null; then echo "Error: This script requires $1" exit 1 fi @@ -249,5 +249,5 @@ main() { } # running the program -main $1 & +main "$1" & exit 0 diff --git a/scripts/theme b/scripts/theme index b7ce983..33088cb 100755 --- a/scripts/theme +++ b/scripts/theme @@ -1,7 +1,7 @@ #!/usr/bin/env bash # 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" @@ -12,14 +12,14 @@ get_options_theme_polybar() { main() { - # Get THEME_POLYBAR from rofi - THEME_POLYBAR=$( (get_options_theme_polybar) | rofi -dmenu -i -fuzzy -p "" -theme "$DIR_THEME") + # Get theme_polybar from rofi + theme_polybar=$( (get_options_theme_polybar) | rofi -dmenu -i -fuzzy -p "" -theme "$dir_theme") # If user has not picked anything, exit - if [[ -z "${THEME_POLYBAR// /}" ]]; then + if [[ -z "${theme_polybar// /}" ]]; then exit 1 fi - cp -f $DIR/$THEME_POLYBAR/launch.sh ~/.config/polybar + cp -f $DIR/$theme_polybar/launch.sh ~/.config/polybar # done set -e diff --git a/scripts/volume b/scripts/volume index 25b8079..394ed8c 100755 --- a/scripts/volume +++ b/scripts/volume @@ -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:' | \ - head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,') +cur_vol=$(pactl list sinks | grep '^[[:space:]]Volume:' | \ + head -n $(( "$SINK" + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,') -VOL_QUIET=33 -VOL_LOUD=66 +vol_quiet=33 +vol_loud=66 -if [ $CUR_VOL -le $VOL_QUIET ]; then +if [ "$cur_vol" -le "$vol_quiet" ]; then dunstify -a "Volume" \ "Volume" \ - "Current volume is $CUR_VOL%" \ + "Current volume is $cur_vol%" \ -r 100 \ - -i $DIR_ICONS/volume.svg + -i $dir_icons/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 "Volume" \ "Volume" \ - "Current volume is $CUR_VOL%" \ + "Current volume is $cur_vol%" \ -r 100 \ - -i $DIR_ICONS/volume-1.svg + -i $dir_icons/volume-1.svg fi -if [ $CUR_VOL -gt $VOL_LOUD ]; then +if [ "$cur_vol" -gt "$vol_loud" ]; then dunstify -a "Volume" \ "Volume" \ - "Current volume is $CUR_VOL%" \ + "Current volume is $cur_vol%" \ -r 100 \ - -i $DIR_ICONS/volume-2.svg + -i $dir_icons/volume-2.svg fi \ No newline at end of file