feat: -rofi +wofi & cleanup

master
Tim 5 months ago
parent 075f462446
commit 777e4c8d4e
  1. 2
      .gitignore
  2. 3
      .gitmodules
  3. 21
      bin/soundmenu
  4. 36
      bin/wofi-calc
  5. 3
      config/sway/apps.conf
  6. 11
      config/sway/config
  7. 16
      config/sway/input.conf
  8. 1
      wal

2
.gitignore vendored

@ -1,2 +1,4 @@
*.un~
work-*
fonts/*
config/waybar/scripts/blog*

3
.gitmodules vendored

@ -1,3 +0,0 @@
[submodule "wal"]
path = wal
url = https://github.com/dylanaraps/wal.git

@ -4,15 +4,24 @@
option0="Headphones"
option1="MainScreen"
option2="Second Screen"
option3="Bluetooth Jabra"
# options passed into variable
options="$option0\n$option1\n$option2"
options="$option0\n$option3\n$option1\n$option2"
chosen="$(echo -e "$options" | rofi -lines 3 -dmenu -width 20 -p "sound")"
chosen="$(echo -e "$options" | wofi \
--dmenu \
--lines 4 \
--columns 1 \
--prompt "sound" \
--width 5% \
--cache-file=/dev/null)"
case $chosen in
$option0)
pactl set-card-profile alsa_card.pci-0000_0b_00.4 output:analog-surround-21+input:analog-stereo
pactl set-default-sink alsa_output.pci-0000_0b_00.4.analog-surround-21
pactl set-card-profile alsa_card.pci-0000_0b_00.4 output:analog-stereo+input:analog-stereo
pactl set-default-sink alsa_output.pci-0000_0b_00.4.analog-stereo
;;
$option1)
pactl set-card-profile alsa_card.pci-0000_09_00.1 output:hdmi-stereo-extra4
@ -22,4 +31,8 @@ case $chosen in
pactl set-card-profile alsa_card.pci-0000_09_00.1 output:hdmi-stereo-extra3
pactl set-default-sink alsa_output.pci-0000_09_00.1.hdmi-stereo-extra5
;;
$option3)
pactl set-card-profile bluez_card.50_C2_ED_60_7C_2D a2dp-sink-sbc_xq
pactl set-default-sink bluez_output.50_C2_ED_60_7C_2D.a2dp-sink
;;
esac

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Stolen: https://github.com/Zeioth/wofi-calc/blob/main/wofi-calc.sh
RESULT_FILE="$HOME/.config/qalculate/qalc.result.history"
if [ ! -f "$RESULT_FILE" ]; then
touch $RESULT_FILE
fi
LAST_WOFI=""
QALC_RET=""
while :
do
qalc_hist=`tac $RESULT_FILE | head -1000`
WOFI_RET=`wofi --lines 5 --columns 1 --width 20% --sort-order=default --cache-file=/dev/null -d -p calc <<< "$qalc_hist"`
rtrn=$?
if test "$rtrn" = "0"; then
if [[ "$WOFI_RET" =~ .*=.* ]]; then
RESULT=`echo "$WOFI_RET" | awk {'print $NF'}`
wl-copy "$RESULT"
exit 0
else
QALC_RET=`qalc "$WOFI_RET"`
LAST_WOFI=$WOFI_RET
echo $QALC_RET >> $RESULT_FILE
fi
else
if [ ! -z "$LAST_WOFI" ]; then
RESULT=`qalc -t "$LAST_WOFI"`
wl-copy "$RESULT"
fi
exit 0
fi
done

@ -27,6 +27,7 @@ for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
for_window [app_id="mpv"] floating enable, resize set width 531 height 300, move position 120 700
for_window [window_type="menu"] floating enable
### Applications we start
@ -40,3 +41,5 @@ exec i3-focus-last server
exec firefox-bin
exec signal-desktop
exec alacritty
exec kvirc
exec keepassxc

@ -14,12 +14,14 @@ set $up k
set $right l
# Your preferred terminal emulator
set $term alacritty
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu "rofi -show run"
bindsym $mod+p exec --no-startup-id "rofi -show drun "
bindsym $mod+c exec --no-startup-id "rofi -show calc -modi calc -no-sort -no-bold > /dev/null"
set $menu "wofi --show run"
bindsym $mod+p exec --no-startup-id "wofi --show drun"
bindsym $mod+c exec --no-startup-id "$HOME/bin/wofi-calc"
bindsym $mod+t exec --no-startup-id "$HOME/bin/twitch-wofi.sh"
### Idle configuration
# This will lock your screen after X seconds of inactivity, then turn off
@ -117,6 +119,9 @@ bindsym $mod+a focus parent
bindsym $mod+Tab exec i3-focus-last
# Use i3-focus-last to switch
bindsym $mod+grave exec i3-focus-last menu
#bindsym $mod+grave exec sway-switch
#
# Scratchpad:
#

@ -1,13 +1,13 @@
# Input
#input "type:keyboard" {
# repeat_rate 30
# repeat_delay 300
# xkb_options caps:escape
#}
input "type:keyboard" {
repeat_rate 30
repeat_delay 300
xkb_options caps:escape
}
#input "type:mouse" {
# accel_profile "flat"
#}
input "type:mouse" {
accel_profile "flat"
}
#seat * hide_cursor when-typing enable

1
wal

@ -1 +0,0 @@
Subproject commit a93ee9436504753c76a4a982c409698038a27c0a
Loading…
Cancel
Save