This commit is contained in:
Clay Gomera 2023-10-03 10:40:20 -04:00
parent e8b31ea3d4
commit 8ea5a726bf
12 changed files with 490 additions and 441 deletions

View file

@ -16,13 +16,19 @@ fi
# environment variables # environment variables
export EDITOR="~/.local/bin/lvim" export EDITOR="~/.local/bin/lvim"
export VISUAL="neovide --neovim-bin ~/.local/bin/lvim" export VISUAL="neovide --neovim-bin ~/.local/bin/lvim"
export MEDIA_DIR="$HOME/Media"
export TEMP_DIR="$HOME/Temporal"
# clean home # clean home
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DESKTOP_DIR="$HOME/Desktop"
export XDG_DOWNLOAD_DIR="$HOME/Downloads"
export XDG_TEMPLATES_DIR="$HOME/Templates"
export XDG_PUBLICSHARE_DIR="$HOME/Public"
export XDG_DOCUMENTS_DIR="$HOME/Documents"
export XDG_MUSIC_DIR="$HOME/Music"
export XDG_PICTURES_DIR="$HOME/Pictures"
export XDG_VIDEOS_DIR="$HOME/Videos"
export W3M_DIR="$XDG_DATA_HOME/w3m" export W3M_DIR="$XDG_DATA_HOME/w3m"
export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0" export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0"
export INPUTRC="$HOME/.config/inputrc" export INPUTRC="$HOME/.config/inputrc"

View file

@ -5,7 +5,7 @@
# - Dependencies: dmenu, power-profiles-daemon, slock # - Dependencies: dmenu, power-profiles-daemon, slock
####################### #######################
## Main menu options ## ## Main manu options ##
####################### #######################
option1=" Logout" option1=" Logout"
option2=" Reboot" option2=" Reboot"
@ -13,18 +13,23 @@ option3=" Power off"
option4="󰒲 Suspend" option4="󰒲 Suspend"
option5=" Lock" option5=" Lock"
option6=" Change power profile" option6=" Change power profile"
option7=" Cancel" option7="󱎘 Exit"
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7" options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
############################ ####################################
## Power profiles submenu ## ## Power profiles submenu options ##
############################ ####################################
pwr1="󰓅 Performance" pwr1="󰓅 Performance"
pwr2="󰾅 Balanced" pwr2="󰾅 Balanced"
pwr3="󰾆 Power Saver" pwr3="󰾆 Power Saver"
pwr4=" Cancel" pwr4=" Cancel"
pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4" pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4"
#####
## This variable will store the current power profile
#####
currentpwr=$(powerprofilesctl get)
########## ##########
## main ## ## main ##
########## ##########
@ -46,29 +51,45 @@ case "$action" in
slock; slock;
;; ;;
"$option6") "$option6")
currentpwr=$(powerprofilesctl get); # this variable will store the current power profile #####
if [ "$currentpwr" = "performance" ]; then # this if statement is used for the power profiles prompt ## These conditions will be used for the prompt
currentpwr="$pwr1" #####
if [ "$currentpwr" = "performance" ]; then
currentpwr="$pwr1";
elif [ "$currentpwr" = "balanced" ]; then elif [ "$currentpwr" = "balanced" ]; then
currentpwr="$pwr2" currentpwr="$pwr2";
elif [ "$currentpwr" = "power-saver" ]; then elif [ "$currentpwr" = "power-saver" ]; then
currentpwr="$pwr3" currentpwr="$pwr3";
fi fi
pwraction=$(echo -e "$pwrs" | dmenu -i -p " Power Profile Menu - Currently set to: ${currentpwr}"); # power profiles submenu prompt pwraction=$(echo -e "$pwrs" | dmenu -l 6 -i -p " Power Profile Menu - Currently set to: $currentpwr") # power profiles submenu prompt
case "$pwraction" in case "$pwraction" in
"$pwr1") "$pwr1")
powerprofilesctl set performance && notify-send "Power profile switched to performance"; if [ "$currentpwr" = "$pwr1" ]; then # if the power profile is already set to performance
notify-send "The power profile is already set to performance";
exit 1;
else
powerprofilesctl set performance && notify-send "Power profile switched to performance"; # if not, set the powerprofile to performance
fi
;; ;;
"$pwr2") "$pwr2")
powerprofilesctl set balanced && notify-send "Power profile switched to balanced"; if [ "$currentpwr" = "$pwr2" ]; then # if the power profile is already set to balanced
notify-send "The power profile is already set to balanced";
exit 1;
else
powerprofilesctl set balanced && notify-send "Power profile switched to balanced"; # if not, set the powerprofile to balanced
fi
;; ;;
"$pwr3") "$pwr3")
powerprofilesctl set power-saver && notify-send "Power profile switched to power saver"; if [ "$currentpwr" = "$pwr3" ]; then # if the power profile is already set to power saver
notify-send "The power profile is already set to power saver";
exit 1;
else
powerprofilesctl set power-saver && notify-send "Power profile switched to power saver"; # if not, set the powerprofile to power saver
fi
;; ;;
"$pwr4") "$pwr4")
exit 0 exit 0;
esac esac;;
;;
"$option7") "$option7")
exit 0 exit 0;
esac esac

