update styling of rofi menu

This commit is contained in:
2025-05-03 23:47:00 -07:00
parent 99ae96eef9
commit 0fa6ed045b
2 changed files with 9 additions and 8 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
.git .git
screenshot

View File

@@ -46,12 +46,12 @@ func checkDeps() {
func main() { func main() {
checkDeps() checkDeps()
options := []Option{ options := []Option{
{"Select a region and save", []string{"sh", "-c", fmt.Sprintf("slurp | grim -g - '%s'", tmpScreenshot)}}, {"1. Select a region and save", []string{"sh", "-c", fmt.Sprintf("slurp | grim -g - '%s'", tmpScreenshot)}},
{"Select a region and copy to clipboard", []string{"sh", "-c", "slurp | grim -g - - | wl-copy"}}, {"2. Select a region and copy to clipboard", []string{"sh", "-c", "slurp | grim -g - - | wl-copy"}},
{"Whole screen", []string{"grim", tmpScreenshot}}, {"3. Whole screen", []string{"grim", tmpScreenshot}},
{"Current window", []string{"sh", "-c", fmt.Sprintf("hyprctl -j activewindow | jq -r '\\.at[0],(\\.at[1]) \\.size[0]x(\\.size[1])' | grim -g - '%s'", tmpScreenshot)}}, {"4. Current window", []string{"sh", "-c", fmt.Sprintf("hyprctl -j activewindow | jq -r '\\.at[0],(\\.at[1]) \\.size[0]x(\\.size[1])' | grim -g - '%s'", tmpScreenshot)}},
{"Edit", []string{"sh", "-c", "slurp | grim -g - - | swappy -f -"}}, {"5. Edit", []string{"sh", "-c", "slurp | grim -g - - | swappy -f -"}},
{"Quit", []string{"true"}}, {"6. Quit", []string{"true"}},
} }
var menu bytes.Buffer var menu bytes.Buffer
@@ -60,7 +60,7 @@ func main() {
menu.WriteByte('\n') menu.WriteByte('\n')
} }
rofi := exec.Command("rofi", "-dmenu", "-i", "-p", "Enter option or select from the list", "-mesg", "Select a Screenshot Option", "-format", "i") rofi := exec.Command("rofi", "-dmenu", "-i", "-p", "Enter option or select from the list", "-mesg", "Select a Screenshot Option", "-format", "i", "-theme-str", "listview {columns: 2; lines: 3;} window {width: 55%;}", "-yoffset", "30", "-xoffset", "30", "-a", "0", "-no-custom", "-location", "0")
rofi.Stdin = &menu rofi.Stdin = &menu
out, err := rofi.Output() out, err := rofi.Output()
if err != nil { if err != nil {
@@ -110,4 +110,4 @@ func main() {
} else { } else {
notify(fmt.Sprintf("Screenshot saved to %s", dest), "") notify(fmt.Sprintf("Screenshot saved to %s", dest), "")
} }
} }