Skip to content

Commit

Permalink
new config usign debian
Browse files Browse the repository at this point in the history
  • Loading branch information
shivanshu-semwal committed Jan 24, 2024
1 parent 366ceed commit 1e5296b
Show file tree
Hide file tree
Showing 44 changed files with 368 additions and 1,097 deletions.
20 changes: 10 additions & 10 deletions Scripts/basic/fix-resolution
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ DISPLAY2=$(xrandr -q | grep -oE "^eDP.* connected" | cut -d' ' -f1)

t=$(xrandr --listproviders | awk '/^Providers/ {print $4}')
if [ "$t" = "2" ]; then
echo "Setting multiple monitor setup."
if [ "$1" = "--other" ]; then
xrandr \
--output "$DISPLAY2" --mode 1920x1080 --pos 0x0 --rotate normal \
--output "$DISPLAY1" --mode 1920x1080 --pos 1920x0 --rotate normal
else
xrandr \
--output "$DISPLAY1" --mode 1920x1080 --pos 0x0 --rotate normal \
--output "$DISPLAY2" --mode 1920x1080 --pos 1920x0 --rotate normal
fi
echo "Setting multiple monitor setup."
if [ "$1" = "--other" ]; then
xrandr \
--output "$DISPLAY2" --mode 1920x1080 --pos 0x0 --rotate normal \
--output "$DISPLAY1" --mode 1920x1080 --pos 1920x0 --rotate normal
else
xrandr \
--output "$DISPLAY1" --mode 1920x1080 --pos 0x0 --rotate normal \
--output "$DISPLAY2" --mode 1920x1080 --pos 1920x0 --rotate normal
fi
fi
29 changes: 0 additions & 29 deletions Scripts/basic/gspeak

This file was deleted.

2 changes: 1 addition & 1 deletion Scripts/basic/microphone
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Use: Toggle the status of the default active mic source for pulseaudio
# Dependencies: pactl, dunstify
# Description:
# Description: mute, unmute active microphone
# Working:
# Author: Shivanshu

Expand Down
60 changes: 60 additions & 0 deletions Scripts/basic/set-theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

# Check if an argument is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <light|dark>"
exit 1
fi

# Get the argument
theme=$1

# Check if the argument is "light" or "dark" and perform actions accordingly
if [ "$theme" = "light" ]; then
echo "Setting light theme..."

# gtk
gsettings set org.gnome.desktop.interface color-scheme 'default'
gsettings set org.gnome.desktop.interface icon-theme 'ePapirus'

gnome-extensions enable [email protected]

# qt
cp "$HOME/.config/qt5ct/light.conf" "$HOME/.config/qt5ct/qt5ct.conf"

# terminal
alacritty-conf -c atom_one_light

# wallpaper using variety
variety --set-option icon Dark --set-option lightness_mode 1
variety --next

elif [ "$theme" = "dark" ]; then
echo "Setting dark theme..."

gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
gsettings set org.gnome.desktop.interface icon-theme 'ePapirus-Dark'

gnome-extensions disable [email protected]

# qt
cp "$HOME/.config/qt5ct/dark.conf" "$HOME/.config/qt5ct/qt5ct.conf"

# terminal
alacritty-conf -c alacritty_0_12

# wallpaper using variety
variety --set-option icon Light --set-option lightness_mode 0
variety --next

else
echo "Invalid argument. Usage: $0 <light|dark>"
exit 1
fi

echo "Theme customization complete."

# Help
#
# changing theme in gnome
# gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark'
3 changes: 3 additions & 0 deletions Scripts/basic/swap-esc-caps
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

setxkbmap -option "caps:swapescape"
2 changes: 1 addition & 1 deletion Scripts/basic/wallpaper
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

timer=$((60 * 1)) # 1 min in seconds

wallpaper_dir="$HOME/Pictures/Wallpapers/gruvbox/light"
wallpaper_dir="$HOME/Pictures/Wallpapers/gruvbox/dark"

while true; do
[ -f "$HOME/.wallpaper" ] && feh --bg-scale ~/.wallpaper
Expand Down
4 changes: 2 additions & 2 deletions Scripts/cp/cpinteract
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#Replace the first string with the path to runner.py!
cp ~/vimcp/Library/runner.py runner.py
# Replace the first string with the path to runner.py!
# cp ~/vimcp/Library/runner.py runner.py

