From 45f77579265f72e90b74656fba428c465c4da985 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Wed, 4 Nov 2020 11:58:06 +0800 Subject: [PATCH] [feature] dmenu launcher --- gui/binicon => suckless/config/dwm/appicons | 37 +++--- suckless/config/dwm/dwmbar | 137 -------------------- suckless/config/dwm/usercmds | 2 + suckless/install.sh | 3 + 4 files changed, 27 insertions(+), 152 deletions(-) rename gui/binicon => suckless/config/dwm/appicons (67%) delete mode 100755 suckless/config/dwm/dwmbar create mode 100644 suckless/config/dwm/usercmds diff --git a/gui/binicon b/suckless/config/dwm/appicons similarity index 67% rename from gui/binicon rename to suckless/config/dwm/appicons index 8dac6f2..0b48845 100644 --- a/gui/binicon +++ b/suckless/config/dwm/appicons @@ -1,26 +1,29 @@ + bulkrename  google-chrome + chromium-browser  compton  picom  android-studio  arandr  assistant  avahi-discover - blueman-adapters - blueman-manager - code-oss + blueman + bluetooth + code  nextcloud  dbeaver - electron9  electron -  File Manager - Mail Reader + mail + mutter  Preferred Applications - Terminal Emulator +ﱘ ncmpcpp + Terminal + xterm  Web Browser  firefox - gimp-2.10 - google-chrome-stable + gimp + ImageMagick  gucharmap ﱩ htop  java @@ -35,21 +38,25 @@ ﳻ openscad  flameshot פֿ ibus -פֿ ibus-extension-gtk3 -פֿ ibus-setup  file-roller  umbrello5  keepassxc  zathura פֿ qtcreator -墳 pavucontrol +墳pavucontrol  qt5ct  ranger  screenkey + keyboard  sxiv - ThunarBulkRename  thunar - thunar-settings  vim  virt-manager - + libre +着wifi +着wi-fi + font + network + gnome + python +ﰅ printer diff --git a/suckless/config/dwm/dwmbar b/suckless/config/dwm/dwmbar deleted file mode 100755 index 1e5431f..0000000 --- a/suckless/config/dwm/dwmbar +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env fish - -# symbola -set ICON_RECORDING 🎥 -set ICON_MUSIC ♬ -set ICON_MUTED 🔉 -set ICON_VOLUME 🔊 -set ICON_NIC 🖧 -set ICON_WIFI 📡 -set ICON_MEMORY 📈 -set ICON_TEMPERATURE 🌡 -set ICON_PLUGGED 🔌 -set ICON_BATTERY 🔋 -set ICON_DATETIME ⏲ - -# nerdfont -set ICON_RECORDING 辶 -set ICON_MUSIC  -set ICON_MUTED 'ﱝ ' -set ICON_VOLUME ' ' -set ICON_NIC ' ' -set ICON_WIFI ' ' -set ICON_MEMORY ' ' -set ICON_TEMPERATURE  -set ICON_PLUGGED ' ' -set ICON_BATTERY_0 ' ' -set ICON_BATTERY_1 ' ' -set ICON_BATTERY_2 ' ' -set ICON_BATTERY_3 ' ' -set ICON_BATTERY_4 ' ' -set ICON_DATETIME ' ' - - -function update - if pgrep slock - return - end - set -x text - if test -f /tmp/recording.pid - set text $text $ICON_RECORDING - end - # mpd - if which mpc 1>/dev/null 2>&1 - set music (mpc) - if string match -r playing "$music[2]" 1>/dev/null 2>&1 - set text $text "$ICON_MUSIC $music[1]" - end - end - # volume - set vol (amixer get Master) - if string match -r '\[off\]' "$vol" - set text $text "$ICON_MUTED 0" - else - set v (string match -r '\[(\d+)%\]' $vol | tail -n 1) - set text $text "$ICON_VOLUME $v" - end - # network - for nic in (ls -d /sys/class/net/e*) - if grep up $nic/operstate >/dev/null - set speed (cat $nic/speed)M - set text $text "$ICON_NIC $speed" - end - end - set wifi (grep "^\s*w" /proc/net/wireless | awk '{ print int($3 * 100 / 70) "%" }') - if test -n "$wifi" - set text $text "$ICON_WIFI $wifi" - end - # memory - set memory (free | awk '/^Mem:/ {print $3 "/" $2 "*" 100}' | math -s0) - set text $text "$ICON_MEMORY $memory%" - # cpu - set cpu (sensors | awk '/Core /{print $3}' | sort -r | head -n 1) - if test -n "$cpu" - set text $text "$ICON_TEMPERATURE $cpu" - end - # battery - set battery (cat /sys/class/power_supply/BAT0/capacity 2>/dev/null || echo "-1") - if test $battery -gt -1 - set plugged (cat /sys/class/power_supply/AC/online) - if test $plugged -eq 1 - set battery "$ICON_PLUGGED $battery%" - else if test -n "$ICON_BATTERY" - set battery "$ICON_BATTERY $battery%" - else if test -n "$ICON_BATTERY_0" - if test ""$battery -gt 90 - set battery "$ICON_BATTERY_4 $battery%" - else if test $battery -gt 75 - set battery "$ICON_BATTERY_3 $battery%" - else if test $battery -gt 50 - set battery "$ICON_BATTERY_2 $battery%" - else if test $battery -gt 25 - set battery "$ICON_BATTERY_1 $battery%" - else - set battery "$ICON_BATTERY_0 $battery%" - end - end - set text $text "$battery" - end - # | sed 's/Mon/一/; s/Tue/二/; s/Wed/三/; s/Thu/四/; s/Fri/五/; s/Sat/六/; s/Sun/日/;' - set dt (date +"%m-%d %H:%M %a") - set text $text "$ICON_DATETIME $dt" - set text (string join ' ' $text) - xsetroot -name " $text " - - # prevent screen-saver when there is ongoing zoom metting - if xdotool search --name '^Zoom Meeting ID:' - xset s reset - end -end - -function loop - while true - update - sleep 1 - end -end - -function start - set script (status -f) - $script loop & -end - -function restart - pkill -f 'dwmbar loop' - start -end - -switch "$argv[1]" - case "update" - update - case "loop" - loop - case "start" - start - case "*" - restart -end diff --git a/suckless/config/dwm/usercmds b/suckless/config/dwm/usercmds new file mode 100644 index 0000000..d765392 --- /dev/null +++ b/suckless/config/dwm/usercmds @@ -0,0 +1,2 @@ + poweroff + reboot diff --git a/suckless/install.sh b/suckless/install.sh index 348fe78..2672272 100755 --- a/suckless/install.sh +++ b/suckless/install.sh @@ -79,6 +79,7 @@ cat <<'EOT' > ~/.profile #!/bin/sh export PATH=$HOME/.local/bin +export VIM_MODE=enhanced # auto startx [ -z "$DISPLAY" -a -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq "1" ] && exec startx @@ -90,4 +91,6 @@ EOT mkdir -p "$XDG_CONFIG_HOME/dwm" cp "$DIR/config/dwm/autostart" "$XDG_CONFIG_HOME/dwm/autostart" lnsf "$DIR/config/dwm/statusbar" "$XDG_CONFIG_HOME/dwm/statusbar" +lnsf "$DIR/config/dwm/appicons" "$XDG_CONFIG_HOME/dwm/appicons" +lnsf "$DIR/config/dwm/usercmds" "$XDG_CONFIG_HOME/dwm/usercmds" lnsf "$DIR/config/autorandr/postswitch" "$XDG_CONFIG_HOME/autorandr/postswitch"