diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2023-06-25 17:52:44 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2023-06-25 17:52:57 +0200 |
| commit | 6ddcdbeada9319e2adf8263613717784fb0bfc4f (patch) | |
| tree | 0678d638df1db26c873a14d2588b779809ddd756 | |
| parent | 5fb6b3fd7ee86eff314c14548f87edf40aa8b203 (diff) | |
| download | dotfiles-6ddcdbeada9319e2adf8263613717784fb0bfc4f.tar.gz dotfiles-6ddcdbeada9319e2adf8263613717784fb0bfc4f.tar.bz2 dotfiles-6ddcdbeada9319e2adf8263613717784fb0bfc4f.zip | |
Added rofi config, updated xmonad and project-open with rofi
| -rw-r--r-- | config/rofi/config.rasi | 12 | ||||
| -rw-r--r-- | config/xmonad/xmonad.hs | 7 | ||||
| -rwxr-xr-x | local/bin/project-open | 12 |
3 files changed, 24 insertions, 7 deletions
diff --git a/config/rofi/config.rasi b/config/rofi/config.rasi new file mode 100644 index 0000000..e47b052 --- /dev/null +++ b/config/rofi/config.rasi @@ -0,0 +1,12 @@ +configuration { + kb-accept-entry: "Control+m,Return,KP_Enter"; + kb-remove-to-eol: ""; + kb-row-down: "Control+j"; + kb-row-up: "Control+k"; +} + +@theme "gruvbox-light" + +window { + width: 900px; +} diff --git a/config/xmonad/xmonad.hs b/config/xmonad/xmonad.hs index 22d6019..1ef262f 100644 --- a/config/xmonad/xmonad.hs +++ b/config/xmonad/xmonad.hs @@ -82,8 +82,9 @@ keys' = [ ("<XF86AudioLowerVolume>", spawn "pulseaudio-ctl down") , ("<XF86TouchpadToggle>", spawn "touchpad-toggle") , ("M-o", spawn "project-open") - , ("M-i", spawn $ myTerminal ++ " -e zsh -c 'source ~/.config/zsh/.zshrc && rc'") - , ("M-m", spawn $ myTerminal ++ " -e mocp -C /home/cacharle/.config/moc/config") + , ("M-p", spawn "rofi -show run") + , ("M-s", spawn "rofi -show ssh") + , ("M-w", spawn "rofi -show window") , ("M-S-d", spawn "notify-send -i x-office-calendar \"$(date +\"%H:%M %A %d/%m/%Y %B\")\"") , ("M-S-b", spawn $ "notify-send --hint=int:transient:1 " ++ "--hint=int:value:\"$(cat /sys/class/power_supply/BAT0/capacity)\" " ++ @@ -99,7 +100,7 @@ keys' = [ ("<XF86AudioLowerVolume>", spawn "pulseaudio-ctl down") confirm :: String -> X () -> X () confirm prompt f = do - result <- menuArgs "dmenu" ["-p", prompt] ["yes", "no"] + result <- menuArgs "rofi" ["-dmenu", "-p", prompt] ["yes", "no"] when (result == "yes") f restartCmd :: String diff --git a/local/bin/project-open b/local/bin/project-open index aa6ca57..213315a 100755 --- a/local/bin/project-open +++ b/local/bin/project-open @@ -1,12 +1,16 @@ #!/bin/sh +command -v rofi && + menu_exec='rofi -dmenu' || + menu_exec='dmenu' + # shellcheck disable=SC2088 # (tile does not expand in single quote) dest=$( find ~/git -mindepth 1 -maxdepth 1 -printf '%A@\t%f\n' | sort -r | cut -f 2 | - dmenu -l 10 -p '~/git/' + $menu_exec -l 10 -p '~/git/' ) [ -z "$dest" ] && exit 1 @@ -20,7 +24,7 @@ then else while [ -z "$choice" ] do - choice=$(printf 'create\nclone\ncancel' | dmenu -p "New repository at ~/git/$dest?") + choice=$(printf 'create\nclone\ncancel' | $menu_exec -p "New repository at ~/git/$dest?") done case "$choice" in @@ -34,7 +38,7 @@ else "clone") while [ -z "$remote_choice" ] do - remote_choice=$(printf 'home\ngithub.com\ncacharle.xyz\nclipboard\nother' | dmenu -p "Remote location") + remote_choice=$(printf 'home\ngithub.com\ncacharle.xyz\nclipboard\nother' | $menu_exec -p "Remote location") done case "$remote_choice" in home) prefix='git@home-nuc:' ;; @@ -43,7 +47,7 @@ else clipboard) dest="$(xclip -selection clipboard -o)" ;; other) ;; esac - url="$prefix$(echo "$dest" | dmenu -p "Enter repository url: $prefix")" + url="$prefix$(echo "$dest" | $menu_exec -p "Enter repository url: $prefix")" "$TERMINAL" -e /bin/sh -c "git clone --recursive '$url' '$dest_path' && cd '$dest_path' && exec $SHELL" || notify-send -u critical "Could not clone $url in $dest_path" && exit 1 ;; |
