Ver Fonte

use feh instead of rofi (for tagpreview)

siduck76 há 3 anos atrás
pai
commit
a7106713e3
4 ficheiros alterados com 12 adições e 29 exclusões
  1. 3 7
      .dwm/save_tagpreview
  2. 5 6
      .dwm/tag_preview
  3. 4 3
      chadwm/config.def.h
  4. 0 13
      rofi/tag.rasi

+ 3 - 7
.dwm/save_tagpreview

@@ -2,11 +2,7 @@
 
 preview_dir="$HOME/.dwm/tag_previews/"
 
-current_tag=$(($(wmctrl -d | grep '*' | cut -d ' ' -f1) + 1)) # get tag number, and add 1
+current_tag=$(($(wmctrl -d | sed -E -n '/\*/{s/(.).*/\1/p; d}' ) + 1)) # get tag number, and add 1
 
-save_Screenshot() {
-  file="${preview_dir}${current_tag}.jpeg"
-  scrot -o "${file}"
-}
-
-$(save_Screenshot)
+file="${preview_dir}${current_tag}.jpeg"
+scrot -o "${file}"

+ 5 - 6
.dwm/tag_preview

@@ -3,13 +3,12 @@
 screenshot_dir="$HOME/.dwm/tag_previews/"
 
 if [ "$1" == "--hide" ]; then # If first argument is --hide execute
-  killall rofi 2>/dev/null
-  shift # shift the first argument
+  killall feh # temp
+  shift
 fi
 
 if [ "$1" == "--show" ]; then # If first argument is --show execute
-  file="${screenshot_dir}${2}.jpeg"                              # $2 is the tag which will be previewed
-  [ -f $file ] || exit 1                                        # Exit when file does not exist
-  sed -i "s:${HOME}/.*\.jpeg:$file:" $HOME/.config/rofi/tag.rasi #overwrites the tagname in rofi config
-  rofi -show drun -theme tag 2>/dev/null
+  file="${screenshot_dir}${2}.jpeg" # $2 is the tag which will be previewed
+  [ -f $file ] || exit 1            # Exit if file doesnt exist
+  feh -g 230x130+10+40 --scale-down $file
 fi

+ 4 - 3
chadwm/config.def.h

@@ -81,9 +81,10 @@ static const Rule rules[] = {
      *	WM_CLASS(STRING) = instance, class
      *	WM_NAME(STRING) = title
      */
-    /* class      instance    title       tags mask     isfloating   monitor */
-    { "Gimp",     NULL,       NULL,       0,            1,           -1 },
-    { "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
+       	/* class      instance    title       tags mask     iscentered   isfloating   monitor */
+	{ "Gimp",     NULL,       NULL,       0,            0,           1,           -1 },
+	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           0,           -1 },
+      	{ "feh",      NULL,       NULL,       0,            0,           1,           -1 },
 };
 
 /* layout(s) */

+ 0 - 13
rofi/tag.rasi

@@ -1,13 +0,0 @@
-configuration {
-    location: 1;
-    xoffset: 51;
-    yoffset: 41;
-  }
-
-window {
-    background-color:  #2E3440;
-    padding: 310px;
-    width: 220px;
-    height: 122px;
-    background-image: url("/home/sid/.dwm/tag_previews/4.jpeg",width);
-}