for ((testNum = 0; testNum < $3; testNum++)); do
python3 runner.py \
Expand Down
9 changes: 9 additions & 0 deletions Scripts/dmenu/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
select_bg="#928374"
select_fg="#1d2021"
nselect_bg="#1d2021"
nselect_fg="#ebdbb2"
font="IosevkaTerm Nerd Font"
font_size="17"
x="960"
y="540"
DMENU="dmenu -i -l 20 -nb \"$nselect_bg\" -nf \"$nselect_fg\" -sb \"$select_bg\" -sf \"$select_fg\" -fn \"$font-$font_size\""
23 changes: 13 additions & 10 deletions Scripts/dmenu/dman
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/bin/bash
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'

CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

DMTERM="alacritty -e"
declare -a options=("Search manpages" "Random manpage")
choice=$(printf '%s\n' "${options[@]}" | eval "$DMENU -p 'Manpages:'")
case "$choice" in
'Search manpages')
man -k . | awk '{$3="-"; print $0}' |
eval "$DMENU -p 'Search for:'" |
awk '{print $2, $1}' | tr -d '()' | xargs $DMTERM man
;;
man -k . | awk '{$3="-"; print $0}' |
eval "$DMENU -p 'Search for:'" |
awk '{print $2, $1}' | tr -d '()' | xargs $DMTERM man
;;
'Random manpage')
man -k . | awk '{print $1}' | shuf -n 1 |
eval "$DMENU -p 'Random manpage:'" | xargs $DMTERM man
;;
man -k . | awk '{print $1}' | shuf -n 1 |
eval "$DMENU -p 'Random manpage:'" | xargs $DMTERM man
;;
*)
exit 1
;;
exit 1
;;
esac
11 changes: 7 additions & 4 deletions Scripts/dmenu/dmbooks
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'

CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

BOOK_DIR="/media/totoro/Data/eBooks/"
if [ ! -d $BOOK_DIR ]; then
echo "Drive not mounted. / Folder dosen't exists" | eval "$DMENU -p 'ERROR :-('"
echo "Drive not mounted. / Folder dosen't exists" | eval "$DMENU -p 'ERROR :-('"
else
var1=$(find $BOOK_DIR -type f -name "*.pdf" | sed "s+$BOOK_DIR++" | eval "$DMENU -p ''")
[ -n "$var1" ] && zathura "$BOOK_DIR/$var1" # open book
var1=$(find $BOOK_DIR -type f -name "*.pdf" | sed "s+$BOOK_DIR++" | eval "$DMENU -p ''")
[ -n "$var1" ] && zathura "$BOOK_DIR/$var1" # open book
fi
5 changes: 4 additions & 1 deletion Scripts/dmenu/dmcheat.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'

CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

SONG_DIR="/media/totoro/Data/Music/SoundTracks/"

LOCATION="/media/totoro/Data/eBooks/formal-science/computer-science/cheat-sheets"
Expand Down
5 changes: 4 additions & 1 deletion Scripts/dmenu/dmconf
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'

CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

# Defining the text editor to use.
DMEDITOR="code"
# function to check if an element is inside an array
Expand Down
5 changes: 3 additions & 2 deletions Scripts/dmenu/dmjobs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# Use: Shows saved bookmarks for Firefox Browser
# Dependencies: dmenu and ./src/bookmarks.py

# configuration
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'
CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

FILE="/media/totoro/Data/Documents/pnotes/notes/jobs/companies-list.md"
LINKS=""

Expand Down
27 changes: 15 additions & 12 deletions Scripts/dmenu/dmkill
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#!/bin/bash
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'

CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