View file

@ -7,15 +7,23 @@
########################### ###########################
## Screenshots Directory ## ## Screenshots Directory ##
########################### ###########################
SHOTDIR="$MEDIA_DIR/Pictures/Screenshots" # $MEDIA_DIR reffers to a global variable in .xinitrc/.bash_profile SHOTDIR="$XDG_PICTURES_DIR/screenshots"
mkdir -p "$SHOTDIR" mkdir -p "$SHOTDIR"
###########################
## Screencasts Directory ##
###########################
CASTDIR="$XDG_VIDEOS_DIR/screencasts"
mkdir -p "$CASTDIR"
####################### #######################
## Main menu choices ## ## Main menu choices ##
####################### #######################
mcho1="󰹑 Take an screenshot" mcho1="󰹑 Take a screenshot"
mcho2="󰻃 Record the screen" mcho2="󰐍 Record the screen"
mchos="$mcho1\n$mcho2" mcho3="󰙧 Stop recording"
mcho4="󱎘 Exit"
mchos="$mcho1\n$mcho2\n$mcho3\n$mcho4"
############################# #############################
## Screenshot menu choices ## ## Screenshot menu choices ##
@ -31,7 +39,7 @@ schos="$scho1\n$scho2\n$scho3\n$scho4\n$scho5"
## Screenshot submenu ## ## Screenshot submenu ##
######################## ########################
sscho1="󰆏 Copy to clipboard" sscho1="󰆏 Copy to clipboard"
sscho2="󰠘 Save to ~/Media/Pictures/Screenshots" sscho2="󰠘 Save to $SHOTDIR"
sschos="$sscho1\n$sscho2" sschos="$sscho1\n$sscho2"
################################# #################################
@ -43,38 +51,25 @@ del3="󱑇 10 sec delay"
dels="$del1\n$del2\n$del3" dels="$del1\n$del2\n$del3"
##### #####
## This function uses the sschos variable ## This function uses the sschos variable to ask the user what to do with the
## to ask the user what to do with the
## screenshot ## screenshot
##### #####
## param: none
## return: string
#####
fsschos() { fsschos() {
sschoice=$(echo -e "$sschos" | dmenu -i -l 2 -p " What do you want to do with this screenshot?") sschoice=$(echo -e "$sschos" | dmenu -i -l 2 -p " What do you want to do with this screenshot?")
} }
##### #####
## This function uses the dels variable ## This function uses the dels variable to ask the user which delay option to
## to ask the user which delay option to
## choose ## choose
##### #####
## param: none
## return: string
#####
fdel() { fdel() {
del=$(echo -e "$dels" | dmenu -i -p " Select Delay") del=$(echo -e "$dels" | dmenu -i -p " Select Delay")
} }
##### #####
## This function does a full screen ## This function does a full screen screenshot without delay, depending on what
## screenshot without delay, depending on ## the user chooses on the fsschos function, the screenshot will be saved to the
## what the user chooses on the fsschos ## clipboard or to $SHOTDIR
## function, the screenshot will be saved
## to the clipboard or to $SHOTDIR
#####
## param: none
## return: void
##### #####
shot_screen() { shot_screen() {
fsschos fsschos
@ -88,17 +83,10 @@ shot_screen() {
} }
##### #####
## This function does a full screen ## This function does a full screen screenshot with delay, depending on what the
## screenshot with delay, depending on ## user chooses on the fsschos function, the screenshot will be saved to the
## what the user chooses on the fsschos ## clipboard or to $SHOTDIR. And depending on what the user chooses on the fdel
## function, the screenshot will be saved ## function, the delay will be between 3 and 10 seconds
## to the clipboard or to $SHOTDIR. And
## depending on what the user chooses on
## the fdel function, the delay will be
## between 3 and 10 seconds
#####
## param: none
## return: void
##### #####
shot_screen_delay() { shot_screen_delay() {
fsschos; fsschos;
@ -118,13 +106,13 @@ shot_screen_delay() {
fdel; fdel;
case $del in case $del in
"$del1") "$del1")
sleep 3 && maim -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to ~/Media/Pictures/Screenshots/"; sleep 3 && maim -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to $SHOTDIR";
;; ;;
"$del2") "$del2")
sleep 5 && maim -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to ~/Media/Pictures/Screenshots/"; sleep 5 && maim -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to $SHOTDIR";
;; ;;
"$del3") "$del3")
sleep 10 && maim -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to ~/Media/Pictures/Screenshots/"; sleep 10 && maim -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to $SHOTDIR";
esac esac
else else
exit 0 exit 0
@ -132,55 +120,75 @@ shot_screen_delay() {
} }
##### #####
## This function allows the user to select ## This function allows the user to select the area on the screen to screenshot
## the area on screen to screenshot ## depending on what the user chooses on the fsschos function, the screenshot will
## depending on what the user chooses on ## be saved to the clipboard or to $SHOTDIR
## the fsschos function, the screenshot
## will be saved to the clipboard or to
## $SHOTDIR
#####
## param: none
## return: void
##### #####
shot_area() { shot_area() {
fsschos; fsschos;
if [ "$sschoice" = "$sscho1" ]; then if [ "$sschoice" = "$sscho1" ]; then
maim -s | xclip -selection clipboard -t image/png && notify-send "Screenshot saved to clipboard"; maim -s | xclip -selection clipboard -t image/png && notify-send "Screenshot saved to clipboard";
elif [ "$sschoice" = "$sscho2" ]; then elif [ "$sschoice" = "$sscho2" ]; then
maim -s -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to ~/Media/Pictures/Screenshots/"; maim -s -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to $SHOTDIR";
else else
exit 0 exit 0
fi fi
} }
##### #####
## This function does an screnshot of the ## This function does a screenshot of the currently active window, depending
## currently active window, depending on ## on what the user chooses on the fsschos function, the screenshot will be
## what the user chooses on the fsschos ## saved to the clipboard or to $SHOTDIR
## function, the screenshot will be saved
## to the clipboard or to $SHOTDIR
#####
## param: none
## return: void
##### #####
shot_window() { shot_window() {
fsschos; fsschos;
if [ "$sschoice" = "$sscho1" ]; then if [ "$sschoice" = "$sscho1" ]; then
maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png && notify-send "Screenshot saved to clipboard"; maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png && notify-send "Screenshot saved to clipboard";
elif [ "$sschoice" = "$sscho2" ]; then elif [ "$sschoice" = "$sscho2" ]; then
maim -i "$(xdotool getactivewindow)" -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to ~/Media/Pictures/Screenshots/"; maim -i "$(xdotool getactivewindow)" -f jpg "$SHOTDIR/$(date +%s).jpg" && notify-send "Screenshot saved to $SHOTDIR";
else else
exit 0 exit 0
fi fi
} }
#####
## This function uses ffmpeg to record the screen, It will check if ffmpeg is
## already running (already recording), to prevent the user from executing
## another ffmpeg instance, if it's not running, it will grab the screen
## resolution with xdpyinfo and use it to record the screen with ffmpeg.
#####
start_recording() {
if pgrep -x "ffmpeg" > /dev/null; then
notify-send "A screen recording is already in progress."
else
filename="$CASTDIR/$(date +%s).mp4"
resolution="$(xdpyinfo | grep dimensions | awk '{print $2}')"
ffmpeg -f x11grab -s "$resolution" -i :0.0 -c:v libx264 -preset ultrafast -qp 0 "$filename" &
notify-send "Screen recording started."
fi
}
#####
## This function stops screen recording, it first checks if ffmpeg is already
## running (already recording), to only stop a recording if there's an ffmpeg
## instance running
#####
stop_recording() {
if pgrep -x "ffmpeg" > /dev/null; then
pkill -f "ffmpeg -f x11grab"
notify-send "Screen recording stopped. Video saved to $CASTDIR"
else
notify-send "You aren't recording anything at the moment"
fi
}
########## ##########
## main ## ## main ##
########## ##########
mchoice=$(echo -e "$mchos" | dmenu -i -l 2 -p " Screen Capture Menu") # main menu prompt mchoice=$(echo -e "$mchos" | dmenu -i -l 4 -p " Screen Capture Menu") # main menu prompt
case $mchoice in case $mchoice in
"$mcho1") "$mcho1")
schoice=$(echo -e "$schos" | dmenu -i -l 9 -p " Sreenshot Menu") # screenshot menu prompt schoice=$(echo -e "$schos" | dmenu -i -l 9 -p " Screenshot Menu") # screenshot menu prompt
case $schoice in case $schoice in
"$scho1") "$scho1")
shot_screen; shot_screen;
@ -199,8 +207,12 @@ case $mchoice in
esac esac
;; ;;
"$mcho2") "$mcho2")
# TODO Implement screencast functionality with ffmpeg start_recording;
notify-send "Bro you need to implement screen recording with ffmpeg" ;;
exit 0 "$mcho3")
stop_recording;
;;
"$mcho4")
exit 0;
;; ;;
esac esac

