diff --git a/user/.bash_profile b/user/.bash_profile index 9053cd26b..2c76adf93 100644 --- a/user/.bash_profile +++ b/user/.bash_profile @@ -16,13 +16,19 @@ fi # environment variables export EDITOR="~/.local/bin/lvim" export VISUAL="neovide --neovim-bin ~/.local/bin/lvim" -export MEDIA_DIR="$HOME/Media" -export TEMP_DIR="$HOME/Temporal" # clean home export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" 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 GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0" export INPUTRC="$HOME/.config/inputrc" diff --git a/user/.config/suckless/dmenu/scripts/dmenu_power b/user/.config/suckless/dmenu/scripts/dmenu_power index dbcbe8f1b..44a79f326 100755 --- a/user/.config/suckless/dmenu/scripts/dmenu_power +++ b/user/.config/suckless/dmenu/scripts/dmenu_power @@ -5,7 +5,7 @@ # - Dependencies: dmenu, power-profiles-daemon, slock ####################### -## Main menu options ## +## Main manu options ## ####################### option1=" Logout" option2=" Reboot" @@ -13,18 +13,23 @@ option3=" Power off" option4="󰒲 Suspend" option5=" Lock" option6=" Change power profile" -option7=" Cancel" +option7="󱎘 Exit" options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7" -############################ -## Power profiles submenu ## -############################ +#################################### +## Power profiles submenu options ## +#################################### pwr1="󰓅 Performance" pwr2="󰾅 Balanced" pwr3="󰾆 Power Saver" pwr4=" Cancel" pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4" +##### +## This variable will store the current power profile +##### +currentpwr=$(powerprofilesctl get) + ########## ## main ## ########## @@ -46,29 +51,45 @@ case "$action" in slock; ;; "$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 - currentpwr="$pwr1" + ##### + ## These conditions will be used for the prompt + ##### + if [ "$currentpwr" = "performance" ]; then + currentpwr="$pwr1"; elif [ "$currentpwr" = "balanced" ]; then - currentpwr="$pwr2" + currentpwr="$pwr2"; elif [ "$currentpwr" = "power-saver" ]; then - currentpwr="$pwr3" + currentpwr="$pwr3"; 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 "$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") - 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") - 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") - exit 0 - esac - ;; + exit 0; + esac;; "$option7") - exit 0 + exit 0; esac diff --git a/user/.config/suckless/dmenu/scripts/dmenu_scrot b/user/.config/suckless/dmenu/scripts/dmenu_scrot index 9435e73fc..7c735f924 100755 --- a/user/.config/suckless/dmenu/scripts/dmenu_scrot +++ b/user/.config/suckless/dmenu/scripts/dmenu_scrot @@ -7,15 +7,23 @@ ########################### ## 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" +########################### +## Screencasts Directory ## +########################### +CASTDIR="$XDG_VIDEOS_DIR/screencasts" +mkdir -p "$CASTDIR" + ####################### ## Main menu choices ## ####################### -mcho1="󰹑 Take an screenshot" -mcho2="󰻃 Record the screen" -mchos="$mcho1\n$mcho2" +mcho1="󰹑 Take a screenshot" +mcho2="󰐍 Record the screen" +mcho3="󰙧 Stop recording" +mcho4="󱎘 Exit" +mchos="$mcho1\n$mcho2\n$mcho3\n$mcho4" ############################# ## Screenshot menu choices ## @@ -31,7 +39,7 @@ schos="$scho1\n$scho2\n$scho3\n$scho4\n$scho5" ## Screenshot submenu ## ######################## sscho1="󰆏 Copy to clipboard" -sscho2="󰠘 Save to ~/Media/Pictures/Screenshots" +sscho2="󰠘 Save to $SHOTDIR" sschos="$sscho1\n$sscho2" ################################# @@ -43,38 +51,25 @@ del3="󱑇 10 sec delay" dels="$del1\n$del2\n$del3" ##### -## This function uses the sschos variable -## to ask the user what to do with the +## This function uses the sschos variable to ask the user what to do with the ## screenshot ##### -## param: none -## return: string -##### fsschos() { sschoice=$(echo -e "$sschos" | dmenu -i -l 2 -p " What do you want to do with this screenshot?") } ##### -## This function uses the dels variable -## to ask the user which delay option to +## This function uses the dels variable to ask the user which delay option to ## choose ##### -## param: none -## return: string -##### fdel() { del=$(echo -e "$dels" | dmenu -i -p " Select Delay") } ##### -## This function does a full screen -## screenshot without delay, depending on -## what the user chooses on the fsschos -## function, the screenshot will be saved -## to the clipboard or to $SHOTDIR -##### -## param: none -## return: void +## This function does a full screen screenshot without delay, depending on what +## the user chooses on the fsschos function, the screenshot will be saved to the +## clipboard or to $SHOTDIR ##### shot_screen() { fsschos @@ -88,17 +83,10 @@ shot_screen() { } ##### -## This function does a full screen -## screenshot with delay, depending on -## what the user chooses on the fsschos -## function, the screenshot will be saved -## 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 +## This function does a full screen screenshot with delay, depending on what the +## user chooses on the fsschos function, the screenshot will be saved 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 ##### shot_screen_delay() { fsschos; @@ -118,13 +106,13 @@ shot_screen_delay() { fdel; case $del in "$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") - 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") - 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 else exit 0 @@ -132,55 +120,75 @@ shot_screen_delay() { } ##### -## This function allows the user to select -## the area on screen to screenshot -## depending on what the user chooses on -## the fsschos function, the screenshot -## will be saved to the clipboard or to -## $SHOTDIR -##### -## param: none -## return: void +## This function allows the user to select the area on the screen to screenshot +## depending on what the user chooses on the fsschos function, the screenshot will +## be saved to the clipboard or to $SHOTDIR ##### shot_area() { fsschos; if [ "$sschoice" = "$sscho1" ]; then maim -s | xclip -selection clipboard -t image/png && notify-send "Screenshot saved to clipboard"; 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 exit 0 fi } ##### -## This function does an screnshot of the -## currently active window, depending on -## what the user chooses on the fsschos -## function, the screenshot will be saved -## to the clipboard or to $SHOTDIR -##### -## param: none -## return: void +## This function does a screenshot of the currently active window, depending +## on what the user chooses on the fsschos function, the screenshot will be +## saved to the clipboard or to $SHOTDIR ##### shot_window() { fsschos; if [ "$sschoice" = "$sscho1" ]; then maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png && notify-send "Screenshot saved to clipboard"; 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 exit 0 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 ## ########## -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 "$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 "$scho1") shot_screen; @@ -199,8 +207,12 @@ case $mchoice in esac ;; "$mcho2") - # TODO Implement screencast functionality with ffmpeg - notify-send "Bro you need to implement screen recording with ffmpeg" - exit 0 + start_recording; + ;; + "$mcho3") + stop_recording; + ;; + "$mcho4") + exit 0; ;; esac diff --git a/user/.config/suckless/dmenu/scripts/dmenu_wall b/user/.config/suckless/dmenu/scripts/dmenu_wall index 1e71198db..49d382e00 100755 --- a/user/.config/suckless/dmenu/scripts/dmenu_wall +++ b/user/.config/suckless/dmenu/scripts/dmenu_wall @@ -7,7 +7,7 @@ ########################## ## 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 ####################### diff --git a/user/.config/suckless/dmenu/scripts/dmenu_wifi b/user/.config/suckless/dmenu/scripts/dmenu_wifi index b9acb51e5..254ee44f1 100755 --- a/user/.config/suckless/dmenu/scripts/dmenu_wifi +++ b/user/.config/suckless/dmenu/scripts/dmenu_wifi @@ -12,14 +12,16 @@ option2=" Turn off WiFi" option3="󱛅 Disconnect WiFi" option4="󱛃 Connect WiFi" option5="󱛆 Setup captive portal" -option6=" Exit" +option6="󱎘 Exit" options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6" ##### -## This variable will grab the wireless -## interface name +## These variables will store specific +## 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 @@ -30,8 +32,7 @@ wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1) ## return: void ##### turnoff() { - nmcli radio wifi off - notify-send "WiFi has been turned off" + nmcli radio wifi off && notify-send "WiFi has been turned off"; } ##### @@ -43,22 +44,26 @@ turnoff() { ## return: void ##### turnon() { - nmcli radio wifi on - notify-send "WiFi has been turned on" + nmcli radio wifi on && notify-send "WiFi has been turned on"; } ##### ## This function uses nmcli and the -## $wlan variable to disconnect -## from the wifi network and -## then sends a notification +## $wlan and $constate variables to +## disconnect from the wifi network +## and then sends a notification ##### ## param: none ## return: void ##### disconnect() { - nmcli device disconnect "$wlan" - notify-send "WiFi has been disconnected" + if [ "$constate" = "disconnected" ]; then + 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 ##### connect() { - notify-send "Scannig WiFi networks, please wait" - nmcli dev wifi rescan - sleep 1 - bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -i -l 10 -p "Select a Wifi Network  " | cut -d' ' -f1) + notify-send "Scannig networks..." && 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"); + bssid=$(echo "$wifinet" | cut -d' ' -f1) + ssid=$(echo "$wifinet" | cut -d' ' -f3) } ##### @@ -85,11 +90,18 @@ connect() { ## return: string ##### password() { - # TODO Create a condition to check if the chosen network is open or not, that - # way this will be skipped of it's open - # TODO What if the network is already saved? The user doesn't need to type the - # password again - pass=$(echo " " | dmenu -P -i -p "Enter Password ") + if nmcli connection show | grep -q "$ssid"; then # check if the network is already saved + return 0; # no password is required + 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 + return 0; # no password is required + 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,29 +113,11 @@ password() { ## return: void ##### action() { - # TODO Create a condition to check if the chosen network is open or not (check - # password funcion) - # TODO What if the network is already saved? The user doesn't need to type the - # password again - 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 + if [ -n "$pass" ]; then # we need to check again if the $pass variable exists + nmcli dev wifi connect "$bssid" password "$pass" + else # if not, that means that the password() function ended in one of the first two conditions, the network is saved or open + nmcli dev wifi connect "$bssid"; + fi } ########## @@ -131,24 +125,26 @@ check() { ########## cases=$(echo -e "$options" | dmenu -l 6 -i -p " Wifi Settings" ) # main menu prompt case "$cases" in - "$option1") - turnon;; - "$option2") - turnoff;; - "$option3") - disconnect;; - "$option4") - connect; - if [ -n "$bssid" ]; then # if the user chooses a network - password; - action; - sleep 5; - check; - else - exit 0; # if not, exit the script - fi;; - "$option5") - "$BROWSER" http://networkcheck.kde.org;; # $BROWSER reffers to a global variable set in .xinitrc/.bash_profile - "$option6") - exit 0; + "$option1") + turnon; + ;; + "$option2") + turnoff; + ;; + "$option3") + disconnect; + ;; + "$option4") + if connect; then # if the user chooses a network + password; # this function will exit the script if the user didn't put a password + action; + else + exit 1; # if not, exit the script + fi + ;; + "$option5") + io.elementary.capnet-assist; + ;; + "$option6") + exit 0; esac diff --git a/user/.config/suckless/dwm/config.h b/user/.config/suckless/dwm/config.h index 498772feb..af8b5c7ba 100644 --- a/user/.config/suckless/dwm/config.h +++ b/user/.config/suckless/dwm/config.h @@ -1,50 +1,57 @@ -/* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -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 dmenufont[] = {"mononoki Nerd Font:size=12"}; -static const char col_gray1[] = "#1d2021"; -static const char col_gray2[] = "#32302f"; -static const char col_gray3[] = "#d5c4a1"; -static const char col_gray4[] = "#fbf1c7"; -static const char col_cyan[] = "#cc241d"; -static const unsigned int baralpha = 0xd0; +#include "tcl.c" +#include "movestack.c" + +// Appearance +static const unsigned int borderpx = 1; // border pixel of windows +static const unsigned int snap = 32; // snap pixel +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 dmenufont[] = {"mononoki Nerd Font:size=12"}; +static const char col_gray1[] = "#1d2021"; +static const char col_gray2[] = "#32302f"; +static const char col_gray3[] = "#d5c4a1"; +static const char col_gray4[] = "#fbf1c7"; +static const char col_cyan[] = "#cc241d"; +static const unsigned int baralpha = 0xd0; static const unsigned int borderalpha = OPAQUE; -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -}; -static const unsigned int alphas[][3] = { - /* fg bg border*/ - [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, - [SchemeSel] = { OPAQUE, baralpha, borderalpha }, + +static const char *colors[][3] = { + // FB BG BORDER + [SchemeNorm] = {col_gray3, col_gray1, col_gray2}, + [SchemeSel] = {col_gray4, col_cyan, col_cyan}, }; -/* scratchpads */ +static const unsigned int alphas[][3] = { + // FB BG BORDER + [SchemeNorm] = {OPAQUE, baralpha, borderalpha}, + [SchemeSel] = {OPAQUE, baralpha, borderalpha}, +}; + +// Scratchpads typedef struct { const char *name; const void *cmd; } Sp; -const char *spcmd1[] = {"st", "-n", "sptrm", "-g", "140x35", 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 *spcmd4[] = {"st", "-n", "spani", "-g", "140x35", "-e", "ani-cli", NULL }; -const char *spcmd5[] = {"st", "-n", "spytf", "-g", "140x35", "-e", "ytfzf", "-flst", NULL }; -const char *spcmd6[] = {"st", "-n", "spamx", "-g", "140x35", "-e", "alsamixer", NULL }; -const char *spcmd7[] = {"st", "-n", "sppmx", "-g", "140x35", "-e", "pulsemixer", NULL }; -const char *spcmd8[] = {"st", "-n", "spmsc", "-g", "140x35", "-e", "cmus", NULL }; -const char *spcmd9[] = {"st", "-n", "spflm", "-g", "140x35", "-e", ".config/vifm/scripts/vifmrun", NULL }; -const char *spcmd10[] = {"st", "-n", "spytm", "-g", "140x35", "-e", "ytfzf", "-mlst", 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 *spcmd13[] = {"st", "-n", "sptut", "-g", "140x35", "-e", "tut", NULL }; + +const char *spcmd1[] = {"st", "-n", "sptrm", "-g", "140x35", 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 *spcmd4[] = {"st", "-n", "spani", "-g", "140x35", "-e", "ani-cli", NULL}; +const char *spcmd5[] = {"st", "-n", "spytf", "-g", "140x35", "-e", "ytfzf", "-flst", NULL}; +const char *spcmd6[] = {"st", "-n", "spamx", "-g", "140x35", "-e", "alsamixer", NULL}; +const char *spcmd7[] = {"st", "-n", "sppmx", "-g", "140x35", "-e", "pulsemixer", NULL}; +const char *spcmd8[] = {"st", "-n", "spmsc", "-g", "140x35", "-e", "cmus", NULL}; +const char *spcmd9[] = {"st", "-n", "spflm", "-g", "140x35", "-e", ".config/vifm/scripts/vifmrun", NULL}; +const char *spcmd10[] = {"st", "-n", "spytm", "-g", "140x35", "-e", "ytfzf", "-mlst", 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 *spcmd13[] = {"st", "-n", "sptut", "-g", "140x35", "-e", "tut", NULL}; + static Sp scratchpads[] = { - /* name cmd */ + // NAME CMD {"sptrm", spcmd1}, {"sptop", spcmd2}, {"spfli", spcmd3}, @@ -60,7 +67,7 @@ static Sp scratchpads[] = { {"sptut", spcmd13}, }; -/* tagging */ +// Tags static const char *tags[] = { "", // EDITOR "󰙨", // TESTING @@ -73,278 +80,273 @@ static const char *tags[] = { "󰊖" // GAMES }; -// rules +// Rules static const Rule rules[] = { /* xprop(1): * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - // class instance title tags mask isfloating monitor - // no workspace - { "Galculator", NULL, NULL, 0, 1, -1 }, - // code tag - { "Emacs", NULL, NULL, 1, 0, -1 }, - { "Godot", NULL, NULL, 1, 0, -1 }, - { "neovim", NULL, NULL, 1, 0, -1 }, - { "neovide", NULL, NULL, 1, 0, -1 }, - // test tag - { "Virt-manager", NULL, NULL, 1 << 1, 0, -1 }, - { "Gnome-boxes", NULL, NULL, 1 << 1, 0, -1 }, - // web tag - { "LibreWolf", NULL, NULL, 1 << 2, 0, -1 }, - { "librewolf-default", NULL, NULL, 1 << 2, 0, -1 }, - { "firefox", NULL, NULL, 1 << 2, 0, -1 }, - { "qutebrowser", NULL, NULL, 1 << 2, 0, -1 }, - { "Chromium", NULL, NULL, 1 << 2, 0, -1 }, - { "Brave-browser", NULL, NULL, 1 << 2, 0, -1 }, - { "Bitwarden", NULL, NULL, 1 << 2, 0, -1 }, - { "newsboat", NULL, NULL, 1 << 2, 0, -1 }, - // chat tag - { "Signal", NULL, NULL, 1 << 3, 0, -1 }, - // audio tools tag - { "Audacity", NULL, NULL, 1 << 4, 0, -1 }, - { "Ardour", NULL, NULL, 1 << 4, 0, -1 }, - { "Carla2", NULL, NULL, 1 << 4, 0, -1 }, - { "Carla2-Control", NULL, NULL, 1 << 4, 0, -1 }, - { "QjackCtl", NULL, NULL, 1 << 4, 1, -1 }, - { "lsp-plugins", NULL, NULL, 1 << 4, 1, -1 }, - { "qpwgraph", NULL, NULL, 1 << 4, 0, -1 }, - { "Cadence", NULL, NULL, 1 << 4, 0, -1 }, - { "easyeffects", NULL, NULL, 1 << 4, 0, -1 }, - // video tag - { "kdenlive", NULL, NULL, 1 << 5, 0, -1 }, - { "Pitivi", NULL, NULL, 1 << 5, 0, -1 }, - { "Blender", NULL, NULL, 1 << 5, 0, -1 }, - { "Natron", NULL, NULL, 1 << 5, 0, -1 }, - { "SimpleScreenRecorder", NULL, NULL, 1 << 5, 0, -1 }, - { "Ghb", NULL, NULL, 1 << 5, 0, -1 }, - { "obs", NULL, NULL, 1 << 5, 0, -1 }, - { "mpv", NULL, NULL, 1 << 5, 0, -1 }, - // graphics/extra tools tag - { "Gimp-2.10", NULL, NULL, 1 << 6, 0, -1 }, - { "krita", NULL, NULL, 1 << 6, 0, -1 }, - { "Inkscape", NULL, NULL, 1 << 6, 0, -1 }, - { "Xournalpp", NULL, NULL, 1 << 6, 0, -1 }, - // office tag - { "DesktopEditors", NULL, NULL, 1 << 7, 0, -1 }, - { "Soffice", "soffice", NULL, 1 << 7, 0, -1 }, - { "libreoffice-startcenter", NULL, NULL, 1 << 7, 0, -1 }, - { "libreoffice-calc", NULL, NULL, 1 << 7, 0, -1 }, - { "libreoffice-writer", NULL, NULL, 1 << 7, 0, -1 }, - { "libreoffice-impress", NULL, NULL, 1 << 7, 0, -1 }, - { "libreoffice-base", NULL, NULL, 1 << 7, 0, -1 }, - { "libreoffice-draw", NULL, NULL, 1 << 7, 0, -1 }, - { "libreoffice-math", NULL, NULL, 1 << 7, 0, -1 }, - { "Joplin", NULL, NULL, 1 << 7, 0, -1 }, - // games tag - { "retroarch", NULL, NULL, 1 << 8, 0, -1 }, - { "steam", NULL, NULL, 1 << 8, 0, -1 }, - // scratchpads - { NULL, "sptrm", NULL, SPTAG(0), 1, -1 }, - { NULL, "sptop", NULL, SPTAG(1), 1, -1 }, - { NULL, "spfli", NULL, SPTAG(2), 1, -1 }, - { NULL, "spani", NULL, SPTAG(3), 1, -1 }, - { NULL, "spytf", NULL, SPTAG(4), 1, -1 }, - { NULL, "spamx", NULL, SPTAG(5), 1, -1 }, - { NULL, "sppmx", NULL, SPTAG(6), 1, -1 }, - { NULL, "spmsc", NULL, SPTAG(7), 1, -1 }, - { NULL, "spflm", NULL, SPTAG(8), 1, -1 }, - { NULL, "spytm", NULL, SPTAG(9), 1, -1 }, - { NULL, "sprss", NULL, SPTAG(10), 1, -1 }, - { NULL, "spgkk", NULL, SPTAG(11), 1, -1 }, - { NULL, "sptut", NULL, SPTAG(12), 1, -1 }, + // CLASS INSTANCE TITLE TAGS MASK ISFLOATING MONITOR + // no workspace + {"Galculator", NULL, NULL, 0, 1, -1}, + // code tag + {"Emacs", NULL, NULL, 1, 0, -1}, + {"Godot", NULL, NULL, 1, 0, -1}, + {"neovim", NULL, NULL, 1, 0, -1}, + {"neovide", NULL, NULL, 1, 0, -1}, + // test tag + {"Virt-manager", NULL, NULL, 1 << 1, 0, -1}, + {"Gnome-boxes", NULL, NULL, 1 << 1, 0, -1}, + // web tag + {"LibreWolf", NULL, NULL, 1 << 2, 0, -1}, + {"librewolf-default", NULL, NULL, 1 << 2, 0, -1}, + {"firefox", NULL, NULL, 1 << 2, 0, -1}, + {"qutebrowser", NULL, NULL, 1 << 2, 0, -1}, + {"Chromium", NULL, NULL, 1 << 2, 0, -1}, + {"Brave-browser", NULL, NULL, 1 << 2, 0, -1}, + {"Bitwarden", NULL, NULL, 1 << 2, 0, -1}, + {"newsboat", NULL, NULL, 1 << 2, 0, -1}, + // chat tag + {"Signal", NULL, NULL, 1 << 3, 0, -1}, + // audio tools tag + {"Audacity", NULL, NULL, 1 << 4, 0, -1}, + {"Ardour", NULL, NULL, 1 << 4, 0, -1}, + {"Carla2", NULL, NULL, 1 << 4, 0, -1}, + {"Carla2-Control", NULL, NULL, 1 << 4, 0, -1}, + {"QjackCtl", NULL, NULL, 1 << 4, 1, -1}, + {"lsp-plugins", NULL, NULL, 1 << 4, 1, -1}, + {"qpwgraph", NULL, NULL, 1 << 4, 0, -1}, + {"Cadence", NULL, NULL, 1 << 4, 0, -1}, + {"easyeffects", NULL, NULL, 1 << 4, 0, -1}, + // video tag + {"kdenlive", NULL, NULL, 1 << 5, 0, -1}, + {"Pitivi", NULL, NULL, 1 << 5, 0, -1}, + {"Blender", NULL, NULL, 1 << 5, 0, -1}, + {"Natron", NULL, NULL, 1 << 5, 0, -1}, + {"SimpleScreenRecorder", NULL, NULL, 1 << 5, 0, -1}, + {"Ghb", NULL, NULL, 1 << 5, 0, -1}, + {"obs", NULL, NULL, 1 << 5, 0, -1}, + {"mpv", NULL, NULL, 1 << 5, 0, -1}, + // graphics/extra tools tag + {"Gimp-2.10", NULL, NULL, 1 << 6, 0, -1}, + {"krita", NULL, NULL, 1 << 6, 0, -1}, + {"Inkscape", NULL, NULL, 1 << 6, 0, -1}, + {"Xournalpp", NULL, NULL, 1 << 6, 0, -1}, + // office tag + {"DesktopEditors", NULL, NULL, 1 << 7, 0, -1}, + {"Soffice", "soffice", NULL, 1 << 7, 0, -1}, + {"libreoffice-startcenter", NULL, NULL, 1 << 7, 0, -1}, + {"libreoffice-calc", NULL, NULL, 1 << 7, 0, -1}, + {"libreoffice-writer", NULL, NULL, 1 << 7, 0, -1}, + {"libreoffice-impress", NULL, NULL, 1 << 7, 0, -1}, + {"libreoffice-base", NULL, NULL, 1 << 7, 0, -1}, + {"libreoffice-draw", NULL, NULL, 1 << 7, 0, -1}, + {"libreoffice-math", NULL, NULL, 1 << 7, 0, -1}, + {"Joplin", NULL, NULL, 1 << 7, 0, -1}, + // games tag + {"retroarch", NULL, NULL, 1 << 8, 0, -1}, + {"steam", NULL, NULL, 1 << 8, 0, -1}, + // scratchpads + {NULL, "sptrm", NULL, SPTAG(0), 1, -1}, + {NULL, "sptop", NULL, SPTAG(1), 1, -1}, + {NULL, "spfli", NULL, SPTAG(2), 1, -1}, + {NULL, "spani", NULL, SPTAG(3), 1, -1}, + {NULL, "spytf", NULL, SPTAG(4), 1, -1}, + {NULL, "spamx", NULL, SPTAG(5), 1, -1}, + {NULL, "sppmx", NULL, SPTAG(6), 1, -1}, + {NULL, "spmsc", NULL, SPTAG(7), 1, -1}, + {NULL, "spflm", NULL, SPTAG(8), 1, -1}, + {NULL, "spytm", NULL, SPTAG(9), 1, -1}, + {NULL, "sprss", NULL, SPTAG(10), 1, -1}, + {NULL, "spgkk", NULL, SPTAG(11), 1, -1}, + {NULL, "sptut", NULL, SPTAG(12), 1, -1}, }; -// layout(s) -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 resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ +// Layout(s) +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 resizehints = 1; // 1 means respect size hints in tiled resizals +static const int lockfullscreen = 1; // 1 will force focus on the fullscreen window -#include "tcl.c" static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, - { "|||", tcl }, + // SYMBOL ARRANGE FUNCTION + {"[]=", tile}, // first entry is default + {"><>", NULL}, // no layout function means floating behavior + {"[M]", monocle}, + {"|||", tcl}, }; -// key definitions +// Key definitions #define MODKEY Mod4Mask #define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, + {MODKEY, KEY, view, {.ui = 1 << TAG}}, \ + {MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \ + {MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \ + {MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG}}, -// helper for spawning shell commands in the pre dwm-5.0 fashion -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } +// Helper for spawning shell commands in the pre dwm-5.0 fashion +#define SHCMD(cmd) {.v = (const char*[]){ "/bin/sh", "-c", cmd, NULL}} -/* commands */ +// Commands // 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 -static const char *termcmd[] = { "st", NULL }; - -#include "movestack.c" +static const char *termcmd[] = {"st", NULL}; static const Key keys[] = { - /* modifier key function argument */ + // MODIFIER KEY FUNCTION ARGUMENT + // main apps + // terminal + {MODKEY, XK_Return, spawn, {.v = termcmd}}, + // text editor + {MODKEY, XK_e, spawn, SHCMD("neovide --neovim-bin ~/.local/bin/lvim")}, + // web browser + {MODKEY, XK_w, spawn, SHCMD("qutebrowser")}, + // chat + {MODKEY, XK_s, spawn, SHCMD("org.signal.Signal")}, - /* main apps*/ - // terminal - { MODKEY, XK_Return, spawn, {.v = termcmd } }, - // text editor - { MODKEY, XK_e, spawn, SHCMD("neovide --neovim-bin ~/.local/bin/lvim")}, - // web browser - { MODKEY, XK_w, spawn, SHCMD("qutebrowser")}, - // chat - { MODKEY, XK_s, spawn, SHCMD("signal-desktop")}, + // keyboard layout + // set keyboard layout to es + {MODKEY|ControlMask, XK_e, spawn, SHCMD("setxkbmap -layout es && pkill -RTMIN+10 dwmblocks")}, + // set keyboard layout to us + {MODKEY|ControlMask, XK_u, spawn, SHCMD("setxkbmap -layout us && pkill -RTMIN+10 dwmblocks")}, - /* keyboard layout */ - // set keyboard layout to es - { MODKEY|ControlMask, XK_e, spawn, SHCMD("setxkbmap -layout es && pkill -RTMIN+10 dwmblocks")}, - // set keyboard layout to us - { MODKEY|ControlMask, XK_u, spawn, SHCMD("setxkbmap -layout us && pkill -RTMIN+10 dwmblocks")}, + // XF86 Keys + // increase volume + {0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer -i 5 && pkill -RTMIN+10 dwmblocks")}, + // decrease volume + {0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer -d 5 && pkill -RTMIN+10 dwmblocks")}, + // mute volume + {0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t && pkill -RTMIN+10 dwmblocks")}, + // mute microphone + {0, XF86XK_AudioMicMute, spawn, SHCMD("pamixer --default-source -t && pkill -RTMIN+10 dwmblocks")}, + // increase brightness + {0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl s 5%+ && pkill -RTMIN+10 dwmblocks")}, + // decrease brightness + {0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl s 5%- && pkill -RTMIN+10 dwmblocks")}, + // display settings + {0, XF86XK_Display, spawn, SHCMD("arandr")}, + // play/pause + {0, XF86XK_AudioPause, spawn, SHCMD("playerctl play-pause")}, + // play/pause + {0, XF86XK_AudioPlay, spawn, SHCMD("playerctl play-pause")}, + // next + {0, XF86XK_AudioNext, spawn, SHCMD("playerctl next")}, + // previous + {0, XF86XK_AudioPrev, spawn, SHCMD("playerctl previous")}, + // stop + {0, XF86XK_AudioStop, spawn, SHCMD("playerctl stop")}, + // news + {0, XF86XK_News, spawn, SHCMD("st -n newsboat -c newsboat -e newsboat")}, - /* XF86 Keys */ - // increase volume - { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer -i 5 && pkill -RTMIN+10 dwmblocks")}, - // decrease volume - { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer -d 5 && pkill -RTMIN+10 dwmblocks")}, - // mute volume - { 0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t && pkill -RTMIN+10 dwmblocks")}, - // mute microphone - { 0, XF86XK_AudioMicMute, spawn, SHCMD("pamixer --default-source -t && pkill -RTMIN+10 dwmblocks")}, - // increase brightness - { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl s 5%+ && pkill -RTMIN+10 dwmblocks")}, - // decrease brightness - { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl s 5%- && pkill -RTMIN+10 dwmblocks")}, - // display settings - { 0, XF86XK_Display, spawn, SHCMD("arandr")}, - // play/pause - { 0, XF86XK_AudioPause, spawn, SHCMD("playerctl play-pause")}, - // play/pause - { 0, XF86XK_AudioPlay, spawn, SHCMD("playerctl play-pause")}, - // next - { 0, XF86XK_AudioNext, spawn, SHCMD("playerctl next")}, - // previous - { 0, XF86XK_AudioPrev, spawn, SHCMD("playerctl previous")}, - // stop - { 0, XF86XK_AudioStop, spawn, SHCMD("playerctl stop")}, - // news - { 0, XF86XK_News, spawn, SHCMD("st -n newsboat -c newsboat -e newsboat")}, - - /* dmenu */ + // dmenu // launcher - { MODKEY|ShiftMask, XK_r, spawn, {.v = dmenucmd } }, - // desktop launcher - { MODKEY|ShiftMask, XK_d, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_drun") }, - // wifi config - { MODKEY|ShiftMask, XK_i, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_wifi") }, - // screenshots - { MODKEY, XK_Print, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_scrot") }, - // wallpapers - { MODKEY|ShiftMask, XK_w, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_wall") }, - // edit - { MODKEY|ShiftMask, XK_e, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_edit") }, - // bluetooth - { MODKEY|ShiftMask, XK_b, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_blue") }, - // power manager - { MODKEY|ShiftMask, XK_q, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_power")}, + {MODKEY|ShiftMask, XK_r, spawn, {.v = dmenucmd}}, + // desktop launcher + {MODKEY|ShiftMask, XK_d, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_drun")}, + // wifi config + {MODKEY|ShiftMask, XK_i, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_wifi")}, + // screenshots + {MODKEY, XK_Print, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_scrot")}, + // wallpapers + {MODKEY|ShiftMask, XK_w, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_wall")}, + // edit + {MODKEY|ShiftMask, XK_e, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_edit")}, + // bluetooth + {MODKEY|ShiftMask, XK_b, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_blue")}, + // power manager + {MODKEY|ShiftMask, XK_q, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_power")}, - /* window management */ - // window focusing - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - // increase and decrease master clients count - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - // increase and decrease master client size - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - // move windows on stack - { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } }, - { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } }, - // switch master window - { MODKEY|ControlMask, XK_Return, zoom, {0} }, - // switch to latest tag - { MODKEY, XK_Tab, view, {0} }, - // close focused client - { MODKEY, XK_q, killclient, {0} }, - // switch to tiling layout - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - // switch to floating layout - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - // switch to monocle layout - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - // switch to three-column layout - { MODKEY, XK_c, setlayout, {.v = &layouts[3]} }, - // switch to latest layout - { MODKEY, XK_space, setlayout, {0} }, - // toggle floating mode on focused window - { MODKEY|ControlMask, XK_space, togglefloating, {0} }, - // view all opened clients on current tag - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - // focus next or previous screen - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - // move focused client to next or previous screen - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + // window management + // window focusing + {MODKEY, XK_j, focusstack, {.i = +1}}, + {MODKEY, XK_k, focusstack, {.i = -1}}, + // increase and decrease master clients count + {MODKEY, XK_i, incnmaster, {.i = +1}}, + {MODKEY, XK_d, incnmaster, {.i = -1}}, + // increase and decrease master client size + {MODKEY, XK_h, setmfact, {.f = -0.05}}, + {MODKEY, XK_l, setmfact, {.f = +0.05}}, + // move windows on stack + {MODKEY|ShiftMask, XK_j, movestack, {.i = +1}}, + {MODKEY|ShiftMask, XK_k, movestack, {.i = -1}}, + // switch master window + {MODKEY|ControlMask, XK_Return, zoom, {0}}, + // switch to latest tag + {MODKEY, XK_Tab, view, {0}}, + // close focused client + {MODKEY, XK_q, killclient, {0}}, + // switch to tiling layout + {MODKEY, XK_t, setlayout, {.v = &layouts[0]}}, + // switch to floating layout + {MODKEY, XK_f, setlayout, {.v = &layouts[1]}}, + // switch to monocle layout + {MODKEY, XK_m, setlayout, {.v = &layouts[2]}}, + // switch to three-column layout + {MODKEY, XK_c, setlayout, {.v = &layouts[3]}}, + // switch to latest layout + {MODKEY, XK_space, setlayout, {0}}, + // toggle floating mode on focused window + {MODKEY|ControlMask, XK_space, togglefloating, {0}}, + // view all opened clients on current tag + {MODKEY, XK_0, view, {.ui = ~0}}, + {MODKEY|ShiftMask, XK_0, tag, {.ui = ~0}}, + // focus next or previous screen + {MODKEY, XK_comma, focusmon, {.i = -1}}, + {MODKEY, XK_period, focusmon, {.i = +1}}, + // move focused client to next or previous screen + {MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1}}, + {MODKEY|ShiftMask, XK_period, tagmon, {.i = +1}}, - /* tags */ - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) + // tags + TAGKEYS( XK_1, 0) + TAGKEYS( XK_2, 1) + TAGKEYS( XK_3, 2) + TAGKEYS( XK_4, 3) + TAGKEYS( XK_5, 4) + TAGKEYS( XK_6, 5) + TAGKEYS( XK_7, 6) + TAGKEYS( XK_8, 7) + TAGKEYS( XK_9, 8) - /* scratchpads */ - { MODKEY|Mod1Mask, XK_Return, togglescratch, {.ui = 0 } }, - { MODKEY|Mod1Mask, XK_b, togglescratch, {.ui = 1 } }, - { MODKEY|Mod1Mask, XK_f, togglescratch, {.ui = 2 } }, - { MODKEY|Mod1Mask, XK_a, togglescratch, {.ui = 3 } }, - { MODKEY|Mod1Mask, XK_y, togglescratch, {.ui = 4 } }, - { MODKEY|Mod1Mask, XK_o, togglescratch, {.ui = 5 } }, - { MODKEY|Mod1Mask, XK_p, togglescratch, {.ui = 6 } }, - { MODKEY|Mod1Mask, XK_m, togglescratch, {.ui = 7 } }, - { MODKEY|Mod1Mask, XK_v, togglescratch, {.ui = 8 } }, - { MODKEY|Mod1Mask, XK_n, togglescratch, {.ui = 9 } }, - { MODKEY|Mod1Mask, XK_r, togglescratch, {.ui = 10 } }, - { MODKEY|Mod1Mask, XK_g, togglescratch, {.ui = 11 } }, - { MODKEY|Mod1Mask, XK_t, togglescratch, {.ui = 12 } }, + // scratchpads + {MODKEY|Mod1Mask, XK_Return, togglescratch, {.ui = 0 }}, + {MODKEY|Mod1Mask, XK_b, togglescratch, {.ui = 1 }}, + {MODKEY|Mod1Mask, XK_f, togglescratch, {.ui = 2 }}, + {MODKEY|Mod1Mask, XK_a, togglescratch, {.ui = 3 }}, + {MODKEY|Mod1Mask, XK_y, togglescratch, {.ui = 4 }}, + {MODKEY|Mod1Mask, XK_o, togglescratch, {.ui = 5 }}, + {MODKEY|Mod1Mask, XK_p, togglescratch, {.ui = 6 }}, + {MODKEY|Mod1Mask, XK_m, togglescratch, {.ui = 7 }}, + {MODKEY|Mod1Mask, XK_v, togglescratch, {.ui = 8 }}, + {MODKEY|Mod1Mask, XK_n, togglescratch, {.ui = 9 }}, + {MODKEY|Mod1Mask, XK_r, togglescratch, {.ui = 10 }}, + {MODKEY|Mod1Mask, XK_g, togglescratch, {.ui = 11 }}, + {MODKEY|Mod1Mask, XK_t, togglescratch, {.ui = 12 }}, - /* misc */ - // logout + // misc + // logout //{ MODKEY|ShiftMask, XK_q, quit, {0} }, - // toogle the bar - { MODKEY, XK_b, togglebar, {0} }, - // restart dwm - { MODKEY|ControlMask, XK_r, quit, {1} }, + // toogle the bar + {MODKEY, XK_b, togglebar, {0}}, + // restart dwm + {MODKEY|ControlMask, XK_r, quit, {1}}, }; -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +// button definitions +// click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin // mouse bindings static const Button buttons[] = { /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + {ClkLtSymbol, 0, Button1, setlayout, {0}}, + {ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]}}, + {ClkWinTitle, 0, Button2, zoom, {0}}, + {ClkStatusText, 0, Button2, spawn, {.v = termcmd }}, + {ClkClientWin, MODKEY, Button1, movemouse, {0}}, + {ClkClientWin, MODKEY, Button2, togglefloating, {0}}, + {ClkClientWin, MODKEY, Button3, resizemouse, {0}}, + {ClkTagBar, 0, Button1, view, {0}}, + {ClkTagBar, 0, Button3, toggleview, {0}}, + {ClkTagBar, MODKEY, Button1, tag, {0}}, + {ClkTagBar, MODKEY, Button3, toggletag, {0}}, }; - diff --git a/user/.config/tut/config.toml b/user/.config/tut/config.toml index fe4d71dda..ead2516e6 100644 --- a/user/.config/tut/config.toml +++ b/user/.config/tut/config.toml @@ -5,7 +5,7 @@ # If you want you can set this to $EDITOR to use your environment variable or # vim if you want to specify the program directly. # default="TUT_USE_INTERNAL" -editor="emacsclient -t -a ''" +editor="~/.local/bin/lvim" # You need to press yes in a confirmation dialog before favoriting, boosting, # etc. diff --git a/user/.config/user-dirs.dirs b/user/.config/user-dirs.dirs index 1d7ebd4f8..8b8a6c363 100644 --- a/user/.config/user-dirs.dirs +++ b/user/.config/user-dirs.dirs @@ -5,11 +5,11 @@ # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is supported. # -XDG_DESKTOP_DIR="$HOME/Temporal/Desktop" -XDG_DOWNLOAD_DIR="$HOME/Temporal/Downloads" -XDG_TEMPLATES_DIR="$HOME/Temporal/Templates" -XDG_PUBLICSHARE_DIR="$HOME/Temporal/Public" -XDG_DOCUMENTS_DIR="$HOME/Documents" -XDG_MUSIC_DIR="$HOME/Media/Music" -XDG_PICTURES_DIR="$HOME/Media/Pictures" -XDG_VIDEOS_DIR="$HOME/Media/Videos" +XDG_DESKTOP_DIR="$HOME/var/desktop" +XDG_DOWNLOAD_DIR="$HOME/var/downloads" +XDG_TEMPLATES_DIR="$HOME/media/documents/templates" +XDG_PUBLICSHARE_DIR="$HOME/var/public" +XDG_DOCUMENTS_DIR="$HOME/media/documents" +XDG_MUSIC_DIR="$HOME/media/music" +XDG_PICTURES_DIR="$HOME/media/pictures" +XDG_VIDEOS_DIR="$HOME/media/videos" diff --git a/user/.config/vifm/vifmrc b/user/.config/vifm/vifmrc index 402ac2772..7c5e03db3 100644 --- a/user/.config/vifm/vifmrc +++ b/user/.config/vifm/vifmrc @@ -13,7 +13,7 @@ " Since emacs is a GUI app and not a terminal app like vim, append the command " with an ampersand (&). -set vicmd=nvim +set vicmd=~/.local/bin/lvim " 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 diff --git a/user/.local/bin/neovide b/user/.local/bin/neovide new file mode 100755 index 000000000..0c675cc55 --- /dev/null +++ b/user/.local/bin/neovide @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +neovide --neovim-bin "$HOME/.local/bin/lvim" diff --git a/user/.icons/default/index.theme b/user/.local/share/icons/default/index.theme similarity index 100% rename from user/.icons/default/index.theme rename to user/.local/share/icons/default/index.theme diff --git a/user/.xinitrc b/user/.xinitrc index 9bb3c56db..c4ece3114 100755 --- a/user/.xinitrc +++ b/user/.xinitrc @@ -28,16 +28,26 @@ if [ -f "$usermodmap" ]; then xmodmap "$usermodmap" fi +if xinput --list | grep -q "Elan TrackPoint"; then + xinput set-prop "TPPS/2 Elan TrackPoint" "libinput Accel Speed" 1 +fi + # environment variables export MOZ_USE_XINPUT2=1 export QT_STYLE_OVERRIDE=kvantum -export MEDIA_DIR="$HOME/Media" -export TEMP_DIR="$HOME/Temporal" # clean home export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" 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 GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0" export WGETRC="$HOME/.config/wget/wgetrc" @@ -52,4 +62,4 @@ export BROWSER="qutebrowser" export VIEWER="zathura" # start window manager / desktop environment -exec dwm +dbus-launch dwm