Skip to content

Commit

Permalink
add bin files
Browse files Browse the repository at this point in the history
  • Loading branch information
hackartists committed Mar 30, 2024
1 parent d0948e1 commit eb66085
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 28 deletions.
94 changes: 94 additions & 0 deletions bin/custom_combi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/bin/bash

CMD_CALC="calc: Calculator"
CMD_EMOJI="emoji: Emoticons"
CMD_RUN="run: Run a command"
CMD_DRUN="drun: Run a desktop app"
CMD_CQ="clipboard: Copy from clipboard"
CMD_WM="window: Select a window"
CMD_SS="screenshot: Capture screen"
CMD_MON="monitor: monitor"
CMD_BMK="bookmarks:: Chrome bookmarks"
CMD_KILL="kill: kill a window"
CMD_SCRCPY="scrcpy: mirror mobile screen"
CMD_COLOR="color: color picker"
CMD_DICT="dict: dictionary"
CMD_UC="unicode: unicode symbols"

if [[ -z "$1" ]]; then
echo $CMD_CALC
echo $CMD_EMOJI
echo $CMD_RUN
echo $CMD_DRUN
echo $CMD_CQ
echo $CMD_WM
echo $CMD_SS
echo $CMD_MON
echo $CMD_BMK
echo $CMD_KILL
echo $CMD_SCRCPY
echo $CMD_COLOR
# translate-shell package
echo $CMD_DICT
echo $CMD_UC
fi

case $1 in
"$CMD_CALC" )
kill `pidof rofi`
rofi -show calc -modi calc -no-show-match -no-sort -calc-command "echo -n '{result}' | xclip -selection clipboard"
;;
"$CMD_DRUN" )
kill `pidof rofi`
rofi -show drun
;;
"$CMD_EMOJI" )
kill `pidof rofi`
rofi -show emoji
;;
"$CMD_RUN" )
kill `pidof rofi`
rofi -show run
;;
"$CMD_WM" )
kill `pidof rofi`
rofi -show window
;;
"$CMD_CQ" )
kill `pidof rofi`
rofi -show clipboard
;;
"$CMD_MON" )
kill `pidof rofi`
bash ~/.xmonad/bin/rofi-screen.sh
;;
"$CMD_SS" )
kill `pidof rofi`
sleep 0.7
scrot -s --freeze -e 'xclip -selection clipboard -t image/png -i $f'
;;
"$CMD_KILL" )
kill `pidof rofi`
xkill
;;
"$CMD_SCRCPY" )
kill `pidof rofi`
scrcpy
;;
"$CMD_COLOR" )
kill `pidof rofi`
colorpicker --short --one-shot | xclip -selection clipboard -i
;;
"$CMD_BMK" )
kill `pidof rofi`
~/.local/bin/rofi-browser-bookmarks google-chrome
;;
"$CMD_DICT" )
kill `pidof rofi`
echo $(trans "$2")
;;
"$CMD_UC" )
kill `pidof rofi`
echo $(rofi -modi "emoji:rofimoji" -show emoji)
;;
esac
8 changes: 0 additions & 8 deletions bin/emacsd.sh

This file was deleted.

4 changes: 4 additions & 0 deletions bin/mouselocation
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

eval $(xdotool getmouselocation --shell)
echo $X,$Y
4 changes: 4 additions & 0 deletions bin/pacupdate
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

cupd=$(checkupdates | wc -l)
echo "$cupd"
78 changes: 78 additions & 0 deletions bin/rofi-screen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env bash

OPT1="OdysseyG9: 3-screens and bottom"
OPT2="OdysseyG9: full-screen and bottom"
OPT3="OdysseyG9: full-screen and off"
OPT4="Mirror: USB-C FHD"
OPT5="Extend: USB-C FHD"
OPT6="One"
OPT7="Mirror: HDMI"
OPT8="Extend: HDMI"
OPT9="OdysseyG9: One on DP"

get_options() {
echo "$OPT9"
echo "$OPT3"
echo "$OPT2"
echo "$OPT4"
echo "$OPT1"
echo "$OPT5"
echo "$OPT6"
echo "$OPT7"
echo "$OPT8"
}