View file

@ -7,7 +7,7 @@
########################## ##########################
## Wallpapers Directory ## ## Wallpapers Directory ##
########################## ##########################
walldir="$MEDIA_DIR/Pictures/Wallpapers" # $MEDIA_DIR reffers to a global variable in .xinitrc/.bash_profile walldir="$XDG_PICTURES_DIR/wallpapers"
cd "$walldir" || exit # we cd into $walldir in order to get only the file name on the main prompt cd "$walldir" || exit # we cd into $walldir in order to get only the file name on the main prompt
####################### #######################

View file

@ -12,14 +12,16 @@ option2=" Turn off WiFi"
option3="󱛅 Disconnect WiFi" option3="󱛅 Disconnect WiFi"
option4="󱛃 Connect WiFi" option4="󱛃 Connect WiFi"
option5="󱛆 Setup captive portal" option5="󱛆 Setup captive portal"
option6=" Exit" option6="󱎘 Exit"
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6" options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6"
##### #####
## This variable will grab the wireless ## These variables will store specific
## interface name ## information about the wireless
## interface
##### #####
wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1) wifi_info=$(nmcli dev | awk '/wifi/ {print $1,$3; exit}')
read -r wlan constate <<< "$wifi_info"
##### #####
## This function uses nmcli to turn ## This function uses nmcli to turn
@ -30,8 +32,7 @@ wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1)
## return: void ## return: void
##### #####
turnoff() { turnoff() {
nmcli radio wifi off nmcli radio wifi off && notify-send "WiFi has been turned off";
notify-send "WiFi has been turned off"
} }
##### #####
@ -43,22 +44,26 @@ turnoff() {
## return: void ## return: void
##### #####
turnon() { turnon() {
nmcli radio wifi on nmcli radio wifi on && notify-send "WiFi has been turned on";
notify-send "WiFi has been turned on"
} }
##### #####
## This function uses nmcli and the ## This function uses nmcli and the
## $wlan variable to disconnect ## $wlan and $constate variables to
## from the wifi network and ## disconnect from the wifi network
## then sends a notification ## and then sends a notification
##### #####
## param: none ## param: none
## return: void ## return: void
##### #####
disconnect() { disconnect() {
nmcli device disconnect "$wlan" if [ "$constate" = "disconnected" ]; then
notify-send "WiFi has been disconnected" notify-send "WiFi is already disconnected";
elif [ "$constate" = "connected" ]; then
nmcli device disconnect "$wlan" && notify-send "Wifi has been disconnected";
else
exit 1;
fi
} }
##### #####
@ -71,10 +76,10 @@ disconnect() {
## return: string ## return: string
##### #####
connect() { connect() {
notify-send "Scannig WiFi networks, please wait" notify-send "Scannig networks..." && nmcli dev wifi rescan;
nmcli dev wifi rescan wifinet=$(nmcli -f BSSID,SSID,BARS,SECURITY dev wifi list | sed -n '1!p' | dmenu -i -l 10 -p " Select a Wifi Network");
sleep 1 bssid=$(echo "$wifinet" | cut -d' ' -f1)
bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -i -l 10 -p "Select a Wifi Network  " | cut -d' ' -f1) ssid=$(echo "$wifinet" | cut -d' ' -f3)
} }
##### #####
@ -85,11 +90,18 @@ connect() {
## return: string ## return: string
##### #####
password() { password() {
# TODO Create a condition to check if the chosen network is open or not, that if nmcli connection show | grep -q "$ssid"; then # check if the network is already saved
# way this will be skipped of it's open return 0; # no password is required
# TODO What if the network is already saved? The user doesn't need to type the elif nmcli -f BSSID,SECURITY dev wifi list | sed -n '1!p' | grep "$bssid" | awk '{print $2}' | grep -q -- "--"; then # check if the network is open
# password again return 0; # no password is required
pass=$(echo " " | dmenu -P -i -p "Enter Password ") else
pass=$(dmenu -i -l 1 -P -p "Enter Password " --password);
if [ -n "$pass" ]; then # if the user gave a password
return 0;
else
exit 1; # if not, exit the script
fi
fi
} }
##### #####
@ -101,28 +113,10 @@ password() {
## return: void ## return: void
##### #####
action() { action() {
# TODO Create a condition to check if the chosen network is open or not (check if [ -n "$pass" ]; then # we need to check again if the $pass variable exists
# password funcion) nmcli dev wifi connect "$bssid" password "$pass"
# TODO What if the network is already saved? The user doesn't need to type the else # if not, that means that the password() function ended in one of the first two conditions, the network is saved or open
# password again nmcli dev wifi connect "$bssid";
nmcli device wifi connect "$bssid" password "$pass" || nmcli device wifi connect "$bssid"
}
#####
## This function will check if the
## connection works
#####
## param: none
## return: void
#####
check() {
notify-send "Checking if connection was successful"
sleep 1
currentwfi=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f4 | head -1)
if ping -q -c 2 -W 2 google.com >/dev/null; then
notify-send "You are now connected to $currentwfi and internet is working properly"
else
notify-send "Your internet is not working :("
fi fi
} }
@ -132,23 +126,25 @@ check() {
cases=$(echo -e "$options" | dmenu -l 6 -i -p " Wifi Settings" ) # main menu prompt cases=$(echo -e "$options" | dmenu -l 6 -i -p " Wifi Settings" ) # main menu prompt
case "$cases" in case "$cases" in
"$option1") "$option1")
turnon;; turnon;
;;
"$option2") "$option2")
turnoff;; turnoff;
;;
"$option3") "$option3")
disconnect;; disconnect;
;;
"$option4") "$option4")
connect; if connect; then # if the user chooses a network
if [ -n "$bssid" ]; then # if the user chooses a network password; # this function will exit the script if the user didn't put a password
password;
action; action;
sleep 5;
check;
else else
exit 0; # if not, exit the script exit 1; # if not, exit the script
fi;; fi
;;
"$option5") "$option5")
"$BROWSER" http://networkcheck.kde.org;; # $BROWSER reffers to a global variable set in .xinitrc/.bash_profile io.elementary.capnet-assist;
;;
"$option6") "$option6")
exit 0; exit 0;
esac esac