selected="$(ps --user "$(id -u)" -F |
eval "$DMENU -p 'Search for process to kill:'" |
awk '{print $2" "$11}')"
eval "$DMENU -p 'Search for process to kill:'" |
awk '{print $2" "$11}')"
if [[ -n $selected ]]; then
answer="$(echo -e "No\nYes" | dmenu -i -p "Kill $selected?")"
if [[ $answer == "Yes" ]]; then
selpid="$(awk '{print $1}' <<<$selected)"
kill -9 "$selpid"
echo "Process $selected has been killed." && exit 1
fi
if [[ $answer == "No" ]]; then
echo "Program terminated." && exit 1
fi
answer="$(echo -e "No\nYes" | dmenu -i -p "Kill $selected?")"
if [[ $answer == "Yes" ]]; then
selpid="$(awk '{print $1}' <<<$selected)"
kill -9 "$selpid"
echo "Process $selected has been killed." && exit 1
fi
if [[ $answer == "No" ]]; then
echo "Program terminated." && exit 1
fi
fi
exit 0
5 changes: 3 additions & 2 deletions Scripts/dmenu/dmlinks
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# Use: Shows saved bookmarks for Firefox Browser
# Dependencies: dmenu and ./src/bookmarks.py

# configuration
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'
CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

FILE="/media/totoro/Data/Documents/notes/links.md"
LINKS=""
COUNT=0
Expand Down
19 changes: 11 additions & 8 deletions Scripts/dmenu/dmplay
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/bin/bash
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'
SONG_DIR="/media/totoro/Data/Music/SoundTracks/"

CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

SONG_DIR="$HOME/Data/Music/"
if [ ! -d $SONG_DIR ]; then
echo "Drive not mounted. / Folder dosen't exists" | eval "$DMENU -p 'ERROR :-('"
exit 1
echo "Drive not mounted. / Folder dosen't exists" | eval "$DMENU -p 'ERROR :-('"
exit 1
fi

if [ $# -ne 0 ]; then
var1=$(find $SONG_DIR -type f -name "*" | shuf | sed "s+$SONG_DIR++" | head -1)
var1=$(find $SONG_DIR -type f -name "*" | shuf | sed "s+$SONG_DIR++" | head -1)
else
random_song=$(find $SONG_DIR -type f -name "*" | shuf | sed "s+$SONG_DIR++" | head -1)
var1=$(find $SONG_DIR -type f -name "*")
var1=$(echo -e "$random_song\n$var1" | sed "s+$SONG_DIR++" | eval "$DMENU -p ' '")
random_song=$(find $SONG_DIR -type f -name "*" | shuf | sed "s+$SONG_DIR++" | head -1)
var1=$(find $SONG_DIR -type f -name "*")
var1=$(echo -e "$random_song\n$var1" | sed "s+$SONG_DIR++" | eval "$DMENU -p ' '")
fi
[ -n "$var1" ] && audacious "$SONG_DIR/$var1"
4 changes: 3 additions & 1 deletion Scripts/dmenu/dmprojects
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'

CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

CODE="/media/totoro/Data/Programming"
NOTES="/media/totoro/Data/Documents"
Expand Down
11 changes: 7 additions & 4 deletions Scripts/dmenu/dmrecent
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash
[ -f "$HOME/.dmenurc" ] && . $HOME/.dmenurc || DMENU='dmenu -i'

CONFIG="$HOME/Scripts/dmenu/config"
[ -f "$CONFIG" ] && . $CONFIG || DMENU='dmenu -i'

RECENT_DIR="$HOME/.local/share/RecentDocuments"
if [ ! -d $RECENT_DIR ]; then
echo "Drive not mounted. / Folder dosen't exists" | eval "$DMENU -p 'ERROR :-('"
echo "Drive not mounted. / Folder dosen't exists" | eval "$DMENU -p 'ERROR :-('"
else
var1=$(ls -1 $RECENT_DIR | eval "$DMENU -p ' '")
[ -n "$var1" ] && kioclient5 exec "$RECENT_DIR/$var1" # open book
var1=$(ls -1 $RECENT_DIR | eval "$DMENU -p ' '")
[ -n "$var1" ] && kioclient5 exec "$RECENT_DIR/$var1" # open book
fi
6 changes: 6 additions & 0 deletions Scripts/i3/i3lock/__post_i3lock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

dunstctl set-paused false

sleep 1
exit
4 changes: 4 additions & 0 deletions Scripts/i3/i3lock/__pre_i3lock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

# Set the paused status of dunst
dunstctl set-paused true
Loading

0 comments on commit 1e5296b

Please sign in to comment.