main() {
choice=$( (get_options) | rofi -dmenu -i -fuzzy -p "Screenshot" )

if [[ -z "${choice// }" ]]; then
exit 1
fi

case $choice in
"$OPT1")
xrandr --setmonitor VIRTUAL-LEFT 1280/297x1440/340+0+0 none
xrandr --setmonitor VIRTUAL-CENTER 2560/596x1440/340+1280+0 HDMI-0
xrandr --setmonitor VIRTUAL-RIGHT 1280/297x1440/340+3840+0 none
xrandr --fb 5120x1440
# xrandr --setmonitor ODYSSEY~1 1280/2980x1440/3350+0+0 HDMI-0
# xrandr --setmonitor ODYSSEY~2 2560/5960x1440/3350+1280+0 none
# xrandr --setmonitor ODYSSEY~3 1280/2980x1440/3350+3840+0 none
xrandr --output VIRTUAL-CENTER --mode 2560x1440 --output VIRTUAL-LEFT --mode 1280x1440 --left-of VIRTUAL-CENTER --output VIRTUAL-RIGHT --mode 1280x1440 --right-of VIRTUAL-CENTER
;;
"$OPT2")
xrandr --output HDMI-0 --mode 5120x1440 --output DP-4 --off
xrandr --output DP-4 --mode 1920x1080 --pos 1600x1440
;;
"$OPT3")
xrandr --output HDMI-0 --mode 5120x1440 --output DP-4 --off
;;
"$OPT4")
xrandr --output DP-4 --auto
xrandr --output DP-0 --same-as DP-4 --auto
;;
"$OPT5")
xrandr --output DP-4 --auto
xrandr --output DP-0 --auto --right-of DP-4
;;
"$OPT6")
xrandr --output DP-4 --auto
xrandr --output HDMI-0 --off
xrandr --output DP-0 --off
;;
"$OPT7")
xrandr --output HDMI-0 --same-as DP-4 --auto
;;
"$OPT8")
xrandr --output DP-4 --auto
xrandr --output HDMI-0 --auto --right-of DP-4
;;
"$OPT9")
xrandr --output DP-4 --mode 5120x1440 --output HDMI-0 --off
;;
esac
}

main "$@" &