View file

@ -1,10 +1,13 @@
/* appearance */ #include "tcl.c"
static const unsigned int borderpx = 1; /* border pixel of windows */ #include "movestack.c"
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */ // Appearance
static const int topbar = 1; /* 0 means bottom bar */ static const unsigned int borderpx = 1; // border pixel of windows
static const int horizpadbar = 2; /* horizontal padding for statusbar */ static const unsigned int snap = 32; // snap pixel
static const int vertpadbar = 4; /* vertical padding for statusbar */ static const int showbar = 1; // 0 means no bar
static const int topbar = 1; // 0 means bottom bar
static const int horizpadbar = 2; // horizontal padding for statusbar
static const int vertpadbar = 4; // vertical padding for statusbar
static const char *fonts[] = {"Symbols Nerd Font Mono:size=12", "mononoki Nerd Font:size=12"}; static const char *fonts[] = {"Symbols Nerd Font Mono:size=12", "mononoki Nerd Font:size=12"};
static const char dmenufont[] = {"mononoki Nerd Font:size=12"}; static const char dmenufont[] = {"mononoki Nerd Font:size=12"};
static const char col_gray1[] = "#1d2021"; static const char col_gray1[] = "#1d2021";
@ -14,22 +17,25 @@ static const char col_gray4[] = "#fbf1c7";
static const char col_cyan[] = "#cc241d"; static const char col_cyan[] = "#cc241d";
static const unsigned int baralpha = 0xd0; static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE; static const unsigned int borderalpha = OPAQUE;
static const char *colors[][3] = { static const char *colors[][3] = {
/* fg bg border */ // FB BG BORDER
[SchemeNorm] = {col_gray3, col_gray1, col_gray2}, [SchemeNorm] = {col_gray3, col_gray1, col_gray2},
[SchemeSel] = {col_gray4, col_cyan, col_cyan}, [SchemeSel] = {col_gray4, col_cyan, col_cyan},
}; };
static const unsigned int alphas[][3] = { static const unsigned int alphas[][3] = {
/* fg bg border*/ // FB BG BORDER
[SchemeNorm] = {OPAQUE, baralpha, borderalpha}, [SchemeNorm] = {OPAQUE, baralpha, borderalpha},
[SchemeSel] = {OPAQUE, baralpha, borderalpha}, [SchemeSel] = {OPAQUE, baralpha, borderalpha},
}; };
/* scratchpads */ // Scratchpads
typedef struct { typedef struct {
const char *name; const char *name;
const void *cmd; const void *cmd;
} Sp; } Sp;
const char *spcmd1[] = {"st", "-n", "sptrm", "-g", "140x35", NULL}; const char *spcmd1[] = {"st", "-n", "sptrm", "-g", "140x35", NULL};
const char *spcmd2[] = {"st", "-n", "sptop", "-g", "140x35", "-e", "btop", NULL}; const char *spcmd2[] = {"st", "-n", "sptop", "-g", "140x35", "-e", "btop", NULL};
const char *spcmd3[] = {"st", "-n", "spfli", "-g", "140x35", "-e", "flix-cli", NULL}; const char *spcmd3[] = {"st", "-n", "spfli", "-g", "140x35", "-e", "flix-cli", NULL};
@ -43,8 +49,9 @@ const char *spcmd10[] = {"st", "-n", "spytm", "-g", "140x35", "-e", "ytfzf", "-m
const char *spcmd11[] = {"st", "-n", "sprss", "-g", "140x35", "-e", "newsboat", NULL}; const char *spcmd11[] = {"st", "-n", "sprss", "-g", "140x35", "-e", "newsboat", NULL};
const char *spcmd12[] = {"st", "-n", "spgkk", "-g", "140x35", "-e", "geek-life", NULL}; const char *spcmd12[] = {"st", "-n", "spgkk", "-g", "140x35", "-e", "geek-life", NULL};
const char *spcmd13[] = {"st", "-n", "sptut", "-g", "140x35", "-e", "tut", NULL}; const char *spcmd13[] = {"st", "-n", "sptut", "-g", "140x35", "-e", "tut", NULL};
static Sp scratchpads[] = { static Sp scratchpads[] = {
/* name cmd */ // NAME CMD
{"sptrm", spcmd1}, {"sptrm", spcmd1},
{"sptop", spcmd2}, {"sptop", spcmd2},
{"spfli", spcmd3}, {"spfli", spcmd3},
@ -60,7 +67,7 @@ static Sp scratchpads[] = {
{"sptut", spcmd13}, {"sptut", spcmd13},
}; };
/* tagging */ // Tags
static const char *tags[] = { static const char *tags[] = {
"", // EDITOR "", // EDITOR
"󰙨", // TESTING "󰙨", // TESTING
@ -73,13 +80,13 @@ static const char *tags[] = {
"󰊖" // GAMES "󰊖" // GAMES
}; };
// rules // Rules
static const Rule rules[] = { static const Rule rules[] = {
/* xprop(1): /* xprop(1):
* WM_CLASS(STRING) = instance, class * WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title * WM_NAME(STRING) = title
*/ */
// class instance title tags mask isfloating monitor // CLASS INSTANCE TITLE TAGS MASK ISFLOATING MONITOR
// no workspace // no workspace
{"Galculator", NULL, NULL, 0, 1, -1}, {"Galculator", NULL, NULL, 0, 1, -1},
// code tag // code tag
@ -155,22 +162,21 @@ static const Rule rules[] = {
{NULL, "sptut", NULL, SPTAG(12), 1, -1}, {NULL, "sptut", NULL, SPTAG(12), 1, -1},
}; };
// layout(s) // Layout(s)
static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */ static const float mfact = 0.5; // factor of master area size [0.05..0.95]
static const int nmaster = 1; /* number of clients in master area */ static const int nmaster = 1; // number of clients in master area
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ static const int resizehints = 1; // 1 means respect size hints in tiled resizals
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ static const int lockfullscreen = 1; // 1 will force focus on the fullscreen window
#include "tcl.c"
static const Layout layouts[] = { static const Layout layouts[] = {
/* symbol arrange function */ // SYMBOL ARRANGE FUNCTION
{ "[]=", tile }, /* first entry is default */ {"[]=", tile}, // first entry is default
{ "><>", NULL }, /* no layout function means floating behavior */ {"><>", NULL}, // no layout function means floating behavior
{"[M]", monocle}, {"[M]", monocle},
{"|||", tcl}, {"|||", tcl},
}; };
// key definitions // Key definitions
#define MODKEY Mod4Mask #define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \ #define TAGKEYS(KEY,TAG) \
{MODKEY, KEY, view, {.ui = 1 << TAG}}, \ {MODKEY, KEY, view, {.ui = 1 << TAG}}, \
@ -178,21 +184,18 @@ static const Layout layouts[] = {
{MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \ {MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \
{MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG}}, {MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG}},
// helper for spawning shell commands in the pre dwm-5.0 fashion // Helper for spawning shell commands in the pre dwm-5.0 fashion
#define SHCMD(cmd) {.v = (const char*[]){ "/bin/sh", "-c", cmd, NULL}} #define SHCMD(cmd) {.v = (const char*[]){ "/bin/sh", "-c", cmd, NULL}}
/* commands */ // Commands
// dmenu // dmenu
static const char *dmenucmd[] = {"dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL}; static const char *dmenucmd[] = {"dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL};
// terminal // terminal
static const char *termcmd[] = {"st", NULL}; static const char *termcmd[] = {"st", NULL};
#include "movestack.c"
static const Key keys[] = { static const Key keys[] = {
/* modifier key function argument */ // MODIFIER KEY FUNCTION ARGUMENT
// main apps
/* main apps*/
// terminal // terminal
{MODKEY, XK_Return, spawn, {.v = termcmd}}, {MODKEY, XK_Return, spawn, {.v = termcmd}},
// text editor // text editor
@ -200,15 +203,15 @@ static const Key keys[] = {
// web browser // web browser
{MODKEY, XK_w, spawn, SHCMD("qutebrowser")}, {MODKEY, XK_w, spawn, SHCMD("qutebrowser")},
// chat // chat
{ MODKEY, XK_s, spawn, SHCMD("signal-desktop")}, {MODKEY, XK_s, spawn, SHCMD("org.signal.Signal")},
/* keyboard layout */ // keyboard layout
// set keyboard layout to es // set keyboard layout to es
{MODKEY|ControlMask, XK_e, spawn, SHCMD("setxkbmap -layout es && pkill -RTMIN+10 dwmblocks")}, {MODKEY|ControlMask, XK_e, spawn, SHCMD("setxkbmap -layout es && pkill -RTMIN+10 dwmblocks")},
// set keyboard layout to us // set keyboard layout to us
{MODKEY|ControlMask, XK_u, spawn, SHCMD("setxkbmap -layout us && pkill -RTMIN+10 dwmblocks")}, {MODKEY|ControlMask, XK_u, spawn, SHCMD("setxkbmap -layout us && pkill -RTMIN+10 dwmblocks")},
/* XF86 Keys */ // XF86 Keys
// increase volume // increase volume
{0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer -i 5 && pkill -RTMIN+10 dwmblocks")}, {0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer -i 5 && pkill -RTMIN+10 dwmblocks")},
// decrease volume // decrease volume
@ -236,7 +239,7 @@ static const Key keys[] = {
// news // news
{0, XF86XK_News, spawn, SHCMD("st -n newsboat -c newsboat -e newsboat")}, {0, XF86XK_News, spawn, SHCMD("st -n newsboat -c newsboat -e newsboat")},
/* dmenu */ // dmenu
// launcher // launcher
{MODKEY|ShiftMask, XK_r, spawn, {.v = dmenucmd}}, {MODKEY|ShiftMask, XK_r, spawn, {.v = dmenucmd}},
// desktop launcher // desktop launcher
@ -254,7 +257,7 @@ static const Key keys[] = {
// power manager // power manager
{MODKEY|ShiftMask, XK_q, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_power")}, {MODKEY|ShiftMask, XK_q, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_power")},
/* window management */ // window management
// window focusing // window focusing
{MODKEY, XK_j, focusstack, {.i = +1}}, {MODKEY, XK_j, focusstack, {.i = +1}},
{MODKEY, XK_k, focusstack, {.i = -1}}, {MODKEY, XK_k, focusstack, {.i = -1}},
@ -295,7 +298,7 @@ static const Key keys[] = {
{MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1}}, {MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1}},
{MODKEY|ShiftMask, XK_period, tagmon, {.i = +1}}, {MODKEY|ShiftMask, XK_period, tagmon, {.i = +1}},
/* tags */ // tags
TAGKEYS( XK_1, 0) TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1) TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2) TAGKEYS( XK_3, 2)
@ -306,7 +309,7 @@ static const Key keys[] = {
TAGKEYS( XK_8, 7) TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8) TAGKEYS( XK_9, 8)
/* scratchpads */ // scratchpads
{MODKEY|Mod1Mask, XK_Return, togglescratch, {.ui = 0 }}, {MODKEY|Mod1Mask, XK_Return, togglescratch, {.ui = 0 }},
{MODKEY|Mod1Mask, XK_b, togglescratch, {.ui = 1 }}, {MODKEY|Mod1Mask, XK_b, togglescratch, {.ui = 1 }},
{MODKEY|Mod1Mask, XK_f, togglescratch, {.ui = 2 }}, {MODKEY|Mod1Mask, XK_f, togglescratch, {.ui = 2 }},
@ -321,7 +324,7 @@ static const Key keys[] = {
{MODKEY|Mod1Mask, XK_g, togglescratch, {.ui = 11 }}, {MODKEY|Mod1Mask, XK_g, togglescratch, {.ui = 11 }},
{MODKEY|Mod1Mask, XK_t, togglescratch, {.ui = 12 }}, {MODKEY|Mod1Mask, XK_t, togglescratch, {.ui = 12 }},
/* misc */ // misc
// logout // logout
//{ MODKEY|ShiftMask, XK_q, quit, {0} }, //{ MODKEY|ShiftMask, XK_q, quit, {0} },
// toogle the bar // toogle the bar
@ -330,8 +333,8 @@ static const Key keys[] = {
{MODKEY|ControlMask, XK_r, quit, {1}}, {MODKEY|ControlMask, XK_r, quit, {1}},
}; };
/* button definitions */ // button definitions
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ // click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin
// mouse bindings // mouse bindings
static const Button buttons[] = { static const Button buttons[] = {
/* click event mask button function argument */ /* click event mask button function argument */
@ -347,4 +350,3 @@ static const Button buttons[] = {
{ClkTagBar, MODKEY, Button1, tag, {0}}, {ClkTagBar, MODKEY, Button1, tag, {0}},
{ClkTagBar, MODKEY, Button3, toggletag, {0}}, {ClkTagBar, MODKEY, Button3, toggletag, {0}},
}; };

View file

@ -5,7 +5,7 @@
# If you want you can set this to $EDITOR to use your environment variable or # If you want you can set this to $EDITOR to use your environment variable or
# vim if you want to specify the program directly. # vim if you want to specify the program directly.
# default="TUT_USE_INTERNAL" # default="TUT_USE_INTERNAL"
editor="emacsclient -t -a ''" editor="~/.local/bin/lvim"
# You need to press yes in a confirmation dialog before favoriting, boosting, # You need to press yes in a confirmation dialog before favoriting, boosting,
# etc. # etc.

View file

@ -5,11 +5,11 @@
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported. # absolute path. No other format is supported.
# #
XDG_DESKTOP_DIR="$HOME/Temporal/Desktop" XDG_DESKTOP_DIR="$HOME/var/desktop"
XDG_DOWNLOAD_DIR="$HOME/Temporal/Downloads" XDG_DOWNLOAD_DIR="$HOME/var/downloads"
XDG_TEMPLATES_DIR="$HOME/Temporal/Templates" XDG_TEMPLATES_DIR="$HOME/media/documents/templates"
XDG_PUBLICSHARE_DIR="$HOME/Temporal/Public" XDG_PUBLICSHARE_DIR="$HOME/var/public"
XDG_DOCUMENTS_DIR="$HOME/Documents" XDG_DOCUMENTS_DIR="$HOME/media/documents"
XDG_MUSIC_DIR="$HOME/Media/Music" XDG_MUSIC_DIR="$HOME/media/music"
XDG_PICTURES_DIR="$HOME/Media/Pictures" XDG_PICTURES_DIR="$HOME/media/pictures"
XDG_VIDEOS_DIR="$HOME/Media/Videos" XDG_VIDEOS_DIR="$HOME/media/videos"

View file

@ -13,7 +13,7 @@
" Since emacs is a GUI app and not a terminal app like vim, append the command " Since emacs is a GUI app and not a terminal app like vim, append the command
" with an ampersand (&). " with an ampersand (&).
set vicmd=nvim set vicmd=~/.local/bin/lvim
" This makes vifm perform file operations on its own instead of relying on " This makes vifm perform file operations on its own instead of relying on
" standard utilities like `cp`. While using `cp` and alike is a more universal " standard utilities like `cp`. While using `cp` and alike is a more universal

2
user/.local/bin/neovide Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
neovide --neovim-bin "$HOME/.local/bin/lvim"

View file

@ -28,16 +28,26 @@ if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap" xmodmap "$usermodmap"
fi fi
if xinput --list | grep -q "Elan TrackPoint"; then
xinput set-prop "TPPS/2 Elan TrackPoint" "libinput Accel Speed" 1
fi
# environment variables # environment variables
export MOZ_USE_XINPUT2=1 export MOZ_USE_XINPUT2=1
export QT_STYLE_OVERRIDE=kvantum export QT_STYLE_OVERRIDE=kvantum
export MEDIA_DIR="$HOME/Media"
export TEMP_DIR="$HOME/Temporal"
# clean home # clean home
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DESKTOP_DIR="$HOME/var/desktop"
export XDG_DOWNLOAD_DIR="$HOME/var/downloads"
export XDG_TEMPLATES_DIR="$HOME/media/documents/templates"
export XDG_PUBLICSHARE_DIR="$HOME/var/public"
export XDG_DOCUMENTS_DIR="$HOME/media/documents"
export XDG_MUSIC_DIR="$HOME/media/music"
export XDG_PICTURES_DIR="$HOME/media/pictures"
export XDG_VIDEOS_DIR="$HOME/media/videos"
export W3M_DIR="$XDG_DATA_HOME/w3m" export W3M_DIR="$XDG_DATA_HOME/w3m"
export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0" export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0"
export WGETRC="$HOME/.config/wget/wgetrc" export WGETRC="$HOME/.config/wget/wgetrc"
@ -52,4 +62,4 @@ export BROWSER="qutebrowser"
export VIEWER="zathura" export VIEWER="zathura"
# start window manager / desktop environment # start window manager / desktop environment
exec dwm dbus-launch dwm