exit 0
3 changes: 3 additions & 0 deletions bin/volume
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master)
7 changes: 3 additions & 4 deletions xmobarrc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ Config {
, Run Cpu ["-t", "<total>%","-H","50","--high","red"] 20
, Run Memory ["-t", "<used>M"] 20
, Run DiskU [("/", "<free>")] [] 60
, Run Com "bash" ["-c", "~/.local/bin/pacupdate"] "updates" 3600
, Run Com "bash" ["-c", "~/.local/bin/mouselocation"] "mouselocation" 1
, Run Com "bash" ["-c", "~/.local/bin/volume"] "volume" 1
, Run Com "bash" ["-c", "~/.xmonad/bin/pacupdate"] "updates" 3600
, Run Com "bash" ["-c", "~/.xmonad/bin/mouselocation"] "mouselocation" 1
, Run Com "bash" ["-c", "~/.xmonad/bin/volume"] "volume" 1
, Run Com "uname" ["-r"] "" 3600
, Run Com "bash" ["-c", "~/.xmonad/gh-notify.sh"] "gh" 30
, Run Com "bash" ["-c", "~/.xmonad/bin/emacsd.sh"] "emacsd" 36000
, Run UnsafeStdinReader
]
, sepChar = "%"
Expand Down
29 changes: 13 additions & 16 deletions xmonad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -393,23 +393,16 @@ layoutAction = makeAction 1
appFavoriteAction = makeAction 2 [
(name, key, spawn cmd)
| (name, key, cmd) <- [ ("ranger", (0, xK_1), "urxvt -e ranger")
, ("(a)udacity", (0, xK_a), "audacity")
-- Figma only supports font helper for window and Mac OS
, ("(c)hrome", (0, xK_c), "google-chrome-stable")
, ("(f)igma", (0, xK_f), "google-chrome-unstable --user-agent=\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36\" https://www.figma.com/")
, ("(d)eadbeef", (0, xK_d), "deadbeef")
, ("(e)macsclient", (0, xK_e), "emacsclient -c -a emacs")
, ("geany", (0, xK_1), "geany")
, ("geary", (0, xK_1), "geary")
, ("(d)iscord", (0, xK_d), "discord")
, ("call(g)rind", (0, xK_g), "kcachegrind")
, ("(g)imp", (0, xK_1), "gimp")
, ("(k)denlive", (0, xK_k), "kdenlive")
, ("LibreOffice (i)mpress", (0, xK_i), "loimpress")
, ("LibreOffice w(r)iter", (0, xK_r), "lowriter")
, ("(o)bs", (0, xK_o), "obs")
, ("(p)cmanfm", (0, xK_p), "pcmanfm")
, ("sc(r)cpy", (0, xK_r), "scrcpy -K")
, ("(s)lack", (0, xK_s), "slack")
, ("(w)hatapps", (0, xK_w), "QT_IM_MODULE='uim' GTK_IM_MODULE='uim' XMODIFIERS='@im=uim' whatsdesk")
, ("wire(s)hark", (0, xK_s), "sudo wireshark")
, ("(m)ain emacs", (0, xK_m), "emacs --name emacs-main")
]
]
Expand Down Expand Up @@ -593,9 +586,7 @@ myManageHook = composeAll
, className =? "Vmware" --> doShift "5:vm"
, className =? "org.remmina.Remmina" --> doShift "5:vm"
, className =? "zoom" --> doShift "6:msg"
, className =? "Slack" --> doShift "6:msg"
, className =? "whatsdesk" --> doShift "6:msg"
, className =? "discord" --> doShift "6:msg"
, className =? "TelegramDesktop" --> doShift "6:msg"
, className =? "yakyak" --> doShift "6:msg"
, title =? "WhatsApp" --> doShift "6:msg"
Expand All @@ -614,7 +605,6 @@ myManageHook = composeAll
, title =? "MongoDB Compass" --> doShift "9:db"
, title =? "NoiseTorch" --> doShift "0:misc"
, className =? "Blueman-manager" --> doShift "0:misc"
-- , className =? "scrcpy" --> (doShift "0:misc" <+> doFloat)
, className =? "libreoffice-writer" --> doShift "0:misc"
-- , className =? "kakaotalk.exe" --> (doShift "0:misc" <+> doFloat)
, className =? "VirtualBox Manager" --> doShift "0:misc"
Expand All @@ -630,8 +620,11 @@ myManageHook = composeAll
, className =? "systemsettings" --> doCenterFloat
, title =? "ranger" --> doRectFloat (W.RationalRect 0.05 0.05 0.9 0.9)
, className =? "dolphin" --> doRectFloat (W.RationalRect 0.05 0.05 0.9 0.9)
, className =? "Slack" --> doRectFloat (W.RationalRect 0.05 0.05 0.9 0.9)
, className =? "discord" --> doRectFloat (W.RationalRect 0.05 0.05 0.9 0.9)
, resource =? "desktop_window" --> doIgnore
, className =? "stalonetray" --> doIgnore
, className =? "scrcpy" --> doFloat
, className =? "confirm" --> doFloat
, className =? "file_progress" --> doFloat
, className =? "dialog" --> doFloat
Expand All @@ -650,6 +643,9 @@ myManageHook = composeAll
-- , isFullscreen --> (doF W.focusDown <+> doFullFloat)
-- , isFullscreen --> doFullFloat
] <+> namedScratchpadManageHook myScratchPads
where chatApps = [
"discord", "slack"
]

myKeys conf@XConfig {XMonad.modMask = modMask} = M.fromList
[
Expand Down Expand Up @@ -776,9 +772,10 @@ main = do
False
$ setEwmhActivateHook acFh
$ ewmhFullscreen . ewmh
-- $ def
$ kdeConfig
{ manageHook = newFh <> manageHook kdeConfig <+> myManageHook <+> manageDocks
$ def
-- $ kdeConfig
-- { manageHook = newFh <> manageHook kdeConfig <+> myManageHook <+> manageDocks
{ manageHook = newFh <+> myManageHook <+> manageDocks
, handleEventHook = docksEventHook
, modMask = myModMask
, terminal = myTerminal
Expand Down

0 comments on commit eb66085

Please sign in to comment.